-
Notifications
You must be signed in to change notification settings - Fork 359
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
feat: update ConfigPolicies with docs link [CM-558] #10055
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,10 @@ import yaml from 'js-yaml'; | |
import { isEmpty } from 'lodash'; | ||
import { useState } from 'react'; | ||
|
||
import Link from 'components/Link'; | ||
import { useAsync } from 'hooks/useAsync'; | ||
import usePermissions from 'hooks/usePermissions'; | ||
import { paths } from 'routes/utils'; | ||
import { | ||
deleteGlobalConfigPolicies, | ||
deleteWorkspaceConfigPolicies, | ||
|
@@ -90,8 +92,8 @@ const ConfigPoliciesTab: React.FC<TabProps> = ({ workspaceId, global, type }: Ta | |
? "You're about to apply these configuration policies to the cluster." | ||
: "You're about to apply these configuration policies to the workspace."; | ||
const viewMessage = global | ||
? 'Global configuration policies are being applied to the cluster.' | ||
: 'Global configuration policies are being applied to the workspace.'; | ||
? 'Configuration policies are being applied to the cluster.' | ||
: 'Configuration policies are being applied to the workspace.'; | ||
const confirmMessageEnding = global | ||
? 'underlying workspaces, projects, and submitted experiments in the cluster.' | ||
: 'underlying projects and their experiments in this workspace.'; | ||
|
@@ -161,6 +163,12 @@ const ConfigPoliciesTab: React.FC<TabProps> = ({ workspaceId, global, type }: Ta | |
setDisabled(hasErrors(form) || form.getFieldValue(YAML_FORM_ITEM_NAME) === initialYAML); | ||
}; | ||
|
||
const docsLink = ( | ||
<Link external path={paths.docs('/manage/config-policies.html')} popout> | ||
Learn more | ||
</Link> | ||
); | ||
|
||
Comment on lines
+177
to
+182
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this PR is merge blocked on #9969, which will add this page to the docs There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the final URL will be this: |
||
if (rbacLoading) return <Spinner spinning />; | ||
|
||
return ( | ||
|
@@ -174,11 +182,16 @@ const ConfigPoliciesTab: React.FC<TabProps> = ({ workspaceId, global, type }: Ta | |
Apply | ||
</Button> | ||
} | ||
description={docsLink} | ||
message={applyMessage} | ||
showIcon | ||
/> | ||
) : ( | ||
<Alert message={viewMessage} showIcon /> | ||
<Alert | ||
description={docsLink} | ||
message={viewMessage} | ||
showIcon | ||
/> | ||
)} | ||
</div> | ||
</Row> | ||
|
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.
Removed "Global" because it's incorrect for workspaces, and seemed unnecessary for cluster, @tara-det-ai lmk if that's a problem