it('shows the right texts', () => {
assert.quotaUpdateModalTexts(
- "Update CephFS files quota for '/a/c/b'",
- "The inherited files quota 10 from '/a' is the maximum value to be used.",
- "Updated CephFS files quota for '/a/c/b'"
+ `Update CephFS files quota for '/a/c/b'`,
+ `The inherited files quota 10 from '/a' is the maximum value to be used.`,
+ `Updated CephFS files quota for '/a/c/b'`
);
});
});
it('shows the right texts', () => {
assert.quotaUpdateModalTexts(
- "Update CephFS size quota for '/a/c/b'",
- "The inherited size quota 1 KiB from '/a' is the maximum value to be used.",
- "Updated CephFS size quota for '/a/c/b'"
+ `Update CephFS size quota for '/a/c/b'`,
+ `The inherited size quota 1 KiB from '/a' is the maximum value to be used.`,
+ `Updated CephFS size quota for '/a/c/b'`
);
});
});
assert.quotaUpdateModalField('binary', 'Max size', 'max_bytes', 512, 1024);
});
- it("uses 'Set' action instead of 'Update' if the quota is not set (0)", () => {
+ it(`uses 'Set' action instead of 'Update' if the quota is not set (0)`, () => {
mockLib.updateQuotaThroughModal('max_bytes', 0);
mockLib.updateQuotaThroughModal('max_bytes', 200);
assert.quotaUpdateModalTexts(
- "Set CephFS size quota for '/a/c/b'",
- "The inherited size quota 1 KiB from '/a' is the maximum value to be used.",
- "Set CephFS size quota for '/a/c/b'"
+ `Set CephFS size quota for '/a/c/b'`,
+ `The inherited size quota 1 KiB from '/a' is the maximum value to be used.`,
+ `Set CephFS size quota for '/a/c/b'`
);
});
});
it('shows the right texts', () => {
assert.quotaUnsetModalTexts(
- "Unset CephFS files quota for '/a/c/b'",
- "Unset files quota 5 from '/a/c/b' in order to inherit files quota 10 from '/a'.",
- "Unset CephFS files quota for '/a/c/b'"
+ `Unset CephFS files quota for '/a/c/b'`,
+ `Unset files quota 5 from '/a/c/b' in order to inherit files quota 10 from '/a'.`,
+ `Unset CephFS files quota for '/a/c/b'`
);
});
});
it('shows the right texts', () => {
assert.quotaUnsetModalTexts(
- "Unset CephFS size quota for '/a/c/b'",
- "Unset size quota 512 B from '/a/c/b' in order to inherit size quota 1 KiB from '/a'.",
- "Unset CephFS size quota for '/a/c/b'"
+ `Unset CephFS size quota for '/a/c/b'`,
+ `Unset size quota 512 B from '/a/c/b' in order to inherit size quota 1 KiB from '/a'.`,
+ `Unset CephFS size quota for '/a/c/b'`
);
});
});
mockLib.selectNode('/a');
mockLib.unsetQuotaThroughModal('max_bytes');
assert.quotaUnsetModalTexts(
- "Unset CephFS size quota for '/a'",
- "Unset size quota 1 KiB from '/a' in order to have no quota on the directory.",
- "Unset CephFS size quota for '/a'"
+ `Unset CephFS size quota for '/a'`,
+ `Unset size quota 1 KiB from '/a' in order to have no quota on the directory.`,
+ `Unset CephFS size quota for '/a'`
);
});
it('uses different Text if quota is already inherited', () => {
mockLib.unsetQuotaThroughModal('max_bytes');
assert.quotaUnsetModalTexts(
- "Unset CephFS size quota for '/a/c/b'",
- "Unset size quota 2 KiB from '/a/c/b' which isn't used because of the inheritance " +
- "of size quota 1 KiB from '/a'.",
- "Unset CephFS size quota for '/a/c/b'"
+ `Unset CephFS size quota for '/a/c/b'`,
+ `Unset size quota 2 KiB from '/a/c/b' which isn't used because of the inheritance ` +
+ `of size quota 1 KiB from '/a'.`,
+ `Unset CephFS size quota for '/a/c/b'`
);
});
});
actions = component.quota.tableActions;
});
- it("shows 'Set' for empty and not set quotas", () => {
+ it(`shows 'Set' for empty and not set quotas`, () => {
const isSetVisible = actions[0].visible;
expect(isSetVisible(empty())).toBe(true);
expect(isSetVisible(select(0))).toBe(true);
expect(isSetVisible(select(1))).toBe(false);
});
- it("shows 'Update' for set quotas only", () => {
+ it(`shows 'Update' for set quotas only`, () => {
const isUpdateVisible = actions[1].visible;
expect(isUpdateVisible(empty())).toBeFalsy();
expect(isUpdateVisible(select(0))).toBe(false);
expect(isUpdateVisible(select(1))).toBe(true);
});
- it("only enables 'Unset' for set quotas only", () => {
+ it(`only enables 'Unset' for set quotas only`, () => {
const isUnsetDisabled = actions[2].disable;
expect(isUnsetDisabled(empty())).toBe(true);
expect(isUnsetDisabled(select(0))).toBe(true);
}
private getModalQuotaTitle(action: string, path: string): string {
- return this.i18n("{{action}} CephFS {{quotaName}} quota for '{{path}}'", {
+ return this.i18n(`{{action}} CephFS {{quotaName}} quota for '{{path}}'`, {
action,
quotaName: this.getQuotaName(),
path
}
private getQuotaValueFromPathMsg(value: number, path: string): string {
- return this.i18n("{{quotaName}} quota {{value}} from '{{path}}'", {
+ return this.i18n(`{{quotaName}} quota {{value}} from '{{path}}'`, {
value: this.isBytesQuotaSelected() ? this.dimlessBinaryPipe.transform(value) : value,
quotaName: this.getQuotaName(),
path
? this.i18n('in order to inherit {{quotaValue}}', {
quotaValue: this.getQuotaValueFromPathMsg(nextMax.value, nextMax.path)
})
- : this.i18n("which isn't used because of the inheritance of {{quotaValue}}", {
+ : this.i18n(`which isn't used because of the inheritance of {{quotaValue}}`, {
quotaValue: this.getQuotaValueFromPathMsg(nextMax.value, nextMax.path)
})
: this.i18n('in order to have no quota on the directory')
this.cephfsService.mkSnapshot(this.id, path, values.name).subscribe((name) => {
this.notificationService.show(
NotificationType.success,
- this.i18n('Created snapshot "{{name}}" for "{{path}}"', {
+ this.i18n(`Created snapshot '{{name}}' for '{{path}}'`, {
name: name,
path: path
})
this.cephfsService.rmSnapshot(this.id, path, name).subscribe(() => {
this.notificationService.show(
NotificationType.success,
- this.i18n('Deleted snapshot "{{name}}" for "{{path}}"', {
+ this.i18n(`Deleted snapshot '{{name}}' for '{{path}}'`, {
name: name,
path: path
})