-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add workspace create page #284
Add workspace create page #284
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## workspace-pr-integr #284 +/- ##
=======================================================
- Coverage 66.92% 66.91% -0.01%
=======================================================
Files 2598 2598
Lines 49149 49149
Branches 8890 8890
=======================================================
- Hits 32891 32889 -2
- Misses 14090 14091 +1
- Partials 2168 2169 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
bb8692f
to
baa72cf
Compare
baa72cf
to
e6c443f
Compare
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.
Left some comment, though I know some of which are others' work ^^.
|
||
interface WorkspaceBottomBarProps { | ||
formId: string; | ||
opType?: string; |
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.
Can we add an enum for opType?
{opType === WORKSPACE_OP_TYPE_UPDATE ? ( | ||
<EuiText textAlign="left"> | ||
{i18n.translate('workspace.form.bottomBar.unsavedChanges', { | ||
defaultMessage: `${numberOfUnSavedChanges} Unsaved change(s)`, | ||
})} | ||
</EuiText> | ||
) : ( | ||
<EuiText textAlign="left"> | ||
{i18n.translate('workspace.form.bottomBar.errors', { | ||
defaultMessage: `${numberOfErrors} Error(s)`, | ||
})} | ||
</EuiText> | ||
)} |
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 only the default message can replace the ${numberOfErrors}, translate function should support placeholder in some way.
getUrlForApp: jest.fn(), | ||
applications$: new BehaviorSubject<Map<string, PublicAppInfo>>(PublicAPPInfoMap as any), | ||
}, | ||
http: { |
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.
Any reason we add http entry here? I think mockCoreStart should have mocked all the functions under http
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.
You're right, can be removed.
}), | ||
}); | ||
if (application && http) { | ||
window.location.href = formatUrlWithWorkspaceId( |
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.
Do we need to set a timeout before jumping to the workspace? Or user may not have enough time to see the notifications toast.
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.
Is the workspace id stored in the hash part? If this part of refactor was been finalized, we can use application.navigateToUrl
instead. Then the page won't be reload. The toasts will be kept. Then we don't need to add delay.
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.
I see, we will use the path option(current behavior in workspace branch) to store the workspace id. So I guess we may need a timeout here.
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.
Will add an one second timeout here.
paddingSize="none" | ||
color="subdued" | ||
hasShadow={false} | ||
style={{ width: '100%', maxWidth: 1000 }} |
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.
What is the maxWidth: 1000
used for?
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.
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.
I see, can we add a comment here? For someone without the context like me may be confused on this style property.
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.
This component is too large(714 lines) and collapsed by default when review, can we split this file into several smaller files(types, components, hooks, utils..) to improve readability.
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.
Component is so large that collapsed by default, seems many codes are used for constants, can we separate to multiple smaller files?
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
ac1cc52
to
2a12e43
Compare
src/core/public/application/types.ts
Outdated
[key: string]: { | ||
type: 'required' | 'optional'; | ||
}; | ||
}; |
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.
can we have an example here?
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.
do we have circle dependency check somewhere?
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 we don't have this check now.
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.
@wanglam if this is not used, we may remove it for now. This helps reduce the scope of the PR and make the code review faster. We can add it back in the future when it's needed.
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.
Removeed this in current PR. Will add it back after requirements clear.
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
@SuZhou-Joe @Hailong-am All the comments has been addressed, feel free to help me review it. Thank you. |
featureIds | ||
), | ||
]) | ||
); |
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.
does this Map featureDependencies
contains all dependencies for given feature? for example feature A depends on B and B depends on C, does the featureDependencies[A] will be B and C?
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.
The featureDependencies
map was generated by generateFeatureDependencyMap
below. The dependencies map generation only use first level data. I think we've already talk about this issue last year.
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.
I see. one level should enough.
src/core/public/application/types.ts
Outdated
[key: string]: { | ||
type: 'required' | 'optional'; | ||
}; | ||
}; |
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.
do we have circle dependency check somewhere?
onChange={handleDefaultVISThemeChange} | ||
data-test-subj="workspaceForm-workspaceDetails-defaultVISThemeSelector" | ||
/> | ||
</EuiFormRow> |
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.
I may suggest to remove vis theme, color and icon when it's unclear how these will be used.
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.
The defaultVisTheme, icon and dependencies logic has been removed. They are all unclear for now. The color has been used in the dropdown list. Will keep it.
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
@@ -7,6 +7,8 @@ export const WORKSPACE_CREATE_APP_ID = 'workspace_create'; | |||
export const WORKSPACE_LIST_APP_ID = 'workspace_list'; | |||
export const WORKSPACE_UPDATE_APP_ID = 'workspace_update'; | |||
export const WORKSPACE_OVERVIEW_APP_ID = 'workspace_overview'; | |||
// These features will be checked and disabled in checkbox on default. |
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.
// These features will be checked and disabled in checkbox on default. | |
// These features will be checked by default in create workspace page and do not allow to edit by the user. |
@@ -7,6 +7,8 @@ export const WORKSPACE_CREATE_APP_ID = 'workspace_create'; | |||
export const WORKSPACE_LIST_APP_ID = 'workspace_list'; | |||
export const WORKSPACE_UPDATE_APP_ID = 'workspace_update'; | |||
export const WORKSPACE_OVERVIEW_APP_ID = 'workspace_overview'; | |||
// These features will be checked and disabled in checkbox on default. | |||
export const DEFAULT_CHECKED_FEATURES_IDS = [WORKSPACE_UPDATE_APP_ID, WORKSPACE_OVERVIEW_APP_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.
Nit: DEFAULT_CHECKED_FEATURES_IDS
is only used by workspace_form.tsx
, consider to move it there. We can move it here in the future if this variable will need to be shared across files.
* Add workspace create page Signed-off-by: Lin Wang <wonglam@amazon.com> * Address PR comments Signed-off-by: Lin Wang <wonglam@amazon.com> * Add more comments Signed-off-by: Lin Wang <wonglam@amazon.com> * Add example for dependencies field in App Signed-off-by: Lin Wang <wonglam@amazon.com> * Separate workspace feature selector Signed-off-by: Lin Wang <wonglam@amazon.com> * Correct example for dependencies Signed-off-by: Lin Wang <wonglam@amazon.com> * Remove unclear icon and defaultVISTheme input Signed-off-by: Lin Wang <wonglam@amazon.com> * Remove unclear dependencies feature Signed-off-by: Lin Wang <wonglam@amazon.com> * Remove states and fix onChange fired after mount Signed-off-by: Lin Wang <wonglam@amazon.com> --------- Signed-off-by: Lin Wang <wonglam@amazon.com>
Description
Add workspace create page
Issues Resolved
Screenshot
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration