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]Fix workspace assets page UI bugs #8265

Merged
merged 14 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions changelogs/fragments/8265.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- [Workspace]Fix workspace assets page UI bugs ([#8265](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8265))
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,15 @@

let allowedObjectTypes: string[] | undefined;

const title = i18n.translate('savedObjectsManagement.objects.savedObjectsTitle', {
const savedObjectsTitle = i18n.translate('savedObjectsManagement.objects.savedObjectsTitle', {
defaultMessage: 'Saved Objects',
});
const workspaceAssetsTitle = i18n.translate('savedObjectsManagement.objects.workspaceAssetsTitle', {
defaultMessage: 'Workspace assets',
});
const assetsTitle = i18n.translate('savedObjectsManagement.objects.assetsTitle', {
defaultMessage: 'Assets',
});

const SavedObjectsEditionPage = lazy(() => import('./saved_objects_edition_page'));
const SavedObjectsTablePage = lazy(() => import('./saved_objects_table_page'));
Expand All @@ -75,7 +81,19 @@
? allowedObjectTypes
: allowedObjectTypes.filter((type) => type !== 'data-source');

coreStart.chrome.docTitle.change(title);
const useUpdatedUX = coreStart.uiSettings.get('home:useNewHomePage');
const currentWorkspaceId = coreStart.workspaces.currentWorkspaceId$.getValue();
const getDocTitle = () => {

Check warning on line 86 in src/plugins/saved_objects_management/public/management_section/mount_section.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/saved_objects_management/public/management_section/mount_section.tsx#L84-L86

Added lines #L84 - L86 were not covered by tests
if (currentWorkspaceId) {
return workspaceAssetsTitle;

Check warning on line 88 in src/plugins/saved_objects_management/public/management_section/mount_section.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/saved_objects_management/public/management_section/mount_section.tsx#L88

Added line #L88 was not covered by tests
}
if (useUpdatedUX) {
return assetsTitle;

Check warning on line 91 in src/plugins/saved_objects_management/public/management_section/mount_section.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/saved_objects_management/public/management_section/mount_section.tsx#L91

Added line #L91 was not covered by tests
}
return savedObjectsTitle;

Check warning on line 93 in src/plugins/saved_objects_management/public/management_section/mount_section.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/saved_objects_management/public/management_section/mount_section.tsx#L93

Added line #L93 was not covered by tests
};

coreStart.chrome.docTitle.change(getDocTitle());

Check warning on line 96 in src/plugins/saved_objects_management/public/management_section/mount_section.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/saved_objects_management/public/management_section/mount_section.tsx#L96

Added line #L96 was not covered by tests

const capabilities = coreStart.application.capabilities;

Expand All @@ -89,8 +107,6 @@
return children! as React.ReactElement;
};

const useUpdatedUX = coreStart.uiSettings.get('home:useNewHomePage');

const content = (
<Router history={history}>
<Switch>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading