Skip to content

Commit

Permalink
Backport 1.23 main (#2371)
Browse files Browse the repository at this point in the history
DES-6516 build: bump versions for 1.23.0
docs: update CHANGELOG for 1.23.0
Add meta text to DataView (#2348)

OKTA-807412 feat: add metaText to DataView
fix: remove unnecessary CSS empty check
Merge branch 'main' into jk-table-meta
fix(odyssey-react-mui): remove reference to babel-loader package
Add onPaginationChange hook to DataView (#2365)

DES-6504 Add meta text to DataView (#2348)

OKTA-807412 feat: add metaText to DataView
fix: remove unnecessary CSS empty check
Merge branch 'main' into jk-table-meta
feat: add onPaginationChange hook
Merge branch '1.23' into jk-expose-pagination-change-on-dataview
fix: update tests to work in Bacon
fix: update tests to work in Bacon
fix: update tests to work in Bacon
fix(odyssey-storybook): trigger test run
  • Loading branch information
bryancunningham-okta authored Sep 26, 2024
1 parent 4530f69 commit 3bd3bac
Show file tree
Hide file tree
Showing 19 changed files with 190 additions and 44 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.23.0](https://github.com/okta/odyssey/compare/v1.19.0...v1.23.0) (2024-09-19)

### Features

- add additional action button and menu slot to table ([#2334](https://github.com/okta/odyssey/issues/2334)) ([52b3f38](https://github.com/okta/odyssey/commit/52b3f3832adc442e0219be16fe8a4d96cf100a4e))
- adds a generic top nav component ([#2296](https://github.com/okta/odyssey/issues/2296)) ([6f3165f](https://github.com/okta/odyssey/commit/6f3165f9fd4a1d1743c975b72132d4ec186d09bb))
- adds Aeonik and Inter to Odyssey Storybook ([#2355](https://github.com/okta/odyssey/issues/2355)) ([e89997e](https://github.com/okta/odyssey/commit/e89997eeb83a461aa1a94c47ebea44b6a4a30990))
- adds new Shadow DOM export with better naming ([#2338](https://github.com/okta/odyssey/issues/2338)) ([0997e36](https://github.com/okta/odyssey/commit/0997e36afd4d241f5b3960528aff2865fb6d6ac3))
- automatically scroll to the first isSelected SideNavItem ([#2325](https://github.com/okta/odyssey/issues/2325)) ([52ce441](https://github.com/okta/odyssey/commit/52ce44137ffe5601cfa6044782a21afb5449167e))

### Bug Fixes

- Add missing props to Storybook ([#2313](https://github.com/okta/odyssey/issues/2313)) ([bbf96a2](https://github.com/okta/odyssey/commit/bbf96a257160b922c0ebc31b1c5dec1fe31c35b4))
- Applitools isn't consistently running VRTs ([#2314](https://github.com/okta/odyssey/issues/2314)) ([0c9a10c](https://github.com/okta/odyssey/commit/0c9a10ca9036e34f74dd383f26dda8dc77211c90))
- fixes translations not working with TypeScript ([#2354](https://github.com/okta/odyssey/issues/2354)) ([37653ee](https://github.com/okta/odyssey/commit/37653ee47c2fab8b54dec26efd5115f6633c2977))
- **odyssey-design-tokens:** using correct weights in SB ([#2363](https://github.com/okta/odyssey/issues/2363)) ([2dfa614](https://github.com/okta/odyssey/commit/2dfa614cd4c09d71d8624be690ae788e134a74ba))
- **odyssey-react-mui:** Add min-heights to keep correct heights ([#2324](https://github.com/okta/odyssey/issues/2324)) ([40d5a50](https://github.com/okta/odyssey/commit/40d5a5070ebfab1b650066e91b451c0ef4b3f2d8))
- remove invalid pseudo element from theme overrides ([#2310](https://github.com/okta/odyssey/issues/2310)) ([fea0793](https://github.com/okta/odyssey/commit/fea0793acf0800494270a87e4e5d65129942b99e))
- select multioption not rendering text when you use an options object ([#2323](https://github.com/okta/odyssey/issues/2323)) ([4bafbb9](https://github.com/okta/odyssey/commit/4bafbb99e03e52ad572fba9049013c058c75da38))
- Update Test Selector types and improve functionality ([#2333](https://github.com/okta/odyssey/issues/2333)) ([7039009](https://github.com/okta/odyssey/commit/703900947861dfb36b8996414130a8db3414ccfa))
- updates axios, body-parser libraries ([#2357](https://github.com/okta/odyssey/issues/2357)) ([7bc1deb](https://github.com/okta/odyssey/commit/7bc1deb4dc89218882750330aa023626d73b9fa7))

## [1.22.0](https://github.com/okta/odyssey/compare/v1.19.0...v1.22.0) (2024-09-05)

### Features
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"npmClient": "yarn",
"packages": ["packages/*"],
"useNx": false,
"version": "1.22.0"
"version": "1.23.0"
}
4 changes: 4 additions & 0 deletions packages/browserslist-config-odyssey/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.23.0](https://github.com/okta/odyssey/compare/v1.19.0...v1.23.0) (2024-09-19)

**Note:** Version bump only for package @okta/browserslist-config-odyssey

## [1.22.0](https://github.com/okta/odyssey/compare/v1.19.0...v1.22.0) (2024-09-05)

**Note:** Version bump only for package @okta/browserslist-config-odyssey
Expand Down
2 changes: 1 addition & 1 deletion packages/browserslist-config-odyssey/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@okta/browserslist-config-odyssey",
"version": "1.22.0",
"version": "1.23.0",
"description": "Browserslist config for Odyssey, Okta's design system",
"author": "Okta, Inc.",
"license": "Apache-2.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/odyssey-babel-preset/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.23.0](https://github.com/okta/odyssey/compare/v1.19.0...v1.23.0) (2024-09-19)

**Note:** Version bump only for package @okta/odyssey-babel-preset

## [1.22.0](https://github.com/okta/odyssey/compare/v1.19.0...v1.22.0) (2024-09-05)

**Note:** Version bump only for package @okta/odyssey-babel-preset
Expand Down
2 changes: 1 addition & 1 deletion packages/odyssey-babel-preset/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@okta/odyssey-babel-preset",
"version": "1.22.0",
"version": "1.23.0",
"description": "Babel preset for Odyssey, Okta's design system",
"author": "Okta, Inc.",
"license": "Apache-2.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/odyssey-design-tokens/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.23.0](https://github.com/okta/odyssey/compare/v1.19.0...v1.23.0) (2024-09-19)

**Note:** Version bump only for package @okta/odyssey-design-tokens

## [1.22.0](https://github.com/okta/odyssey/compare/v1.19.0...v1.22.0) (2024-09-05)

**Note:** Version bump only for package @okta/odyssey-design-tokens
Expand Down
2 changes: 1 addition & 1 deletion packages/odyssey-design-tokens/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@okta/odyssey-design-tokens",
"version": "1.22.0",
"version": "1.23.0",
"description": "Design tokens for Odyssey, Okta's design system",
"author": "Okta, Inc.",
"license": "Apache-2.0",
Expand Down
19 changes: 19 additions & 0 deletions packages/odyssey-react-mui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.23.0](https://github.com/okta/odyssey/compare/v1.19.0...v1.23.0) (2024-09-19)

### Features

- add additional action button and menu slot to table ([#2334](https://github.com/okta/odyssey/issues/2334)) ([52b3f38](https://github.com/okta/odyssey/commit/52b3f3832adc442e0219be16fe8a4d96cf100a4e))
- adds a generic top nav component ([#2296](https://github.com/okta/odyssey/issues/2296)) ([6f3165f](https://github.com/okta/odyssey/commit/6f3165f9fd4a1d1743c975b72132d4ec186d09bb))
- adds new Shadow DOM export with better naming ([#2338](https://github.com/okta/odyssey/issues/2338)) ([0997e36](https://github.com/okta/odyssey/commit/0997e36afd4d241f5b3960528aff2865fb6d6ac3))
- automatically scroll to the first isSelected SideNavItem ([#2325](https://github.com/okta/odyssey/issues/2325)) ([52ce441](https://github.com/okta/odyssey/commit/52ce44137ffe5601cfa6044782a21afb5449167e))

### Bug Fixes

- Add missing props to Storybook ([#2313](https://github.com/okta/odyssey/issues/2313)) ([bbf96a2](https://github.com/okta/odyssey/commit/bbf96a257160b922c0ebc31b1c5dec1fe31c35b4))
- fixes translations not working with TypeScript ([#2354](https://github.com/okta/odyssey/issues/2354)) ([37653ee](https://github.com/okta/odyssey/commit/37653ee47c2fab8b54dec26efd5115f6633c2977))
- **odyssey-design-tokens:** using correct weights in SB ([#2363](https://github.com/okta/odyssey/issues/2363)) ([2dfa614](https://github.com/okta/odyssey/commit/2dfa614cd4c09d71d8624be690ae788e134a74ba))
- **odyssey-react-mui:** Add min-heights to keep correct heights ([#2324](https://github.com/okta/odyssey/issues/2324)) ([40d5a50](https://github.com/okta/odyssey/commit/40d5a5070ebfab1b650066e91b451c0ef4b3f2d8))
- remove invalid pseudo element from theme overrides ([#2310](https://github.com/okta/odyssey/issues/2310)) ([fea0793](https://github.com/okta/odyssey/commit/fea0793acf0800494270a87e4e5d65129942b99e))
- select multioption not rendering text when you use an options object ([#2323](https://github.com/okta/odyssey/issues/2323)) ([4bafbb9](https://github.com/okta/odyssey/commit/4bafbb99e03e52ad572fba9049013c058c75da38))
- Update Test Selector types and improve functionality ([#2333](https://github.com/okta/odyssey/issues/2333)) ([7039009](https://github.com/okta/odyssey/commit/703900947861dfb36b8996414130a8db3414ccfa))

## [1.22.0](https://github.com/okta/odyssey/compare/v1.19.0...v1.22.0) (2024-09-05)

### Features
Expand Down
2 changes: 1 addition & 1 deletion packages/odyssey-react-mui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@okta/odyssey-react-mui",
"version": "1.22.0",
"version": "1.23.0",
"description": "React MUI components for Odyssey, Okta's design system",
"author": "Okta, Inc.",
"license": "Apache-2.0",
Expand Down
99 changes: 63 additions & 36 deletions packages/odyssey-react-mui/src/labs/DataView/DataView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,56 +76,83 @@ describe("DataView", () => {
});
expect(rowElements.length).toBe(21);

fireEvent.click(screen.getByText("Show more"));

waitFor(() => {
fireEvent.click(screen.getByText("Show more"));

const loadedRows = within(tableElement).getAllByRole("row", {
hidden: false,
});
expect(loadedRows.length).toBe(41);
});
});
});

it("resets the rows when searching", async () => {
render(
<DataView
availableLayouts={["table"]}
getData={getData}
tableLayoutOptions={{
columns: columns,
}}
hasSearch
hasPagination
// virtualization has to be false for the tests to work properly
enableVirtualization={false}
paginationType="loadMore"
resultsPerPage={20}
/>,
);

const tableElement = await screen.findByRole("table", { name: "" });
const rowElements = within(tableElement).getAllByRole("row", {
hidden: false,
});
expect(rowElements.length).toBe(21);

fireEvent.click(screen.getByText("Show more"));
it("resets the rows when searching", async () => {
render(
<DataView
availableLayouts={["table"]}
getData={getData}
tableLayoutOptions={{
columns: columns,
}}
hasSearch
hasPagination
// virtualization has to be false for the tests to work properly
enableVirtualization={false}
paginationType="loadMore"
resultsPerPage={20}
/>,
);

waitFor(() => {
const loadedRows = within(tableElement).getAllByRole("row", {
const tableElement = await screen.findByRole("table", { name: "" });
const rowElements = within(tableElement).getAllByRole("row", {
hidden: false,
});
expect(loadedRows.length).toBe(41);
expect(rowElements.length).toBe(21);

fireEvent.click(screen.getByText("Show more"));

waitFor(() => {
const loadedRows = within(tableElement).getAllByRole("row", {
hidden: false,
});
expect(loadedRows.length).toBe(41);
});

const searchField = screen.getByPlaceholderText("Search");
fireEvent.change(searchField, { target: { value: "John" } });

waitFor(() => {
const rowsAfterFilter = within(tableElement).getAllByRole("row", {
hidden: false,
});
expect(rowsAfterFilter.length).toBeLessThanOrEqual(21);
});
});

const searchField = screen.getByPlaceholderText("Search");
fireEvent.change(searchField, { target: { value: "John" } });
it("fires onPaginationChange when pagination changes", async () => {
let currentPage = 1;
const onPaginationChange = (pagination: {
pageIndex: number;
pageSize: number;
}) => {
currentPage = pagination.pageIndex;
};

waitFor(() => {
const rowsAfterFilter = within(tableElement).getAllByRole("row", {
hidden: false,
render(
<>
<DataView
getData={getData}
hasPagination
onPaginationChange={onPaginationChange}
/>
</>,
);

const nextButton = screen.getByLabelText("Next page");
fireEvent.click(nextButton);

await waitFor(() => {
expect(currentPage).toBe(2);
});
expect(rowsAfterFilter.length).toBeLessThanOrEqual(21);
});
});
6 changes: 6 additions & 0 deletions packages/odyssey-react-mui/src/labs/DataView/DataView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ const DataView = ({
totalRows,
maxPages,
maxResultsPerPage,
onPaginationChange,
}: DataViewProps) => {
const odysseyDesignTokens = useOdysseyDesignTokens();
const { t } = useTranslation();
Expand Down Expand Up @@ -218,6 +219,11 @@ const DataView = ({
}));
}, [filters, paginationType, resultsPerPage, search]);

// Fire onPaginationChange if pagination changes
useEffect(() => {
onPaginationChange?.(pagination);
}, [onPaginationChange, pagination]);

// Retrieve the data
useEffect(() => {
fetchData({
Expand Down
11 changes: 11 additions & 0 deletions packages/odyssey-react-mui/src/labs/DataView/componentTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,19 @@ export type UniversalProps = {
maxResultsPerPage?: number;
metaText?: string;
noResultsPlaceholder?: ReactNode;
/**
* @deprecated onChangeRowSelection is now onRowSelectionChange
*/
onChangeRowSelection?: (rowSelection: DataRowSelectionState) => void;
onPaginationChange?: ({
pageIndex,
pageSize,
}: {
pageIndex: number;
pageSize: number;
}) => void;
onReorderRows?: ({ rowId, newRowIndex }: DataOnReorderRowsType) => void;
onRowSelectionChange?: (rowSelection: DataRowSelectionState) => void;
paginationType?: (typeof paginationTypeValues)[number];
resultsPerPage?: number;
searchDelayTime?: number;
Expand Down
20 changes: 20 additions & 0 deletions packages/odyssey-storybook/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.23.0](https://github.com/okta/odyssey/compare/v1.19.0...v1.23.0) (2024-09-19)

### Features

- add additional action button and menu slot to table ([#2334](https://github.com/okta/odyssey/issues/2334)) ([52b3f38](https://github.com/okta/odyssey/commit/52b3f3832adc442e0219be16fe8a4d96cf100a4e))
- adds a generic top nav component ([#2296](https://github.com/okta/odyssey/issues/2296)) ([6f3165f](https://github.com/okta/odyssey/commit/6f3165f9fd4a1d1743c975b72132d4ec186d09bb))
- adds Aeonik and Inter to Odyssey Storybook ([#2355](https://github.com/okta/odyssey/issues/2355)) ([e89997e](https://github.com/okta/odyssey/commit/e89997eeb83a461aa1a94c47ebea44b6a4a30990))
- adds new Shadow DOM export with better naming ([#2338](https://github.com/okta/odyssey/issues/2338)) ([0997e36](https://github.com/okta/odyssey/commit/0997e36afd4d241f5b3960528aff2865fb6d6ac3))
- automatically scroll to the first isSelected SideNavItem ([#2325](https://github.com/okta/odyssey/issues/2325)) ([52ce441](https://github.com/okta/odyssey/commit/52ce44137ffe5601cfa6044782a21afb5449167e))

### Bug Fixes

- Add missing props to Storybook ([#2313](https://github.com/okta/odyssey/issues/2313)) ([bbf96a2](https://github.com/okta/odyssey/commit/bbf96a257160b922c0ebc31b1c5dec1fe31c35b4))
- Applitools isn't consistently running VRTs ([#2314](https://github.com/okta/odyssey/issues/2314)) ([0c9a10c](https://github.com/okta/odyssey/commit/0c9a10ca9036e34f74dd383f26dda8dc77211c90))
- **odyssey-design-tokens:** using correct weights in SB ([#2363](https://github.com/okta/odyssey/issues/2363)) ([2dfa614](https://github.com/okta/odyssey/commit/2dfa614cd4c09d71d8624be690ae788e134a74ba))
- **odyssey-react-mui:** Add min-heights to keep correct heights ([#2324](https://github.com/okta/odyssey/issues/2324)) ([40d5a50](https://github.com/okta/odyssey/commit/40d5a5070ebfab1b650066e91b451c0ef4b3f2d8))
- select multioption not rendering text when you use an options object ([#2323](https://github.com/okta/odyssey/issues/2323)) ([4bafbb9](https://github.com/okta/odyssey/commit/4bafbb99e03e52ad572fba9049013c058c75da38))
- Update Test Selector types and improve functionality ([#2333](https://github.com/okta/odyssey/issues/2333)) ([7039009](https://github.com/okta/odyssey/commit/703900947861dfb36b8996414130a8db3414ccfa))
- updates axios, body-parser libraries ([#2357](https://github.com/okta/odyssey/issues/2357)) ([7bc1deb](https://github.com/okta/odyssey/commit/7bc1deb4dc89218882750330aa023626d73b9fa7))

## [1.22.0](https://github.com/okta/odyssey/compare/v1.19.0...v1.22.0) (2024-09-05)

### Features
Expand Down
2 changes: 1 addition & 1 deletion packages/odyssey-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@okta/odyssey-storybook",
"version": "1.22.0",
"version": "1.23.0",
"description": "Documentation for Odyssey, Okta's design system",
"author": "Okta, Inc.",
"license": "Apache-2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -989,3 +989,28 @@ export const LoadMore: StoryObj<DataViewMetaProps> = {
hasFilters: true,
},
};

export const PaginationHook: StoryObj<DataViewMetaProps> = {
render: function C() {
const [data, setData] = useState<Person[]>(personData);
const { getData } = useDataCallbacks(data, setData);

const onPaginationChange = (pagination: {
pageIndex: number;
pageSize: number;
}) => {
console.log(pagination);
};

return (
<DataView
hasPagination
onPaginationChange={onPaginationChange}
tableLayoutOptions={{
columns: personColumns,
}}
getData={getData}
/>
);
},
};
4 changes: 4 additions & 0 deletions packages/odyssey-svgr/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.23.0](https://github.com/okta/odyssey/compare/v1.19.0...v1.23.0) (2024-09-19)

**Note:** Version bump only for package @okta/odyssey-svgr

## [1.22.0](https://github.com/okta/odyssey/compare/v1.19.0...v1.22.0) (2024-09-05)

**Note:** Version bump only for package @okta/odyssey-svgr
Expand Down
2 changes: 1 addition & 1 deletion packages/odyssey-svgr/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@okta/odyssey-svgr",
"version": "1.22.0",
"version": "1.23.0",
"description": "Configuration files for svgr icon conversion",
"author": "Okta, Inc.",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/publish-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ git checkout .
# All packages are built by `prepack`.

# update version with commit SHA to allow lerna to publish
FILES_TO_UPDATE_VERSION="lerna.json packages/odyssey-design-tokens/package.json packages/odyssey-babel-preset/package.json packages/odyssey-babel-loader/package.json packages/odyssey-react-mui/package.json packages/browserslist-config-odyssey/package.json packages/odyssey-storybook/package.json"
FILES_TO_UPDATE_VERSION="lerna.json packages/odyssey-design-tokens/package.json packages/odyssey-babel-preset/package.json packages/odyssey-react-mui/package.json packages/browserslist-config-odyssey/package.json packages/odyssey-storybook/package.json"
for PATH_AND_FILE in $FILES_TO_UPDATE_VERSION; do
FULL_PATH="$OKTA_HOME/$REPO/$PATH_AND_FILE"
json_contents="$(jq '.version = "'$TAGGED_VERSION'"' $FULL_PATH)" && \
Expand Down

0 comments on commit 3bd3bac

Please sign in to comment.