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][Page header] Integrate new page header for workspace pages #7697

Merged
merged 5 commits into from
Aug 15, 2024

Conversation

raintygao
Copy link
Contributor

@raintygao raintygao commented Aug 13, 2024

Description

Integrate new page header for workspace pages, including

  1. workspace create page
  2. workspace list page
  3. workspace detail page header
  4. settings and setup landing page
  5. data administration page

This is first phase of integration, the integration of remaining pages will be proposed in later PRs.

Screenshot

image
image
image
image
image

Testing the changes

Changelog

  • feat: Integrate new page header for workspace pages

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Copy link
Contributor

❌ Changelog Entry Missing Hyphen

Changelog entries must begin with a hyphen (-).

opensearch-changeset-bot bot added a commit to raintygao/OpenSearch-Dashboards that referenced this pull request Aug 13, 2024
Copy link

codecov bot commented Aug 13, 2024

Codecov Report

Attention: Patch coverage is 64.28571% with 5 lines in your changes missing coverage. Please review.

Project coverage is 63.74%. Comparing base (765527a) to head (965c391).
Report is 2 commits behind head on main.

Files Patch % Lines
...rkspace/public/components/workspace_list/index.tsx 69.23% 2 Missing and 2 partials ⚠️
src/plugins/workspace/public/plugin.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7697      +/-   ##
==========================================
- Coverage   63.74%   63.74%   -0.01%     
==========================================
  Files        3637     3637              
  Lines       80448    80445       -3     
  Branches    12792    12791       -1     
==========================================
- Hits        51285    51282       -3     
+ Misses      26029    26028       -1     
- Partials     3134     3135       +1     
Flag Coverage Δ
Linux_1 29.82% <64.28%> (-0.01%) ⬇️
Linux_2 55.82% <ø> (ø)
Linux_3 40.39% <ø> (ø)
Linux_4 31.30% <ø> (+<0.01%) ⬆️
Windows_1 29.84% <64.28%> (-0.01%) ⬇️
Windows_2 55.77% <ø> (ø)
Windows_3 40.39% <ø> (ø)
Windows_4 31.30% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

if (!appUrl) return '';

return cleanWorkspaceId(appUrl);
}, [application, http]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we remove the http dependency? Seems not been used in the useMemo body.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. This is a previous missed change, thanks for catching it. Updated.

});
if (!appUrl) return '';

return cleanWorkspaceId(appUrl);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we need to cleanWorkspaceId? As my understanding, workspace list is out of workspace, it won't includes workspace id.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have forgot why we add this line before. @SuZhou-Joe Seems we can return app url directly for now, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, no need to cleanWorkspaceId.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

]}
setMountPoint={application?.setAppDescriptionControls}
/>
{renderCreateWorkspaceButton()}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: How about refactor code like below?

{isDashboardAdmin && renderCreateWorkspaceButton()}

Then we don't need to check isDashboardAdmin in renderCreateWorkspaceButton.

@@ -36,7 +36,9 @@ export const WorkspaceDetailApp = (props: WorkspaceDetailProps) => {
text: currentWorkspace.name,
});
breadcrumbs.push({
text: i18n.translate('workspace.detail.breadcrumb', { defaultMessage: 'Workspace Detail' }),
text: `${currentWorkspace.name} ${i18n.translate('workspace.detail.title', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: prefer write i18n like below code:

i18n.translate('workspace.detail.title', {
    defaultMessage: "{name} settings",
    values: {
        name: currentWorkspace.name
    }
})

const navLinks = (
await getNavLinksByNavGroupId(DEFAULT_NAV_GROUPS.settingsAndSetup.id)
).filter((navLink) => navLink.id !== settingsLandingPageId);

coreStart.chrome.setBreadcrumbs([
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: How about move page title update logic to FeatureCards component?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say that I have no preference whether to still maintain it here or move it into component, because I think there won't be much difference on it or maintainability.

Signed-off-by: tygao <tygao@amazon.com>
Signed-off-by: tygao <tygao@amazon.com>
@SuZhou-Joe
Copy link
Member

From the screenshot, can we remove the white background of workspace list page?

Signed-off-by: tygao <tygao@amazon.com>
@raintygao
Copy link
Contributor Author

From the screenshot, can we remove the white background of workspace list page?

Sure. Have updated code and screenshot.

@ruanyl ruanyl added backport 2.x v2.17.0 look & feel Look and Feel Improvements labels Aug 15, 2024
@ruanyl ruanyl merged commit 36af5e7 into opensearch-project:main Aug 15, 2024
73 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 15, 2024
#7697)

* init page headers for workspace

Signed-off-by: tygao <tygao@amazon.com>

* update

Signed-off-by: tygao <tygao@amazon.com>

* update list page

Signed-off-by: tygao <tygao@amazon.com>

* Changeset file for PR #7697 created/updated

---------

Signed-off-by: tygao <tygao@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 36af5e7)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
zhongnansu pushed a commit that referenced this pull request Aug 15, 2024
#7697) (#7717)

* init page headers for workspace



* update



* update list page



* Changeset file for PR #7697 created/updated

---------



(cherry picked from commit 36af5e7)

Signed-off-by: tygao <tygao@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants