3 (overlaySelected)="closeModal()">
4 <cds-modal-header (closeSelect)="closeModal()"
5 i18n>{{editing ? 'Edit' : 'Create'}} Tiering configuration
6 <cd-help-text [formAllFieldsRequired]="true"></cd-help-text>
9 <ng-container *cdFormLoading="loading">
10 <section cdsModalContent>
12 *ngIf="(snapScheduleModuleStatus$ | async) === false"
16 class="align-items-center"
18 (action)="enableSnapshotSchedule()"
20 In order to access the snapshot scheduler feature, the snap_scheduler module must be enabled
22 <cd-alert-panel *ngIf="storageClassList?.length === 0 &&
23 isStorageClassFetched"
26 class="align-items-center"
29 (action)="goToCreateStorageClass()">
30 No storage class found. Consider creating it first to proceed.
32 <form name="tieringForm"
34 [formGroup]="tieringForm"
36 <div class="form-item">
38 labelInputID="rule_name"
39 [invalid]="!tieringForm.controls.name.valid && tieringForm.controls.name.dirty"
40 [invalidText]="ruleNameError"
41 [helperText]="ruleHelper"
49 formControlName="name"
52 <ng-template #ruleHelper>
53 <span i18n>Unique identifier for the rule. The value cannot be longer than 255 characters.
56 <ng-template #ruleNameError>
57 <span *ngIf="tieringForm.showError('name', formDir, 'required')"
58 class="invalid-feedback">
59 <ng-container i18n>This field is required.</ng-container>
61 <span *ngIf="tieringForm.showError('name', formDir, 'duplicate')"
62 class="invalid-feedback">
63 <ng-container i18n>Please enter a unique name.</ng-container>
67 <div class="form-item">
68 <cds-select id="storageClass"
69 formControlName="storageClass"
71 [helperText]="storageClassHelper">
72 <option *ngIf="storageClassList === null"
73 value="">Loading...</option>
74 <option *ngIf="storageClassList !== null && storageClassList.length === 0"
75 value="">-- No storage class available --</option>
76 <option *ngIf="storageClassList !== null && storageClassList.length > 0"
77 value="">-- Select the storage class --</option>
78 <option *ngFor="let tier of storageClassList"
79 [value]="tier.storage_class">
80 {{ tier.storage_class }}
83 <ng-template #storageClassHelper>
84 <span i18n>The storage class to which you want the object to transition.
88 <legend class="cds--label">Choose a configuration scope</legend>
91 formControlName="hasPrefix"
93 <cds-radio [value]="false"
95 {{ 'Apply to all objects in the bucket' }}
97 <cds-radio [value]="true"
99 {{ 'Limit the scope of this rule to selected filter criteria' }}
103 <div class="form-item"
104 *ngIf="tieringForm.controls.hasPrefix.value">
105 <cds-text-label labelInputID="prefix"
106 [invalid]="!tieringForm.controls.prefix.valid && tieringForm.controls.prefix.dirty"
107 [invalidText]="prefixError"
108 [helperText]="prefixHelper"
113 formControlName="prefix"/>
115 <ng-template #prefixHelper>
117 Prefix identifying one or more objects to which the rule applies
120 <ng-template #prefixError>
121 <span *ngIf="tieringForm.showError('prefix', formDir, 'required')"
122 class="invalid-feedback">
123 <ng-container i18n>This field is required.</ng-container>
129 <div *ngIf="tieringForm.controls.hasPrefix.value">
130 <div class="form-group-header">Tags</div>
131 <div>All the tags must exist in the object's tag set for the rule to apply.</div>
132 <ng-container formArrayName="tags"
133 *ngFor="let tags of tags.controls; index as i">
134 <ng-container [formGroupName]="i">
136 class="form-item form-item-append">
138 <cds-text-label labelInputID="Key"
139 i18n>Name of the object key
142 placeholder="Enter name of the object key"
144 formControlName="Key"
149 <cds-text-label labelInputID="Value"
150 i18n>Value of the tag
153 placeholder="Enter value of the tag"
155 formControlName="Value"
160 [columnNumbers]="{ lg: 2, md: 2 }"
161 class="item-action-btn">
162 <cds-icon-button kind="tertiary"
164 (click)="removeTags(i)">
165 <svg cdsIcon="trash-can"
167 class="cds--btn__icon"></svg>
173 <div class="form-item">
174 <button cdsButton="tertiary"
180 class="cds--btn__icon"
186 <legend class="cds--label">Status</legend>
189 formControlName="status">
190 <cds-radio [value]="'Enabled'"
191 i18n>Enabled </cds-radio>
192 <cds-radio [value]="'Disabled'"
193 i18n>Disabled </cds-radio>
196 <div class="form-item">
197 <cds-number formControlName="days"
198 label="Number of days"
200 [invalid]="!tieringForm.controls.days.valid && tieringForm.controls.days.dirty"
201 [invalidText]="daysError"
202 [helperText]="daysHelper"></cds-number>
203 <ng-template #daysHelper>
204 <span i18n>Select the number of days to transition the objects to the specified storage class. The value must be a positive integer.
207 <ng-template #daysError>
208 <span *ngIf="tieringForm.showError('days', formDir, 'required')"
209 i18n>This field is required.</span>
210 <span *ngIf="tieringForm.showError('days', formDir, 'pattern')"
211 i18n>Enter a valid positive number</span>
217 <cd-form-button-panel
218 (submitActionEvent)="submitTieringConfig()"
220 [submitText]="editing ? actionLabels.EDIT : actionLabels.CREATE"
222 [disabled]="storageClassList?.length === 0 && isStorageClassFetched"
223 ></cd-form-button-panel>