-
Notifications
You must be signed in to change notification settings - Fork 174
ROX-33089: Improve language on scope step of wizard #19903
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
base: master
Are you sure you want to change the base?
Changes from all 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 |
|---|---|---|
|
|
@@ -60,7 +60,7 @@ function InclusionScopeCard({ | |
| } | ||
|
|
||
| return ( | ||
| <PolicyScopeCardBase title="Inclusion scope" onDelete={onDelete}> | ||
| <PolicyScopeCardBase title="Included resource" onDelete={onDelete}> | ||
|
Contributor
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. Similar suggestion: Inclusion |
||
| <Form> | ||
| <FormGroup label="Cluster" role="radiogroup"> | ||
| <Flex direction={{ default: 'column' }}> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,7 +111,11 @@ function PolicyScopeCardLegacy({ | |
| variant="plain" | ||
| className="pf-v6-u-mr-md" | ||
| onClick={onDelete} | ||
| title={`Delete ${type} scope`} | ||
| title={ | ||
| type === 'inclusion' | ||
| ? 'Delete included resource' | ||
|
Contributor
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. Delete inclusion/exclusion |
||
| : 'Delete excluded resource' | ||
| } | ||
| /> | ||
| </> | ||
| ), | ||
|
|
@@ -120,7 +124,9 @@ function PolicyScopeCardLegacy({ | |
| }} | ||
| className="pf-v6-u-p-0" | ||
| > | ||
| <CardTitle className="pf-v6-u-pl-lg">{type} scope</CardTitle> | ||
| <CardTitle className="pf-v6-u-pl-lg"> | ||
| {type === 'inclusion' ? 'Included resource' : 'Excluded resource'} | ||
| </CardTitle> | ||
| </CardHeader> | ||
| <Divider component="div" /> | ||
| <CardBody> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,11 +34,31 @@ import type { ClientPolicy } from 'types/policy.proto'; | |
| import type { ListImage } from 'types/image.proto'; | ||
| import { getImages } from 'services/imageService'; | ||
|
|
||
| import ExternalLink from 'Components/PatternFly/IconText/ExternalLink'; | ||
|
|
||
| import { initialExcludedDeployment, initialScope } from '../../policies.utils'; | ||
| import PolicyScopeCardLegacy from './PolicyScopeCardLegacy'; | ||
| import InclusionScopeCard from './InclusionScopeCard'; | ||
| import ExclusionScopeCard from './ExclusionScopeCard'; | ||
|
|
||
| function PolicyScopeRE2Description(): ReactElement { | ||
| return ( | ||
| <div> | ||
| Every field except Cluster can use RE2 matching. Empty fields apply to all values (no | ||
| filter).{' '} | ||
| <ExternalLink> | ||
| <a | ||
| href="https://github.com/google/re2/wiki/syntax" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| > | ||
| Learn how to use regex here | ||
| </a> | ||
| </ExternalLink> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| function PolicyScopeForm(): ReactElement { | ||
| const [isExcludeImagesOpen, setIsExcludeImagesOpen] = useState(false); | ||
| const [filterValue, setFilterValue] = useState(''); | ||
|
|
@@ -119,10 +139,9 @@ function PolicyScopeForm(): ReactElement { | |
| return ( | ||
| <Flex direction={{ default: 'column' }} spaceItems={{ default: 'spaceItemsNone' }}> | ||
| <FlexItem flex={{ default: 'flex_1' }} className="pf-v6-u-p-lg"> | ||
| <Title headingLevel="h2">Scope</Title> | ||
| <Title headingLevel="h2">Resources</Title> | ||
| <div className="pf-v6-u-mt-sm"> | ||
| Create scopes to restrict or exclude your policy from entities within your | ||
| environment. | ||
| Configure the resources to be applied to, or excluded from this policy. | ||
| </div> | ||
| </FlexItem> | ||
| <Divider component="div" /> | ||
|
|
@@ -131,27 +150,29 @@ function PolicyScopeForm(): ReactElement { | |
| className="pf-v6-u-mt-lg pf-v6-u-mx-lg" | ||
| isInline | ||
| variant="info" | ||
| title="The selected event source does not support scoping." | ||
| title="The selected event source does not support resource targeting." | ||
| component="p" | ||
| /> | ||
| )} | ||
| <Flex direction={{ default: 'column' }} className="pf-v6-u-p-lg"> | ||
| <Flex> | ||
| <FlexItem flex={{ default: 'flex_1' }}> | ||
| <Title headingLevel="h3">Restrict by scope</Title> | ||
| <div className="pf-v6-u-mt-sm"> | ||
| Use Restrict by scope to enable this policy only for a specific cluster, | ||
| namespace, or deployment label. You can add multiple scopes and also use | ||
| regular expressions (RE2 syntax) for namespaces and deployment labels. | ||
| </div> | ||
| <Flex direction={{ default: 'column' }}> | ||
| <Title headingLevel="h3">Included resources</Title> | ||
| <div> | ||
|
Contributor
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. Apply this policy to one or more clusters, namespaces or workloads (if applicable). followed by: If no inclusions are configured, the policy will apply to all resources in your environment, except those excluded. (Because of the "except those excluded" , it shortens the exclusion description and succinctly conveys "They narrow the result of your inclusions (or all resources, if you added |
||
| Define which clusters, namespaces, and deployments this policy | ||
|
Contributor
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. I know my demo said deployments but given RFEs to exclude other workload types like Jobs and CronJobs coming soon, would be nice to use workloads as the verbiage instead of deployments. I believe we are encouraging that terminology in other parts of the UI as well cc: @mansursyed |
||
| evaluates. If no inclusions are added, all resources are included. | ||
| </div> | ||
| <PolicyScopeRE2Description /> | ||
| </Flex> | ||
| </FlexItem> | ||
| <FlexItem className="pf-v6-u-pr-md" alignSelf={{ default: 'alignSelfCenter' }}> | ||
| <Button | ||
| variant="secondary" | ||
| onClick={addNewInclusionScope} | ||
| isDisabled={isAllScopingDisabled} | ||
| > | ||
| Add inclusion scope | ||
| Add inclusion | ||
| </Button> | ||
| </FlexItem> | ||
| </Flex> | ||
|
|
@@ -187,21 +208,23 @@ function PolicyScopeForm(): ReactElement { | |
| <Flex direction={{ default: 'column' }} className="pf-v6-u-p-lg"> | ||
| <Flex> | ||
| <FlexItem flex={{ default: 'flex_1' }}> | ||
| <Title headingLevel="h3">Exclude by scope</Title> | ||
| <div className="pf-v6-u-mt-sm"> | ||
| Use Exclude by scope to exclude entities from your policy. This function | ||
| is only available for Deploy and Runtime lifecycle stages. You can add | ||
| multiple scopes and also use regular expressions (RE2 syntax) for | ||
| namespaces and deployment labels. | ||
| </div> | ||
| <Flex direction={{ default: 'column' }}> | ||
| <Title headingLevel="h3">Excluded resources</Title> | ||
| <div> | ||
| Excluded resources define what this policy will not evaluate. They | ||
|
Contributor
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. Exclude one or more clusters, namespaces, or workloads (if applicable) from this policy. |
||
| narrow the result of your inclusions (or all resources, if you added | ||
| none). | ||
| </div> | ||
| <PolicyScopeRE2Description /> | ||
| </Flex> | ||
| </FlexItem> | ||
| <FlexItem className="pf-v6-u-pr-md" alignSelf={{ default: 'alignSelfCenter' }}> | ||
| <Button | ||
| variant="secondary" | ||
| isDisabled={!hasDeployOrRuntimeLifecycle || isAllScopingDisabled} | ||
| onClick={addNewExclusionDeploymentScope} | ||
| > | ||
| Add exclusion scope | ||
| Add exclusion | ||
| </Button> | ||
| </FlexItem> | ||
| </Flex> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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 would rename to Exclusion (since it is not a singular resource per rule, but will most likely be a set of resources - put differently - it is a single rule, not a single resource). Also this is the card that pops up when the user clicks on "Add exclusion".
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 sure if this shows up in the UI - I think this is the card title which does)