-
Notifications
You must be signed in to change notification settings - Fork 112
Feat/pci object lock #20560
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
Draft
AkdM
wants to merge
17
commits into
master
Choose a base branch
from
feat/pci-object-lock
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Feat/pci object lock #20560
Changes from 6 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5eb9009
feat(pci-object-storage): add Object Lock functionality to order funn…
AkdM 732b169
feat(pci-object-storage): implement Object Lock feature with UI and a…
AkdM 4079f8c
feat(pci-object-storage): add alert Object Lock when enabled on conta…
AkdM 6137622
feat(pci-object-storage): add ObjectLockOptions component for managin…
AkdM a001cca
feat(pci-object-storage): added Object Lock options with sheet routing
AkdM 1d28830
feat(pci-object-storage): Object Lock options with retention mode and…
AkdM 6f0d2e3
fix(object-lock-options): update import path for RouteSheet component…
AkdM c35799e
fix(object-lock-options): remove useless space
AkdM 94c4f31
fix(object-lock-options): remove useless fragment
AkdM 6bfd2e7
fix(object-lock-options): added missing translation
AkdM 6ee23d8
feat(object-lock-options): integrate ISO8601 duration function into a…
AkdM 7c8140a
fix(object-lock-options): update Object Lock messages and enforce ver…
AkdM 9251fe9
fix(object-lock-options): correct French translations for compliance …
AkdM 6e8fe62
feat(object-lock-options): add acknowledgement checkbox for Object Lo…
AkdM b7e8bf9
feat(object-lock-options): add acknowledgement checkbox and error han…
AkdM 63bf469
feat(object-lock-options): enhance Object Lock summary
AkdM 9742d36
fix(object-lock-options): disable object lock when versioning is disa…
AkdM File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
...ct-storage/src/pages/object-storage/create/_components/steps/ObjectLockStep.component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| import { | ||
| Alert, | ||
| AlertDescription, | ||
| RadioGroup, | ||
| RadioGroupItem, | ||
| Label, | ||
| Popover, | ||
| PopoverTrigger, | ||
| PopoverContent, | ||
| } from '@datatr-ux/uxlib'; | ||
| import { HelpCircleIcon, Info } from 'lucide-react'; | ||
| import React from 'react'; | ||
| import { useTranslation } from 'react-i18next'; | ||
| import storages from '@/types/Storages'; | ||
| import { cn } from '@/lib/utils'; | ||
|
|
||
| interface ObjectLockStepProps { | ||
| value?: storages.ObjectLockStatusEnum; | ||
| onChange?: (newValue: storages.ObjectLockStatusEnum) => void; | ||
| versioning?: storages.VersioningStatusEnum; | ||
| } | ||
|
|
||
| const ObjectLockStep = React.forwardRef<HTMLInputElement, ObjectLockStepProps>( | ||
| ({ value, onChange, versioning }, ref) => { | ||
| const { t } = useTranslation('pci-object-storage/order-funnel'); | ||
| const isVersioningDisabled = | ||
| versioning === storages.VersioningStatusEnum.disabled; | ||
| const isObjectLockEnabled = value === storages.ObjectLockStatusEnum.enabled; | ||
|
|
||
| return ( | ||
| <RadioGroup | ||
| value={value} | ||
| onValueChange={(newValue) => { | ||
| onChange(newValue as storages.ObjectLockStatusEnum); | ||
| }} | ||
| data-testid="object-lock-select-container" | ||
| ref={ref} | ||
| > | ||
| {/* Disabled option */} | ||
| <div className="flex items-center gap-3"> | ||
| <RadioGroupItem | ||
| value={storages.ObjectLockStatusEnum.disabled} | ||
| id="object-lock-disabled-option" | ||
| /> | ||
| <Label | ||
| htmlFor="object-lock-disabled-option" | ||
| className="flex gap-2 justify-center" | ||
| > | ||
| {t( | ||
| `versionningTypeLabel-${storages.ObjectLockStatusEnum.disabled}`, | ||
| )}{' '} | ||
AkdM marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </Label> | ||
| </div> | ||
|
|
||
| {/* Enabled option with versioning constraint */} | ||
| <div className="flex items-center gap-3"> | ||
| <RadioGroupItem | ||
| value={storages.ObjectLockStatusEnum.enabled} | ||
| id="object-lock-enabled-option" | ||
| disabled={isVersioningDisabled} | ||
| /> | ||
| <Label htmlFor="object-lock-enabled-option"> | ||
| <span | ||
| className={cn( | ||
| isVersioningDisabled && 'opacity-70 cursor-not-allowed', | ||
| )} | ||
| > | ||
| {t( | ||
| `versionningTypeLabel-${storages.ObjectLockStatusEnum.enabled}`, | ||
| )} | ||
| </span> | ||
| </Label> | ||
| {/* Help popover shown when versioning is disabled */} | ||
| {isVersioningDisabled && ( | ||
| <Popover> | ||
| <PopoverTrigger asChild> | ||
| <HelpCircleIcon className="size-4" /> | ||
| </PopoverTrigger> | ||
| <PopoverContent className="text-sm"> | ||
| {t('objectLockTypeDisabledPopover')} | ||
| </PopoverContent> | ||
| </Popover> | ||
| )} | ||
| </div> | ||
| {/* Alert shown when Object Lock is enabled */} | ||
| {isObjectLockEnabled && ( | ||
| <Alert variant="information"> | ||
| <AlertDescription className="flex gap-2 items-center"> | ||
| <Info className="size-4" /> | ||
| {t('objectLockCannotDisableAlert')} | ||
| </AlertDescription> | ||
| </Alert> | ||
| )} | ||
| </RadioGroup> | ||
| ); | ||
| }, | ||
| ); | ||
|
|
||
| ObjectLockStep.displayName = 'ObjectLockStep'; | ||
| export default ObjectLockStep; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 35 additions & 18 deletions
53
...rage/src/pages/object-storage/storage/s3Id/dashboard/_components/ObjectLock.component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.