-
Notifications
You must be signed in to change notification settings - Fork 916
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 apps are missing when updating a workspace #6459
[Workspace] fix apps are missing when updating a workspace #6459
Conversation
This is caused by opensearch-project#6234 which marked apps as inaccessible when the apps are not configured into the current workspace. However, inaccessible apps can not be configured into a workspace. Signed-off-by: Yulong Ruan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No much concern but maybe we should consider using capabilities service to filter out apps in workspace in the future.
* Restrict apps are apps that can be configured into a workspace, but restrict to access | ||
* because the current workspace didn't have the apps configured, such apps should NOT filter out | ||
*/ | ||
if (restrictedApps && restrictedApps.has(id)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to keep the same source in workspace create, update and list page, can we use restrictedApps
for all customized features for workspaces. We can remove the check below.
return (
navLinkStatus !== AppNavLinkStatus.hidden &&
!chromeless &&
!DEFAULT_SELECTED_FEATURES_IDS.includes(id) &&
category?.id !== DEFAULT_APP_CATEGORIES.management.id
);
variable Signed-off-by: Yulong Ruan <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6459 +/- ##
==========================================
+ Coverage 32.93% 32.95% +0.01%
==========================================
Files 2260 2260
Lines 45769 45788 +19
Branches 7200 7203 +3
==========================================
+ Hits 15075 15089 +14
- Misses 29984 29988 +4
- Partials 710 711 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Yulong Ruan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
picked up latest main and re-running all checks now |
❌ Invalid Changelog HeadingThe '## Changelog' heading in your PR description is either missing or malformed. Please make sure that your PR description includes a '## Changelog' heading with proper spelling, capitalization, spacing, and Markdown syntax. |
❌ Changelog Entry Missing HyphenChangelog entries must begin with a hyphen (-). |
@@ -65,23 +61,14 @@ export const convertApplicationsToFeaturesOrGroups = ( | |||
) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the applications only need id, title and category. Can we remove navLinkStatus and chromeless?
selectedFeatures: string[]; | ||
onChange: (newFeatures: string[]) => void; | ||
workspaceConfigurableApps?: PublicAppInfo[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems we only need id, title and category for workspaceConfigurableApps here. Could we change to Pick<PublicAppInfo, 'id' | 'title' | 'category'>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I don't see a strong need to turn it into Pick<PublicAppInfo, 'id' | 'title' | 'category'>
in this case. I understood that passing minimum set of data to child components is a best practice, but the application
which type is PublicAppInfo
is provided by the core module, the components expect PublicAppInfo
type of data sounds reasonable to me as well.
I'm not holding a strong opinion, what else concerns do you have?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big issue. We can keep current implementation.
|
||
export const filterWorkspaceConfigurableApps = (applications: PublicAppInfo[]) => { | ||
const visibleApplications = applications.filter(({ navLinkStatus, chromeless, category, id }) => { | ||
return ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we add some unit tests here to cover this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there will be a followup PR from @yubonluo to cover this.
❌ Invalid Prefix For Manual Changeset CreationInvalid description prefix. Found "Fixed applications not displayed in workspace update page ([#6481](https". Only "skip" entry option is permitted for manual commit of changeset files. If you were trying to skip the changelog entry, please use the "skip" entry option in the ##Changelog section of your PR description. |
pick up latest main and re-running all checks now |
* fix(workspace): apps are missing when updating a workspace This is caused by #6234 which marked apps as inaccessible when the apps are not configured into the current workspace. However, inaccessible apps can not be configured into a workspace. Signed-off-by: Yulong Ruan <[email protected]> * refactor(workspace): store workspace configurable apps in a global variable Signed-off-by: Yulong Ruan <[email protected]> * fix linter Signed-off-by: Yulong Ruan <[email protected]> --------- Signed-off-by: Yulong Ruan <[email protected]> Co-authored-by: ZilongX <[email protected]> (cherry picked from commit 4746f43) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…6606) * fix(workspace): apps are missing when updating a workspace This is caused by #6234 which marked apps as inaccessible when the apps are not configured into the current workspace. However, inaccessible apps can not be configured into a workspace. * refactor(workspace): store workspace configurable apps in a global variable * fix linter --------- (cherry picked from commit 4746f43) Signed-off-by: Yulong Ruan <[email protected]> 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: ZilongX <[email protected]>
This is caused by #6234 which marked apps as inaccessible when the apps are not configured into the current workspace. However, inaccessible apps are filter out on workspace update page, this is unexpected as such apps can be configured into the current workspace again though they are not configured into the workspace at the moment.
Description
Issues Resolved
#6481
Changelog
Screenshot
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration