import moment from 'moment';
import { Validators } from '@angular/forms';
import { CdValidators } from '~/app/shared/forms/cd-validators';
+import { DEFAULT_SUBVOLUME_GROUP } from '~/app/shared/constants/cephfs';
@Component({
selector: 'cd-cephfs-subvolume-snapshots-list',
isLoading = true;
observables: any = [];
+ allGroups: any = [];
constructor(
private cephfsSubvolumeGroupService: CephfsSubvolumeGroupService,
.pipe(
switchMap((groups) => {
// manually adding the group '_nogroup' to the list.
- groups.unshift({ name: '' });
+ groups.unshift({ name: '' });
+ this.allGroups = Array.from(groups).map((group) => {
+ return {
+ value: group.name,
+ text: group.name === '' ? DEFAULT_SUBVOLUME_GROUP : group.name
+ };
+ });
const observables = groups.map((group) =>
this.cephfsSubvolumeService.existsInFs(this.fsName, group.name).pipe(
switchMap((resp) => {
cloneModal() {
const cloneName = `clone_${moment().toISOString(true)}`;
- const allGroups = Array.from(this.subvolumeGroupList).map((group) => {
- return { value: group, text: group === '' ? '_nogroup' : group };
- });
this.modalService.show(FormModalComponent, {
titleText: $localize`Create clone`,
fields: [
valueChangeListener: true,
dependsOn: 'cloneName',
typeConfig: {
- options: allGroups
+ options: this.allGroups
}
}
],