-
Notifications
You must be signed in to change notification settings - Fork 98
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
Fix/pci private registry fix restriction tapc xxx #14916
base: feat/pci-private-registry_create-restriction_tapc-584
Are you sure you want to change the base?
Changes from 7 commits
6b5eea4
bdc6d4b
691b2c1
70306e7
a900771
efc9651
fdacddd
937d65d
4bb90d8
2adddd1
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 |
---|---|---|
|
@@ -19,50 +19,52 @@ import { useTranslation, Trans } from 'react-i18next'; | |
const AuthorizationLabel = () => { | ||
const { t } = useTranslation(['ip-restrictions']); | ||
return ( | ||
<OsdsPopover> | ||
<span slot="popover-trigger"> | ||
<OsdsText | ||
size={ODS_TEXT_SIZE._500} | ||
hue={ODS_TEXT_COLOR_HUE._800} | ||
level={ODS_TEXT_LEVEL.body} | ||
color={ODS_TEXT_COLOR_INTENT.primary} | ||
> | ||
{t('private_registry_cidr_authorization')} | ||
</OsdsText> | ||
|
||
<OsdsIcon | ||
name={ODS_ICON_NAME.HELP} | ||
size={ODS_ICON_SIZE.xs} | ||
className="ml-4 cursor-help" | ||
color={ODS_THEME_COLOR_INTENT.primary} | ||
/> | ||
</span> | ||
|
||
<OsdsPopoverContent> | ||
<Trans ns="ip-restrictions"> | ||
<OsdsText | ||
color={ODS_THEME_COLOR_INTENT.text} | ||
level={ODS_TEXT_LEVEL.body} | ||
> | ||
{t('private_registry_cidr_help_authorized_component')} | ||
</OsdsText> | ||
<br /> | ||
<div className="whitespace-normal inline"> | ||
<OsdsPopover> | ||
<span slot="popover-trigger"> | ||
<OsdsText | ||
color={ODS_THEME_COLOR_INTENT.text} | ||
size={ODS_TEXT_SIZE._500} | ||
hue={ODS_TEXT_COLOR_HUE._800} | ||
level={ODS_TEXT_LEVEL.body} | ||
color={ODS_TEXT_COLOR_INTENT.primary} | ||
> | ||
{t('private_registry_cidr_help_authorized_component_part2')} | ||
{t('private_registry_cidr_authorization')} | ||
</OsdsText> | ||
<br /> | ||
<OsdsText | ||
color={ODS_THEME_COLOR_INTENT.text} | ||
level={ODS_TEXT_LEVEL.body} | ||
> | ||
{t('private_registry_cidr_help_authorized_component_part3')} | ||
</OsdsText> | ||
</Trans> | ||
</OsdsPopoverContent> | ||
</OsdsPopover> | ||
|
||
<OsdsIcon | ||
name={ODS_ICON_NAME.HELP} | ||
size={ODS_ICON_SIZE.xs} | ||
className="ml-4 cursor-help" | ||
color={ODS_THEME_COLOR_INTENT.primary} | ||
/> | ||
</span> | ||
|
||
<OsdsPopoverContent> | ||
<Trans ns="ip-restrictions"> | ||
<OsdsText | ||
color={ODS_THEME_COLOR_INTENT.text} | ||
level={ODS_TEXT_LEVEL.body} | ||
> | ||
{t('private_registry_cidr_help_authorized_component')} | ||
</OsdsText> | ||
<br /> | ||
<OsdsText | ||
color={ODS_THEME_COLOR_INTENT.text} | ||
level={ODS_TEXT_LEVEL.body} | ||
> | ||
{t('private_registry_cidr_help_authorized_component_part2')} | ||
</OsdsText> | ||
<br /> | ||
<OsdsText | ||
color={ODS_THEME_COLOR_INTENT.text} | ||
level={ODS_TEXT_LEVEL.body} | ||
> | ||
{t('private_registry_cidr_help_authorized_component_part3')} | ||
</OsdsText> | ||
</Trans> | ||
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. If we just want add spacing between element. Maybe use container with gap ( Allow to have better control ? |
||
</OsdsPopoverContent> | ||
</OsdsPopover> | ||
</div> | ||
); | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,12 +85,12 @@ export default function BlocIPBlock() { | |
dataGrid.pagination, | ||
columnFilters.filters, | ||
); | ||
const { t } = useTranslation(['ip-restrictions']); | ||
const methods = useForm<ConfirmCIDRSchemaType>({ | ||
resolver: zodResolver(schemaAddCidr(dataCIDR.rows.map((e) => e.ipBlock))), | ||
mode: 'onBlur', | ||
reValidateMode: 'onChange', | ||
mode: 'onSubmit', | ||
reValidateMode: 'onBlur', | ||
}); | ||
const { t } = useTranslation(['ip-restrictions']); | ||
|
||
return ( | ||
<> | ||
|
@@ -117,10 +117,12 @@ export default function BlocIPBlock() { | |
|
||
<FormProvider {...methods}> | ||
<DatagridProvider | ||
dataGrid={dataGrid} | ||
dataGrid={{ | ||
...dataGrid, | ||
}} | ||
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. Maybe better copy value on provider and not on the usage ? We can have case we just want send the reference of datagrid ? |
||
columnFilters={columnFilters} | ||
key={dataCIDR.totalRows} | ||
data={dataCIDR.rows} | ||
totalRows={dataCIDR.totalRows} | ||
> | ||
<BlockCIDR /> | ||
</DatagridProvider> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ import { capitalizeAndJoin } from '@/helpers'; | |
import Checkboxes from '@/components/CIDR/Checkboxes.component'; | ||
import AllCheckboxComponent from '@/components/CIDR/AllCheckbox.component'; | ||
import useDataGridContext from './useDatagridContext'; | ||
import AuthorizationLabel from '@/components/CIDR/AuthorizationLabel.component'; | ||
|
||
function showCheckboxes(draft: boolean, dataLength: number): boolean { | ||
const minDataLength = draft ? 3 : 2; | ||
|
@@ -88,7 +89,8 @@ export const useDatagridColumn = () => { | |
) : ( | ||
<div>{capitalizeAndJoin(props.authorization)}</div> | ||
), | ||
label: t('private_registry_cidr_authorization'), | ||
// need to had a Popover next to the label | ||
label: ((<AuthorizationLabel />) as unknown) as string, | ||
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. Could you add a comment to explain why you need this 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. Hacky but do not have choice to implement a Popover next to label 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 understand, maybe you could add a typescript comment above this line to explain 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 can't understand clearly why you use here a React Component and cast it as a string? 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 think the DataGrid only accepts string as type but in reality can accept ReactNode so this is a tweak because of wrong typing 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. It's better change the type of DatagridColumn.label in |
||
}, | ||
{ | ||
id: 'add', | ||
|
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 does
isDirty
mean?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.
isDirty means value touched and fill
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.
Sorry but I can't make the relation ...
isDirty
sounds like code smell to me ;)