-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'origin/master' into 129003/NAS-129003
- Loading branch information
Showing
860 changed files
with
31,331 additions
and
17,846 deletions.
There are no files selected for viewing
This file contains 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 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 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
83 changes: 68 additions & 15 deletions
83
src/app/core/testing/mock-enclosure/enclosure-templates/utils/pool.utils.ts
This file contains 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: 53 additions & 0 deletions
53
src/app/core/testing/mock-enclosure/enclosure-templates/utils/slots.utils.spec.ts
This file contains 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,53 @@ | ||
import { EnclosureElementType } from 'app/enums/enclosure-slot-status.enum'; | ||
import { | ||
DashboardEnclosure, | ||
DashboardEnclosureSlot, | ||
DashboardEnclosureElements, | ||
} from 'app/interfaces/enclosure.interface'; | ||
import { mapSlots, countSlots } from './slots.utils'; | ||
|
||
describe('mapSlots', () => { | ||
it('should correctly map slots for each enclosure', () => { | ||
const enclosures = [ | ||
{ | ||
elements: { | ||
[EnclosureElementType.ArrayDeviceSlot]: { | ||
1: { model: 'test1' } as DashboardEnclosureSlot, | ||
2: { model: 'test2' } as DashboardEnclosureSlot, | ||
}, | ||
} as DashboardEnclosureElements, | ||
}, | ||
] as DashboardEnclosure[]; | ||
|
||
const result = mapSlots(enclosures, ({ slot }) => ({ | ||
...slot, | ||
model: `mapped-${slot.model}`, | ||
})); | ||
|
||
expect(result).toEqual([ | ||
{ | ||
elements: { | ||
[EnclosureElementType.ArrayDeviceSlot]: { | ||
1: { model: 'mapped-test1' } as DashboardEnclosureSlot, | ||
2: { model: 'mapped-test2' } as DashboardEnclosureSlot, | ||
}, | ||
} as DashboardEnclosureElements, | ||
}, | ||
]); | ||
}); | ||
}); | ||
|
||
describe('countSlots', () => { | ||
it('should return the correct number of slots', () => { | ||
const enclosure = { | ||
elements: { | ||
[EnclosureElementType.ArrayDeviceSlot]: { | ||
1: {} as DashboardEnclosureSlot, | ||
2: {} as DashboardEnclosureSlot, | ||
}, | ||
} as DashboardEnclosureElements, | ||
} as DashboardEnclosure; | ||
const result = countSlots(enclosure); | ||
expect(result).toBe(2); | ||
}); | ||
}); |
This file contains 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 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 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 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 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 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 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 |
---|---|---|
@@ -1,7 +1,17 @@ | ||
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker'; | ||
|
||
export enum DirectoryServiceState { | ||
Disabled = 'DISABLED', | ||
Healthy = 'HEALTHY', | ||
Faulted = 'FAULTED', | ||
Leaving = 'LEAVING', | ||
Joining = 'JOINING', | ||
} | ||
|
||
export const directoryServiceStateLabels = new Map<DirectoryServiceState, string>([ | ||
[DirectoryServiceState.Disabled, T('Disabled')], | ||
[DirectoryServiceState.Healthy, T('Healthy')], | ||
[DirectoryServiceState.Faulted, T('Faulted')], | ||
[DirectoryServiceState.Leaving, T('Leaving')], | ||
[DirectoryServiceState.Joining, T('Joining')], | ||
]); |
This file contains 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 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.