Skip to content

Commit

Permalink
NAS-131753: Allow user to disable access to snapshot directory in UI (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKarpov98 authored Oct 15, 2024
1 parent b3e120f commit 11e154f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/app/enums/dataset.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ export const datasetSyncLabels = new Map<DatasetSync, string>([
export enum DatasetSnapdir {
Visible = 'VISIBLE',
Hidden = 'HIDDEN',
Disabled = 'DISABLED',
}

export const datasetSnapdirLabels = new Map<DatasetSnapdir, string>([
[DatasetSnapdir.Visible, T('Visible')],
[DatasetSnapdir.Hidden, T('Invisible')],
[DatasetSnapdir.Disabled, T('Disabled')],
]);

export enum DatasetSnapdev {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('OtherOptionsSectionComponent', () => {
source: ZfsPropertySource.Inherited,
},
snapdir: {
value: DatasetSnapdir.Visible,
value: DatasetSnapdir.Disabled,
source: ZfsPropertySource.Inherited,
},
snapdev: {
Expand Down Expand Up @@ -235,6 +235,10 @@ describe('OtherOptionsSectionComponent', () => {
parent: parentDataset,
});

await form.fillForm({
'Snapshot Directory': 'Visible',
});

expect(await form.getValues()).toEqual({
Comments: '',
'Compression Level': 'LZJB',
Expand Down Expand Up @@ -273,7 +277,7 @@ describe('OtherOptionsSectionComponent', () => {
readonly: OnOff.Off,
recordsize: inherit,
snapdev: DatasetSnapdev.Hidden,
snapdir: DatasetSnapdir.Visible,
snapdir: DatasetSnapdir.Disabled,
special_small_block_size: inherit,
aclmode: AclMode.Discard,
acltype: DatasetAclType.Posix,
Expand Down

0 comments on commit 11e154f

Please sign in to comment.