diff --git a/client/public/locales/en/translation.json b/client/public/locales/en/translation.json index f170b96306..f7e7d3b991 100644 --- a/client/public/locales/en/translation.json +++ b/client/public/locales/en/translation.json @@ -313,6 +313,7 @@ "migrationWaves": "Migration waves", "migrationWave(s)": "Migration wave(s)", "name": "Name", + "none": "None", "northboundDependencies": "Northbound dependencies", "notAvailable": "Not available", "notConnected": "Not connected", @@ -367,6 +368,9 @@ "tagDeleted": "Tag deleted", "tagName": "Tag name", "tags": "Tags", + "tagsArchetype": "Archetype Tags", + "tagsAssessment": "Assessment Tags", + "tagsCriteria": "Criteria Tags", "target": "Target", "tagCategory": "Tag category", "tagCategoryDeleted": "Tag category deleted", @@ -387,6 +391,9 @@ "tag": "Tag", "YAMLTemplate": "YAML template" }, + "titles": { + "archetypeDrawer": "Archetype details" + }, "toastr": { "success": { "saveWhat": "{{type}} {{what}} was successfully saved.", diff --git a/client/src/app/components/PageDrawerContext.tsx b/client/src/app/components/PageDrawerContext.tsx index 9da68c42ce..7a6c95ed05 100644 --- a/client/src/app/components/PageDrawerContext.tsx +++ b/client/src/app/components/PageDrawerContext.tsx @@ -6,6 +6,7 @@ import { DrawerContent, DrawerContentBody, DrawerHead, + DrawerPanelBody, DrawerPanelContent, DrawerPanelContentProps, } from "@patternfly/react-core"; @@ -13,7 +14,7 @@ import pageStyles from "@patternfly/react-styles/css/components/Page/page"; const usePageDrawerState = () => { const [isDrawerExpanded, setIsDrawerExpanded] = React.useState(false); - const [drawerChildren, setDrawerChildren] = + const [drawerPanelContent, setDrawerPanelContent] = React.useState(null); const [drawerPanelContentProps, setDrawerPanelContentProps] = React.useState< Partial @@ -23,8 +24,8 @@ const usePageDrawerState = () => { return { isDrawerExpanded, setIsDrawerExpanded, - drawerChildren, - setDrawerChildren, + drawerPanelContent, + setDrawerPanelContent, drawerPanelContentProps, setDrawerPanelContentProps, drawerPageKey, @@ -38,8 +39,8 @@ type PageDrawerState = ReturnType; const PageDrawerContext = React.createContext({ isDrawerExpanded: false, setIsDrawerExpanded: () => {}, - drawerChildren: null, - setDrawerChildren: () => {}, + drawerPanelContent: null, + setDrawerPanelContent: () => {}, drawerPanelContentProps: {}, setDrawerPanelContentProps: () => {}, drawerPageKey: "", @@ -58,7 +59,7 @@ export const PageContentWithDrawerProvider: React.FC< const { isDrawerExpanded, drawerFocusRef, - drawerChildren, + drawerPanelContent, drawerPanelContentProps, drawerPageKey, } = pageDrawerState; @@ -80,7 +81,7 @@ export const PageContentWithDrawerProvider: React.FC< key={drawerPageKey} {...drawerPanelContentProps} > - {drawerChildren} + {drawerPanelContent} } > @@ -98,6 +99,7 @@ let numPageDrawerContentInstances = 0; export interface IPageDrawerContentProps { isExpanded: boolean; onCloseClick: () => void; // Should be used to update local state such that `isExpanded` becomes false. + header?: React.ReactNode; children: React.ReactNode; // The content to show in the drawer when `isExpanded` is true. drawerPanelContentProps?: Partial; // Additional props for the DrawerPanelContent component. focusKey?: string | number; // A unique key representing the object being described in the drawer. When this changes, the drawer will regain focus. @@ -105,17 +107,18 @@ export interface IPageDrawerContentProps { } export const PageDrawerContent: React.FC = ({ - isExpanded: localIsExpandedProp, + isExpanded, onCloseClick, + header = null, children, - drawerPanelContentProps: localDrawerPanelContentProps, + drawerPanelContentProps, focusKey, pageKey: localPageKeyProp, }) => { const { setIsDrawerExpanded, drawerFocusRef, - setDrawerChildren, + setDrawerPanelContent, setDrawerPanelContentProps, setDrawerPageKey, } = React.useContext(PageDrawerContext); @@ -137,12 +140,12 @@ export const PageDrawerContent: React.FC = ({ // This is the ONLY place where `setIsDrawerExpanded` should be called. // To expand/collapse the drawer, use the `isExpanded` prop when rendering PageDrawerContent. React.useEffect(() => { - setIsDrawerExpanded(localIsExpandedProp); + setIsDrawerExpanded(isExpanded); return () => { setIsDrawerExpanded(false); - setDrawerChildren(null); + setDrawerPanelContent(null); }; - }, [localIsExpandedProp]); + }, [isExpanded, setDrawerPanelContent, setIsDrawerExpanded]); // Same with pageKey and drawerPanelContentProps, keep them in sync with the local prop on PageDrawerContent. React.useEffect(() => { @@ -150,33 +153,46 @@ export const PageDrawerContent: React.FC = ({ return () => { setDrawerPageKey(""); }; - }, [localPageKeyProp]); + }, [localPageKeyProp, setDrawerPageKey]); React.useEffect(() => { - setDrawerPanelContentProps(localDrawerPanelContentProps || {}); - }, [localDrawerPanelContentProps]); + setDrawerPanelContentProps(drawerPanelContentProps || {}); + }, [drawerPanelContentProps, setDrawerPanelContentProps]); // If the drawer is already expanded describing app A, then the user clicks app B, we want to send focus back to the drawer. React.useEffect(() => { drawerFocusRef?.current?.focus(); - }, [focusKey]); + }, [drawerFocusRef, focusKey]); React.useEffect(() => { - setDrawerChildren( - - - {children} - - - - - + const drawerHead = header === null ? children : header; + const drawerPanelBody = header === null ? null : children; + + setDrawerPanelContent( + <> + + + {drawerHead} + + + + + + {drawerPanelBody} + ); - }, [children]); + }, [ + children, + drawerFocusRef, + header, + isExpanded, + onCloseClick, + setDrawerPanelContent, + ]); return null; }; diff --git a/client/src/app/pages/archetypes/archetypes-page.tsx b/client/src/app/pages/archetypes/archetypes-page.tsx index b598df804e..586003ede1 100644 --- a/client/src/app/pages/archetypes/archetypes-page.tsx +++ b/client/src/app/pages/archetypes/archetypes-page.tsx @@ -47,6 +47,7 @@ import { import ArchetypeApplicationsColumn from "./components/archetype-applications-column"; import ArchetypeDescriptionColumn from "./components/archetype-description-column"; +import ArchetypeDetailDrawer from "./components/archetype-detail-drawer"; import ArchetypeForm from "./components/archetype-form"; import ArchetypeMaintainersColumn from "./components/archetype-maintainers-column"; import ArchetypeTagsColumn from "./components/archetype-tags-column"; @@ -142,9 +143,11 @@ const Archetypes: React.FC = () => { paginationToolbarItemProps, paginationProps, tableProps, + getClickableTrProps, getThProps, getTdProps, }, + activeRowDerivedState: { activeRowItem, clearActiveRow }, } = tableControls; // TODO: RBAC access checks need to be added. Only Architect (and Administrator) personas @@ -267,9 +270,12 @@ const Archetypes: React.FC = () => { } numRenderedColumns={numRenderedColumns} > - {currentPageItems?.map((archetype, rowIndex) => ( - - + + {currentPageItems?.map((archetype, rowIndex) => ( + { - - ))} + ))} + { + + {/* Create modal */} void; + archetype: Archetype | null; +} + +const ArchetypeDetailDrawer: React.FC = ({ + onCloseClick, + archetype, +}) => { + const { t } = useTranslation(); + + return ( + + + {t("titles.archetypeDrawer")} + + + {archetype?.name} + + + } + > + + + {t("terms.description")} + + {archetype?.description || ( + + )} + + + + + {t("terms.tagsCriteria")} + + {archetype?.criteriaTags?.length ?? 0 > 0 ? ( + + ) : ( + + )} + + + + + {t("terms.tagsArchetype")} + + {archetype?.tags?.length ?? 0 > 0 ? ( + + ) : ( + + )} + + + + + {t("terms.tagsAssessment")} + + {archetype?.assessmentTags?.length ?? 0 > 0 ? ( + + ) : ( + + )} + + + + + {t("terms.maintainers")} + + + + + {t("terms.stakeholder(s)")} + + + + {archetype?.stakeholders?.length ?? 0 > 0 ? ( + + ) : ( + + )} + + + + + + + + {t("terms.stakeholderGroup(s)")} + + + + {archetype?.stakeholderGroups?.length ?? 0 > 0 ? ( + + ) : ( + + )} + + + + + + + {t("terms.comments")} + + {archetype?.comments || ( + + )} + + + + + {/* TODO: action buttons -- primary: "Close", link: "Edit archetype" */} + + ); +}; + +const TagLabels: React.FC<{ tags?: Tag[] }> = ({ tags }) => + (tags?.length ?? 0) === 0 ? null : ( + + {(tags as Tag[]) + .sort((a, b) => a.name.localeCompare(b.name)) + .map((sh) => ( + + ))} + + ); + +const StakeholderLabels: React.FC<{ archetype: Archetype }> = ({ + archetype, +}) => + (archetype.stakeholders?.length ?? 0) === 0 ? null : ( + + {archetype.stakeholders?.map((sh) => ( + + ))} + + ); + +const StakeholderGroupsLabels: React.FC<{ archetype: Archetype }> = ({ + archetype, +}) => + (archetype.stakeholderGroups?.length ?? 0) === 0 ? null : ( + + {archetype.stakeholderGroups?.map((sh) => ( + + ))} + + ); + +export default ArchetypeDetailDrawer; diff --git a/client/src/app/pages/archetypes/components/archetype-form/archetype-form.tsx b/client/src/app/pages/archetypes/components/archetype-form/archetype-form.tsx index 47e9417431..cf0c5d2e3d 100644 --- a/client/src/app/pages/archetypes/components/archetype-form/archetype-form.tsx +++ b/client/src/app/pages/archetypes/components/archetype-form/archetype-form.tsx @@ -15,6 +15,7 @@ import { import type { Archetype, New, + Ref, Stakeholder, StakeholderGroup, Tag, @@ -174,14 +175,20 @@ export const ArchetypeForm: React.FC = ({ ? undefined : (values.stakeholders .map((name) => stakeholders.find((s) => s.name === name)) - .filter(Boolean) as Stakeholder[]), + .map((sh) => + !sh ? undefined : { id: sh.id, name: sh.name } + ) + .filter(Boolean) as Ref[]), stakeholderGroups: values.stakeholderGroups === undefined ? undefined : (values.stakeholderGroups .map((name) => stakeholderGroups.find((s) => s.name === name)) - .filter(Boolean) as StakeholderGroup[]), + .map((sg) => + !sg ? undefined : { id: sg.id, name: sg.name } + ) + .filter(Boolean) as Ref[]), }; if (archetype && !isDuplicating) { @@ -190,7 +197,7 @@ export const ArchetypeForm: React.FC = ({ createArchetype(payload); } }; - console.log("values", getValues(), getFieldState("criteriaTags"), formState); + return (
findAll(Pageable pageable){" - facts: - file: file:///addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/controller/CustomerController.java - kind: Method - name: getById - - id: 4 - createtime: 2023-09-12T21:14:56.933410129Z - file: /addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/model/Customer.java - line: 0 - message: Numbers and dates are now indexed as numeric fields by default. Properties - of type int, long, float, double, and their. corresponding wrapper classes are - no longer indexed as strings. Instead, they are now indexed using Lucene’s appropriate - numeric. encoding. The id fields are an exception to this rule. Even when they - are represented by a numeric type, they are still indexed as. a string keyword - by default. The use of `@NumericField` is now obsolete unless you want to specify - a custom precision for the numeric. encoding. You can keep the old string-based - index format by explicitly specifying a string encoding field bridge. In the - case of. integers, this is the `org.hibernate.search.bridge.builtin.IntegerBridge`. - Check the `org.hibernate.search.bridge.builtin` package for. other publicly - available field bridges.. Date and Calendar are no longer indexed as strings. - Instead, instances are encoded as long values representing the number. of milliseconds - since January 1, 1970, 00:00:00 GMT. You can switch the indexing format by using - the new EncodingType enum. For example:. ```java. @DateBridge(encoding=EncodingType.STRING). - @CalendarBridge(encoding=EncodingType.STRING). ```. The encoding change for - numbers and dates is important and can have a big impact on application behavior. - If you have. a query that targets a field that was previously string-encoded, - but is now encoded numerically, you must update the query. Numeric. fields must - be searched with a NumericRangeQuery. You must also make sure that all fields - targeted by faceting are string encoded.. If you use the Search query DSL, the - correct query should be created automatically for you. - codesnip: "11 @Entity\n12 @Table(name = \"customers\")\n13 public class Customer - {\n14 \t@Id\n15 @SequenceGenerator(\n16 name = \"customersSequence\",\n17 - \ sequenceName = \"customers_id_seq\",\n18 allocationSize - = 1,\n19 initialValue = 6)\n20 @GeneratedValue(strategy = - GenerationType.SEQUENCE, generator = \"customersSequence\")\n21 \tprivate Long - id;\n22 \t\n23 \t@Column(length = 20)\n24 \tprivate String username;\n25 - \ \t\n26 \t@Column(length = 20)\n27 \tprivate String name;\n28 \t\n29 \t@Column(length - = 40)\n30 \tprivate String surname;\n31 \t" - facts: - file: file:///addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/model/Customer.java - kind: Field - name: id - - id: 5 - createtime: 2023-09-12T21:14:56.933410129Z - file: /addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/model/Customer.java - line: 0 - message: Numbers and dates are now indexed as numeric fields by default. Properties - of type int, long, float, double, and their. corresponding wrapper classes are - no longer indexed as strings. Instead, they are now indexed using Lucene’s appropriate - numeric. encoding. The id fields are an exception to this rule. Even when they - are represented by a numeric type, they are still indexed as. a string keyword - by default. The use of `@NumericField` is now obsolete unless you want to specify - a custom precision for the numeric. encoding. You can keep the old string-based - index format by explicitly specifying a string encoding field bridge. In the - case of. integers, this is the `org.hibernate.search.bridge.builtin.IntegerBridge`. - Check the `org.hibernate.search.bridge.builtin` package for. other publicly - available field bridges.. Date and Calendar are no longer indexed as strings. - Instead, instances are encoded as long values representing the number. of milliseconds - since January 1, 1970, 00:00:00 GMT. You can switch the indexing format by using - the new EncodingType enum. For example:. ```java. @DateBridge(encoding=EncodingType.STRING). - @CalendarBridge(encoding=EncodingType.STRING). ```. The encoding change for - numbers and dates is important and can have a big impact on application behavior. - If you have. a query that targets a field that was previously string-encoded, - but is now encoded numerically, you must update the query. Numeric. fields must - be searched with a NumericRangeQuery. You must also make sure that all fields - targeted by faceting are string encoded.. If you use the Search query DSL, the - correct query should be created automatically for you. - codesnip: "34 \t\n35 \t@Column(name = \"zipcode\", length = 10)\n36 \tprivate - String zipCode;\n37 \t\n38 \t@Column(length = 40)\n39 \tprivate String city;\n40 - \ \t\n41 \t@Column(length = 40)\n42 \tprivate String country;\n43 \t\n44 - \ \tpublic Long getId() {\n45 \t\treturn id;\n46 \t}\n47 \tpublic void setId(Long - id) {\n48 \t\tthis.id = id;\n49 \t}\n50 \tpublic String getUsername() {\n51 - \ \t\treturn username;\n52 \t}\n53 \tpublic void setUsername(String username) - {\n54 \t\tthis.username = username;" - facts: - file: file:///addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/model/Customer.java - kind: Method - name: getId - - id: 6 - createtime: 2023-09-12T21:14:56.933410129Z - file: /addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/model/Customer.java - line: 0 - message: Numbers and dates are now indexed as numeric fields by default. Properties - of type int, long, float, double, and their. corresponding wrapper classes are - no longer indexed as strings. Instead, they are now indexed using Lucene’s appropriate - numeric. encoding. The id fields are an exception to this rule. Even when they - are represented by a numeric type, they are still indexed as. a string keyword - by default. The use of `@NumericField` is now obsolete unless you want to specify - a custom precision for the numeric. encoding. You can keep the old string-based - index format by explicitly specifying a string encoding field bridge. In the - case of. integers, this is the `org.hibernate.search.bridge.builtin.IntegerBridge`. - Check the `org.hibernate.search.bridge.builtin` package for. other publicly - available field bridges.. Date and Calendar are no longer indexed as strings. - Instead, instances are encoded as long values representing the number. of milliseconds - since January 1, 1970, 00:00:00 GMT. You can switch the indexing format by using - the new EncodingType enum. For example:. ```java. @DateBridge(encoding=EncodingType.STRING). - @CalendarBridge(encoding=EncodingType.STRING). ```. The encoding change for - numbers and dates is important and can have a big impact on application behavior. - If you have. a query that targets a field that was previously string-encoded, - but is now encoded numerically, you must update the query. Numeric. fields must - be searched with a NumericRangeQuery. You must also make sure that all fields - targeted by faceting are string encoded.. If you use the Search query DSL, the - correct query should be created automatically for you. - codesnip: "37 \t\n38 \t@Column(length = 40)\n39 \tprivate String city;\n40 - \ \t\n41 \t@Column(length = 40)\n42 \tprivate String country;\n43 \t\n44 - \ \tpublic Long getId() {\n45 \t\treturn id;\n46 \t}\n47 \tpublic void setId(Long - id) {\n48 \t\tthis.id = id;\n49 \t}\n50 \tpublic String getUsername() {\n51 - \ \t\treturn username;\n52 \t}\n53 \tpublic void setUsername(String username) - {\n54 \t\tthis.username = username;\n55 \t}\n56 \tpublic String getName() - {\n57 \t\treturn name;" - facts: - file: file:///addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/model/Customer.java - kind: Method - name: setId - - id: 7 - createtime: 2023-09-12T21:14:56.933410129Z - file: /addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/repository/CustomerRepository.java - line: 0 - message: Numbers and dates are now indexed as numeric fields by default. Properties - of type int, long, float, double, and their. corresponding wrapper classes are - no longer indexed as strings. Instead, they are now indexed using Lucene’s appropriate - numeric. encoding. The id fields are an exception to this rule. Even when they - are represented by a numeric type, they are still indexed as. a string keyword - by default. The use of `@NumericField` is now obsolete unless you want to specify - a custom precision for the numeric. encoding. You can keep the old string-based - index format by explicitly specifying a string encoding field bridge. In the - case of. integers, this is the `org.hibernate.search.bridge.builtin.IntegerBridge`. - Check the `org.hibernate.search.bridge.builtin` package for. other publicly - available field bridges.. Date and Calendar are no longer indexed as strings. - Instead, instances are encoded as long values representing the number. of milliseconds - since January 1, 1970, 00:00:00 GMT. You can switch the indexing format by using - the new EncodingType enum. For example:. ```java. @DateBridge(encoding=EncodingType.STRING). - @CalendarBridge(encoding=EncodingType.STRING). ```. The encoding change for - numbers and dates is important and can have a big impact on application behavior. - If you have. a query that targets a field that was previously string-encoded, - but is now encoded numerically, you must update the query. Numeric. fields must - be searched with a NumericRangeQuery. You must also make sure that all fields - targeted by faceting are string encoded.. If you use the Search query DSL, the - correct query should be created automatically for you. - codesnip: " 1 package io.konveyor.demo.ordermanagement.repository;\n 2 \n 3 - \ import io.konveyor.demo.ordermanagement.model.Customer;\n 4 import org.springframework.data.repository.PagingAndSortingRepository;\n - 5 \n 6 public interface CustomerRepository extends PagingAndSortingRepository {\n 7 \n 8 }\n" - facts: - file: file:///addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/repository/CustomerRepository.java - kind: Interface - name: CustomerRepository - - id: 8 - createtime: 2023-09-12T21:14:56.933410129Z - file: /addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/service/CustomerService.java - line: 0 - message: Numbers and dates are now indexed as numeric fields by default. Properties - of type int, long, float, double, and their. corresponding wrapper classes are - no longer indexed as strings. Instead, they are now indexed using Lucene’s appropriate - numeric. encoding. The id fields are an exception to this rule. Even when they - are represented by a numeric type, they are still indexed as. a string keyword - by default. The use of `@NumericField` is now obsolete unless you want to specify - a custom precision for the numeric. encoding. You can keep the old string-based - index format by explicitly specifying a string encoding field bridge. In the - case of. integers, this is the `org.hibernate.search.bridge.builtin.IntegerBridge`. - Check the `org.hibernate.search.bridge.builtin` package for. other publicly - available field bridges.. Date and Calendar are no longer indexed as strings. - Instead, instances are encoded as long values representing the number. of milliseconds - since January 1, 1970, 00:00:00 GMT. You can switch the indexing format by using - the new EncodingType enum. For example:. ```java. @DateBridge(encoding=EncodingType.STRING). - @CalendarBridge(encoding=EncodingType.STRING). ```. The encoding change for - numbers and dates is important and can have a big impact on application behavior. - If you have. a query that targets a field that was previously string-encoded, - but is now encoded numerically, you must update the query. Numeric. fields must - be searched with a NumericRangeQuery. You must also make sure that all fields - targeted by faceting are string encoded.. If you use the Search query DSL, the - correct query should be created automatically for you. - codesnip: "12 \n13 @Service\n14 @Transactional\n15 public class CustomerService - implements ICustomerService{\n16 \t\n17 \t@Autowired\n18 \tprivate CustomerRepository - repository;\n19 \t\n20 \tprivate static Logger logger = Logger.getLogger( - CustomerService.class.getName() );\n21 \t\n22 \tpublic Customer findById(Long - id) {\n23 \t\tlogger.debug(\"Entering CustomerService.findById()\");\n24 \t\tCustomer - c = repository.findById(id).orElse(null);\n25 \t\tlogger.debug(\"Returning - element: \" + c);\n26 \t\treturn c;\n27 \t}\n28 \t\n29 \tpublic PagefindAll(Pageable - pageable) {\n30 \t\tlogger.debug(\"Entering CustomerService.findAll()\");\n31 - \ \t\tPage p = repository.findAll(pageable);\n32 \t\tlogger.debug(\"Returning - element: \" + p);" - facts: - file: file:///addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/service/CustomerService.java - kind: Method - name: findById - - id: 9 - createtime: 2023-09-12T21:14:56.933410129Z - file: /addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/service/ICustomerService.java - line: 0 - message: Numbers and dates are now indexed as numeric fields by default. Properties - of type int, long, float, double, and their. corresponding wrapper classes are - no longer indexed as strings. Instead, they are now indexed using Lucene’s appropriate - numeric. encoding. The id fields are an exception to this rule. Even when they - are represented by a numeric type, they are still indexed as. a string keyword - by default. The use of `@NumericField` is now obsolete unless you want to specify - a custom precision for the numeric. encoding. You can keep the old string-based - index format by explicitly specifying a string encoding field bridge. In the - case of. integers, this is the `org.hibernate.search.bridge.builtin.IntegerBridge`. - Check the `org.hibernate.search.bridge.builtin` package for. other publicly - available field bridges.. Date and Calendar are no longer indexed as strings. - Instead, instances are encoded as long values representing the number. of milliseconds - since January 1, 1970, 00:00:00 GMT. You can switch the indexing format by using - the new EncodingType enum. For example:. ```java. @DateBridge(encoding=EncodingType.STRING). - @CalendarBridge(encoding=EncodingType.STRING). ```. The encoding change for - numbers and dates is important and can have a big impact on application behavior. - If you have. a query that targets a field that was previously string-encoded, - but is now encoded numerically, you must update the query. Numeric. fields must - be searched with a NumericRangeQuery. You must also make sure that all fields - targeted by faceting are string encoded.. If you use the Search query DSL, the - correct query should be created automatically for you. - codesnip: " 1 package io.konveyor.demo.ordermanagement.service;\n 2 \n 3 import - io.konveyor.demo.ordermanagement.model.Customer;\n 4 import org.springframework.data.domain.Page;\n - 5 import org.springframework.data.domain.Pageable;\n 6 \n 7 public interface - ICustomerService {\n 8 public Customer findById(Long id); \n 9 \t\n10 - \ \tpublic PagefindAll(Pageable pageable);\n11 \n12 }\n" - facts: - file: file:///addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/service/ICustomerService.java - kind: Method - name: findById - links: - - url: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html-single/migration_guide/#migrate_hibernate_search_number_and_date_index_formatting_changes - title: Number and Date Index Formatting Changes in Hibernate Search 5.x - - url: http://hibernate.org/search/documentation/migrate/5.0/#number-and-date-index-format - title: Number and date index format - - url: http://docs.jboss.org/hibernate/search/5.5/api/org/hibernate/search/bridge/builtin/package-summary.html - title: Javadoc API for org.hibernate.search.bridge.builtin package - - url: http://docs.jboss.org/hibernate/search/5.5/api/org/hibernate/search/bridge/builtin/IntegerBridge.html - title: Javadoc API for IntegerBridge - labels: - - konveyor.io/source=hibernate-search4 - - konveyor.io/source=eap6 - - konveyor.io/target=hibernate-search5 - - konveyor.io/target=eap7 - - hibernate-search - - hibernate -- id: 3 - createtime: 2023-09-12T21:14:56.933920338Z - ruleset: eap7/weblogic - rule: hsearch-00119 - name: "" - description: |- - Hibernate Search 5 - Changes in indexing numeric values - Numbers and dates now indexed as numeric fields by default.. Properties of type `Date`, `Calendar` as well as `int`, `long`, `float`, `double` and their corresponding wrappers, are no longer indexed as strings. Instead, they are now indexed using Lucene’s appropriate numeric encoding.. The `id` fields are an exception to this rule: even when these are represented by a numeric type, they will still be indexed as a string keyword by default.. - category: optional - effort: 1 - incidents: - - id: 10 - createtime: 2023-09-12T21:14:56.933993046Z - file: /addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/controller/CustomerController.java - line: 0 - message: 'Numbers and dates now indexed as numeric fields by default.. Properties - of type `Date`, `Calendar` as well as `int`, `long`, `float`, `double` and their - corresponding wrappers, are no longer indexed as strings. Instead, they are - now indexed using Lucene’s appropriate numeric encoding.. The `id` fields are - an exception to this rule: even when these are represented by a numeric type, - they will still be indexed as a string keyword by default..' - codesnip: "16 @RestController\n17 @RequestMapping(\"/customers\")\n18 public - class CustomerController {\n19 \t\n20 \t@Autowired\n21 \tprivate CustomerService - customerService;\n22 \t\n23 \tprivate static Logger logger = Logger.getLogger( - CustomerController.class.getName() );\n24 \t\n25 \t@GetMapping(value = \"/{id}\", - produces = MediaType.APPLICATION_JSON_VALUE)\n26 public Customer getById(@PathVariable(\"id\") - Long id) {\n27 \t\tCustomer c = customerService.findById(id);\n28 \t\tif (c - == null) {\n29 \t\t\tthrow new ResourceNotFoundException(\"Requested order - doesn't exist\");\n30 \t\t}\n31 \t\tlogger.debug(\"Returning element: \" + - c);\n32 \t\treturn c;\n33 \t}\n34 \t\n35 \t@RequestMapping\n36 \tpublic - Page findAll(Pageable pageable){" - facts: - file: file:///addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/controller/CustomerController.java - kind: Method - name: getById - - id: 11 - createtime: 2023-09-12T21:14:56.933993046Z - file: /addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/model/Customer.java - line: 0 - message: 'Numbers and dates now indexed as numeric fields by default.. Properties - of type `Date`, `Calendar` as well as `int`, `long`, `float`, `double` and their - corresponding wrappers, are no longer indexed as strings. Instead, they are - now indexed using Lucene’s appropriate numeric encoding.. The `id` fields are - an exception to this rule: even when these are represented by a numeric type, - they will still be indexed as a string keyword by default..' - codesnip: "11 @Entity\n12 @Table(name = \"customers\")\n13 public class Customer - {\n14 \t@Id\n15 @SequenceGenerator(\n16 name = \"customersSequence\",\n17 - \ sequenceName = \"customers_id_seq\",\n18 allocationSize - = 1,\n19 initialValue = 6)\n20 @GeneratedValue(strategy = - GenerationType.SEQUENCE, generator = \"customersSequence\")\n21 \tprivate Long - id;\n22 \t\n23 \t@Column(length = 20)\n24 \tprivate String username;\n25 - \ \t\n26 \t@Column(length = 20)\n27 \tprivate String name;\n28 \t\n29 \t@Column(length - = 40)\n30 \tprivate String surname;\n31 \t" - facts: - file: file:///addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/model/Customer.java - kind: Field - name: id - - id: 12 - createtime: 2023-09-12T21:14:56.933993046Z - file: /addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/model/Customer.java - line: 0 - message: 'Numbers and dates now indexed as numeric fields by default.. Properties - of type `Date`, `Calendar` as well as `int`, `long`, `float`, `double` and their - corresponding wrappers, are no longer indexed as strings. Instead, they are - now indexed using Lucene’s appropriate numeric encoding.. The `id` fields are - an exception to this rule: even when these are represented by a numeric type, - they will still be indexed as a string keyword by default..' - codesnip: "34 \t\n35 \t@Column(name = \"zipcode\", length = 10)\n36 \tprivate - String zipCode;\n37 \t\n38 \t@Column(length = 40)\n39 \tprivate String city;\n40 - \ \t\n41 \t@Column(length = 40)\n42 \tprivate String country;\n43 \t\n44 - \ \tpublic Long getId() {\n45 \t\treturn id;\n46 \t}\n47 \tpublic void setId(Long - id) {\n48 \t\tthis.id = id;\n49 \t}\n50 \tpublic String getUsername() {\n51 - \ \t\treturn username;\n52 \t}\n53 \tpublic void setUsername(String username) - {\n54 \t\tthis.username = username;" - facts: - file: file:///addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/model/Customer.java - kind: Method - name: getId - - id: 13 - createtime: 2023-09-12T21:14:56.933993046Z - file: /addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/model/Customer.java - line: 0 - message: 'Numbers and dates now indexed as numeric fields by default.. Properties - of type `Date`, `Calendar` as well as `int`, `long`, `float`, `double` and their - corresponding wrappers, are no longer indexed as strings. Instead, they are - now indexed using Lucene’s appropriate numeric encoding.. The `id` fields are - an exception to this rule: even when these are represented by a numeric type, - they will still be indexed as a string keyword by default..' - codesnip: "37 \t\n38 \t@Column(length = 40)\n39 \tprivate String city;\n40 - \ \t\n41 \t@Column(length = 40)\n42 \tprivate String country;\n43 \t\n44 - \ \tpublic Long getId() {\n45 \t\treturn id;\n46 \t}\n47 \tpublic void setId(Long - id) {\n48 \t\tthis.id = id;\n49 \t}\n50 \tpublic String getUsername() {\n51 - \ \t\treturn username;\n52 \t}\n53 \tpublic void setUsername(String username) - {\n54 \t\tthis.username = username;\n55 \t}\n56 \tpublic String getName() - {\n57 \t\treturn name;" - facts: - file: file:///addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/model/Customer.java - kind: Method - name: setId - - id: 14 - createtime: 2023-09-12T21:14:56.933993046Z - file: /addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/repository/CustomerRepository.java - line: 0 - message: 'Numbers and dates now indexed as numeric fields by default.. Properties - of type `Date`, `Calendar` as well as `int`, `long`, `float`, `double` and their - corresponding wrappers, are no longer indexed as strings. Instead, they are - now indexed using Lucene’s appropriate numeric encoding.. The `id` fields are - an exception to this rule: even when these are represented by a numeric type, - they will still be indexed as a string keyword by default..' - codesnip: " 1 package io.konveyor.demo.ordermanagement.repository;\n 2 \n 3 - \ import io.konveyor.demo.ordermanagement.model.Customer;\n 4 import org.springframework.data.repository.PagingAndSortingRepository;\n - 5 \n 6 public interface CustomerRepository extends PagingAndSortingRepository {\n 7 \n 8 }\n" - facts: - file: file:///addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/repository/CustomerRepository.java - kind: Interface - name: CustomerRepository - - id: 15 - createtime: 2023-09-12T21:14:56.933993046Z - file: /addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/service/CustomerService.java - line: 0 - message: 'Numbers and dates now indexed as numeric fields by default.. Properties - of type `Date`, `Calendar` as well as `int`, `long`, `float`, `double` and their - corresponding wrappers, are no longer indexed as strings. Instead, they are - now indexed using Lucene’s appropriate numeric encoding.. The `id` fields are - an exception to this rule: even when these are represented by a numeric type, - they will still be indexed as a string keyword by default..' - codesnip: "12 \n13 @Service\n14 @Transactional\n15 public class CustomerService - implements ICustomerService{\n16 \t\n17 \t@Autowired\n18 \tprivate CustomerRepository - repository;\n19 \t\n20 \tprivate static Logger logger = Logger.getLogger( - CustomerService.class.getName() );\n21 \t\n22 \tpublic Customer findById(Long - id) {\n23 \t\tlogger.debug(\"Entering CustomerService.findById()\");\n24 \t\tCustomer - c = repository.findById(id).orElse(null);\n25 \t\tlogger.debug(\"Returning - element: \" + c);\n26 \t\treturn c;\n27 \t}\n28 \t\n29 \tpublic PagefindAll(Pageable - pageable) {\n30 \t\tlogger.debug(\"Entering CustomerService.findAll()\");\n31 - \ \t\tPage p = repository.findAll(pageable);\n32 \t\tlogger.debug(\"Returning - element: \" + p);" - facts: - file: file:///addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/service/CustomerService.java - kind: Method - name: findById - - id: 16 - createtime: 2023-09-12T21:14:56.933993046Z - file: /addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/service/ICustomerService.java - line: 0 - message: 'Numbers and dates now indexed as numeric fields by default.. Properties - of type `Date`, `Calendar` as well as `int`, `long`, `float`, `double` and their - corresponding wrappers, are no longer indexed as strings. Instead, they are - now indexed using Lucene’s appropriate numeric encoding.. The `id` fields are - an exception to this rule: even when these are represented by a numeric type, - they will still be indexed as a string keyword by default..' - codesnip: " 1 package io.konveyor.demo.ordermanagement.service;\n 2 \n 3 import - io.konveyor.demo.ordermanagement.model.Customer;\n 4 import org.springframework.data.domain.Page;\n - 5 import org.springframework.data.domain.Pageable;\n 6 \n 7 public interface - ICustomerService {\n 8 public Customer findById(Long id); \n 9 \t\n10 - \ \tpublic PagefindAll(Pageable pageable);\n11 \n12 }\n" - facts: - file: file:///addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/service/ICustomerService.java - kind: Method - name: findById - links: - - url: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html-single/migration_guide/#migrate_miscellaneous_hibernate_search_changes - title: Miscellaneous Changes in Hibernate Search 5.x - - url: http://hibernate.org/search/documentation/migrate/5.5/#number-and-date-index-format - title: Numeric and Date index format - labels: - - konveyor.io/source=hibernate-search4 - - konveyor.io/source=eap6 - - konveyor.io/target=hibernate-search5 - - konveyor.io/target=eap7 - - hibernate-search - - hibernate -- id: 4 - createtime: 2023-09-12T21:14:56.934252671Z - ruleset: eap7/weblogic - rule: hibernate4-00039 - name: "" - description: |- - Hibernate 5 - Oracle12cDialect maps byte[] and Byte[] to BLOB - Previous versions of Hibernate have mapped `byte[]` and `Byte[]` to Oracle’s `LONG RAW` data type (via the JDBC `LONGVARBINARY` type). Oracle have deprecated the `LONG RAW` data type for many releases - possibly as far back as 8i.. Therefore it was decided to start having Hibernate map `byte[]` and `Byte[]` to `BLOB` for Oracle.. However, in the interest of backwards compatibility and not breaking existing applications it was also decided to limit this change to just the `Oracle12cDialect`. So starting in 5.1 applications using `Oracle12cDialect` and implicitly mapping `byte[]` and `Byte[]` values will start seeing those handled as `BLOB` data rather than `LONG RAW` data.. For existing applications that want to continue to use `Oracle12cDialect` and still continue to implicitly map `byte[]` and `Byte[]` attributes to `LONG RAW`, there is a new configuration setting you can use to enable that: `hibernate.dialect.oracle.prefer_longvarbinary`, which is `false `by default (map to `BLOB`). - category: mandatory - effort: 1 - incidents: - - id: 17 - createtime: 2023-09-12T21:14:56.934310588Z - file: /addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/model/Customer.java - line: 0 - message: 'Previous versions of Hibernate have mapped `byte[]` and `Byte[]` to - Oracle’s `LONG RAW` data type (via the JDBC `LONGVARBINARY` type). Oracle have - deprecated the `LONG RAW` data type for many releases - possibly as far back - as 8i.. Therefore it was decided to start having Hibernate map `byte[]` and - `Byte[]` to `BLOB` for Oracle.. However, in the interest of backwards compatibility - and not breaking existing applications it was also decided to limit this change - to just the `Oracle12cDialect`. So starting in 5.1 applications using `Oracle12cDialect` - and implicitly mapping `byte[]` and `Byte[]` values will start seeing those - handled as `BLOB` data rather than `LONG RAW` data.. For existing applications - that want to continue to use `Oracle12cDialect` and still continue to implicitly - map `byte[]` and `Byte[]` attributes to `LONG RAW`, there is a new configuration - setting you can use to enable that: `hibernate.dialect.oracle.prefer_longvarbinary`, - which is `false `by default (map to `BLOB`).' - codesnip: " 1 package io.konveyor.demo.ordermanagement.model;\n 2 \n 3 import - javax.persistence.Column;\n 4 import javax.persistence.Entity;\n 5 import - javax.persistence.GeneratedValue;\n 6 import javax.persistence.GenerationType;\n - 7 import javax.persistence.Id;\n 8 import javax.persistence.SequenceGenerator;\n - 9 import javax.persistence.Table;\n10 \n11 @Entity\n12 @Table(name = \"customers\")\n13 - \ public class Customer {\n14 \t@Id\n15 @SequenceGenerator(\n16 name - = \"customersSequence\",\n17 sequenceName = \"customers_id_seq\",\n18 - \ allocationSize = 1,\n19 initialValue = 6)\n20 @GeneratedValue(strategy - = GenerationType.SEQUENCE, generator = \"customersSequence\")\n21 \tprivate - Long id;" - facts: - file: file:///addon/source/example-applications/example-1/src/main/java/io/konveyor/demo/ordermanagement/model/Customer.java - kind: Class - name: Entity - labels: - - konveyor.io/source=hibernate4 - - konveyor.io/source=eap6 - - konveyor.io/target=hibernate5 - - konveyor.io/target=eap7 - - hibernate - - configuration - - Hibernate - -dependencies: -- id: 1 - createtime: 2023-09-12T21:14:56.934497213Z - name: io.konveyor.demo.config-utils - version: 1.0.0 - sha: FE4FE11AAEE77BE10035218537FBF4B2E6EF1D9F