Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Workspace] Update workspace list page table #7640

Merged
merged 18 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
41c8d00
the table basically works
Qxisylolo Aug 5, 2024
e76395c
the table basically works new
Qxisylolo Aug 6, 2024
d601e94
This time I achieve the functionality and apprearence of the workList…
Qxisylolo Aug 7, 2024
c77079f
This time I achieve the functionality and apprearence of the workList…
Qxisylolo Aug 7, 2024
c6323e8
This time I achieve the functionality and apprearence of the workList…
Qxisylolo Aug 7, 2024
2f03420
Achieve the functionality and apprearence of the workLists table, and…
Qxisylolo Aug 7, 2024
a577aa4
Changeset file for PR #7640 created/updated
opensearch-changeset-bot[bot] Aug 7, 2024
d368602
Changeset file for PR #7640 created/updated
opensearch-changeset-bot[bot] Aug 7, 2024
670b04c
Changeset file for PR #7640 created/updated
opensearch-changeset-bot[bot] Aug 7, 2024
220a4f0
Achieve the functionality and apprearence of the work List table page…
Qxisylolo Aug 8, 2024
3b3850d
Achieve the functionality and apprearence of the work List table page…
Qxisylolo Aug 8, 2024
9b3410f
Achieve the functionality and apprearence of the work List table page…
Qxisylolo Aug 8, 2024
86b4513
Achieve the functionality and apprearence of the work List table page…
Qxisylolo Aug 8, 2024
18ba7ca
Enable multiple deletion and correct the code based on comments
Qxisylolo Aug 8, 2024
62e451a
Enable multiple deletion and correct the code based on comments
Qxisylolo Aug 9, 2024
4b26196
set the advanced date format
Qxisylolo Aug 14, 2024
9fc525c
set advanced time format and tests
Qxisylolo Aug 14, 2024
94703a0
Merge main branch
Qxisylolo Aug 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ describe('WorkspaceList', () => {
it('should be able to perform the time format transformation', async () => {
const { getByText } = render(getWrapWorkspaceListInContext());
expect(
getByText(moment('1999-08-06T00:00:00.00Z').format('MMM DD[,]YYYY [@] HH:mm:ss.SSS'))
getByText(moment('1999-08-06T00:00:00.00Z').format('MMM D, YYYY @ HH:mm:ss.SSS'))
).toBeInTheDocument();
expect(
getByText(moment('1999-08-06T01:00:00.00Z').format('MMM DD[,]YYYY [@] HH:mm:ss.SSS'))
getByText(moment('1999-08-06T01:00:00.00Z').format('MMM D, YYYY @ HH:mm:ss.SSS'))
).toBeInTheDocument();
expect(
getByText(moment('1999-08-06T02:00:00.00Z').format('MMM DD[,]YYYY [@] HH:mm:ss.SSS'))
getByText(moment('1999-08-06T02:00:00.00Z').format('MMM D, YYYY @ HH:mm:ss.SSS'))
).toBeInTheDocument();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
const extractUseCaseFromFeatures = useCallback(
(features: string[]) => {
if (!features || features.length === 0) {
return '';

Check warning on line 73 in src/plugins/workspace/public/components/workspace_list/index.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/workspace/public/components/workspace_list/index.tsx#L73

Added line #L73 was not covered by tests
}
const useCaseId = getFirstUseCaseOfFeatureConfigs(features);
const usecase =
Expand Down Expand Up @@ -103,7 +103,7 @@
});
if (!appUrl) return '';

return cleanWorkspaceId(appUrl);

Check warning on line 106 in src/plugins/workspace/public/components/workspace_list/index.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/workspace/public/components/workspace_list/index.tsx#L106

Added line #L106 was not covered by tests
}, [application, http]);

const emptyStateMessage = useMemo(() => {
Expand Down Expand Up @@ -156,29 +156,29 @@
return;
}

const onClick = () => {
const deleteWorkspacesByIds = (workSpaces: WorkspaceAttribute[], ids: string[]) => {
const needToBeDeleteWorkspaceList: WorkspaceAttribute[] = [];
const needToBeDeletedWorkspaceList: WorkspaceAttribute[] = [];
ids.forEach((id) => {
const index = workSpaces.findIndex((workSpace) => workSpace.id === id);

Check warning on line 163 in src/plugins/workspace/public/components/workspace_list/index.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/workspace/public/components/workspace_list/index.tsx#L159-L163

Added lines #L159 - L163 were not covered by tests
if (index >= 0) {
needToBeDeleteWorkspaceList.push(workSpaces[index]);
needToBeDeletedWorkspaceList.push(workSpaces[index]);

Check warning on line 165 in src/plugins/workspace/public/components/workspace_list/index.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/workspace/public/components/workspace_list/index.tsx#L165

Added line #L165 was not covered by tests
}
});
return needToBeDeleteWorkspaceList;
return needToBeDeletedWorkspaceList;

Check warning on line 168 in src/plugins/workspace/public/components/workspace_list/index.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/workspace/public/components/workspace_list/index.tsx#L168

Added line #L168 was not covered by tests
};

setDeletedWorkspaces(

Check warning on line 171 in src/plugins/workspace/public/components/workspace_list/index.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/workspace/public/components/workspace_list/index.tsx#L171

Added line #L171 was not covered by tests
deleteWorkspacesByIds(
newWorkspaceList,
selection.map((item) => item.id)

Check warning on line 174 in src/plugins/workspace/public/components/workspace_list/index.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/workspace/public/components/workspace_list/index.tsx#L174

Added line #L174 was not covered by tests
)
);

setSelection([]);

Check warning on line 178 in src/plugins/workspace/public/components/workspace_list/index.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/workspace/public/components/workspace_list/index.tsx#L178

Added line #L178 was not covered by tests
};

return (

Check warning on line 181 in src/plugins/workspace/public/components/workspace_list/index.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/workspace/public/components/workspace_list/index.tsx#L181

Added line #L181 was not covered by tests
<>
<EuiButton color="danger" iconType="trash" onClick={onClick}>
Delete {selection.length} Workspace
Expand All @@ -186,7 +186,7 @@
{deletedWorkspaces && deletedWorkspaces.length > 0 && (
<DeleteWorkspaceModal
selectedWorkspaces={deletedWorkspaces}
onClose={() => setDeletedWorkspaces([])}

Check warning on line 189 in src/plugins/workspace/public/components/workspace_list/index.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/workspace/public/components/workspace_list/index.tsx#L189

Added line #L189 was not covered by tests
/>
)}
</>
Expand Down Expand Up @@ -277,7 +277,7 @@
width: '25%',
truncateText: false,
render: (lastUpdatedTime: string) => {
return moment(lastUpdatedTime).format('MMM DD[,]YYYY [@] HH:mm:ss.SSS');
return moment(lastUpdatedTime).format('MMM D, YYYY @ HH:mm:ss.SSS');
},
},

Expand Down Expand Up @@ -310,7 +310,7 @@
color: 'danger',
description: 'Edit workspace',
'data-test-subj': 'workspace-list-edit-icon',
onClick: ({ id }: WorkspaceAttribute) => handleSwitchWorkspace(id),

Check warning on line 313 in src/plugins/workspace/public/components/workspace_list/index.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/workspace/public/components/workspace_list/index.tsx#L313

Added line #L313 was not covered by tests
render: ({ id }: WorkspaceAttribute) => {
return (
<EuiButtonEmpty
Expand Down
Loading