Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-133463 / 25.04 / Enable canCreateDataset in more places #11321

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
[label]="schema.title | translate"
[tooltip]="schema.tooltip | translate"
[required]="schema.required || false"
[canCreateDataset]="!isEditMode()"
[nodeProvider]="schema.nodeProvider"
></ix-explorer>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
import { createComponentFactory, Spectator } from '@ngneat/spectator/jest';
import { MockInstance } from 'ng-mocks';
import { BehaviorSubject, of } from 'rxjs';
import { mockAuth } from 'app/core/testing/utils/mock-auth.utils';
import { CodeEditorLanguage } from 'app/enums/code-editor-language.enum';
import {
DynamicFormSchemaInput,
Expand Down Expand Up @@ -136,6 +137,9 @@ describe('IxDynamicFormItemComponent', () => {
imports: [
ReactiveFormsModule,
],
providers: [
mockAuth(),
],
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
[label]="'Home Directory' | translate"
[tooltip]="tooltips.home | translate"
[nodeProvider]="treeNodeProvider"
[canCreateDataset]="!editingUser"
></ix-explorer>

<ix-permissions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
[label]="'Path' | translate"
[tooltip]="helptext.anonpath_tooltip | translate"
[nodeProvider]="treeNodeProvider"
[canCreateDataset]="true"
></ix-explorer>
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
[label]="helptext.extent_placeholder_path | translate"
[tooltip]="helptext.extent_tooltip_path | translate"
[required]="true"
[canCreateDataset]="isNew"
></ix-explorer>

<ix-input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
[tooltip]="helptextSharingIscsi.dataset_tooltip | translate"
[required]="true"
[nodeProvider]="fileNodeProvider"
[canCreateDataset]="true"
></ix-explorer>

<ix-input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
[required]="true"
[tooltip]="tooltips.script | translate"
[nodeProvider]="treeNodeProvider"
[canCreateDataset]="isNew"
></ix-explorer>
}


<ix-select
formControlName="when"
[label]="'When' | translate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export class ManualUpdateFormComponent implements OnInit {
hideCheckbox: true,
buttonText: helptext.ha_update.complete_action,
hideCancel: true,
}).pipe(untilDestroyed(this)).subscribe(() => {});
}).pipe(untilDestroyed(this)).subscribe();
}

handleUpdateSuccess(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,16 @@ export class UpdateActionsCardComponent implements OnInit {
});
}

private finishHaUpdate(): Observable<boolean> {
return this.dialogService.confirm({
title: helptext.ha_update.complete_title,
message: helptext.ha_update.complete_msg,
hideCheckbox: true,
buttonText: helptext.ha_update.complete_action,
hideCancel: true,
});
}

private update(resume = false): void {
this.window.sessionStorage.removeItem('updateLastChecked');
this.window.sessionStorage.removeItem('updateAvailable');
Expand All @@ -308,13 +318,7 @@ export class UpdateActionsCardComponent implements OnInit {
this.isUpdateRunning = false;
this.sysGenService.updateDone(); // Send 'finished' signal to topbar
this.cdr.markForCheck();
return this.dialogService.confirm({
title: helptext.ha_update.complete_title,
message: helptext.ha_update.complete_msg,
hideCheckbox: true,
buttonText: helptext.ha_update.complete_action,
hideCancel: true,
});
return this.isHaLicensed ? this.finishHaUpdate() : of(null);
}),
this.errorHandler.catchError(),
untilDestroyed(this),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
[label]="'Source' | translate"
[required]="true"
[nodeProvider]="directoryNodeProvider"
[canCreateDataset]="isNew()"
></ix-explorer>

<ix-input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { MatButtonHarness } from '@angular/material/button/testing';
import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest';
import { mockApi, mockCall } from 'app/core/testing/utils/mock-api.utils';
import { mockAuth } from 'app/core/testing/utils/mock-auth.utils';
import { VirtualizationDeviceType } from 'app/enums/virtualization.enum';
import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness';
import { SlideInRef } from 'app/modules/slide-ins/slide-in-ref';
Expand All @@ -19,6 +20,7 @@ describe('InstanceDiskFormComponent', () => {
const createComponent = createComponentFactory({
component: InstanceDiskFormComponent,
providers: [
mockAuth(),
mockApi([
mockCall('virt.instance.device_add'),
mockCall('virt.instance.device_update'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ export class InstanceDiskFormComponent implements OnInit {
destination: ['', Validators.required],
});

protected isNew = computed(() => !this.existingDisk());

protected title = computed(() => {
return this.existingDisk() ? this.translate.instant('Edit Disk') : this.translate.instant('Add Disk');
return !this.isNew() ? this.translate.instant('Edit Disk') : this.translate.instant('Add Disk');
});

constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
[label]="'Source' | translate"
[required]="true"
[nodeProvider]="directoryNodeProvider"
[canCreateDataset]="true"
></ix-explorer>

<ix-input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ <h1 matDialogTitle>{{ 'Upload Image File' | translate }}</h1>
[required]="true"
[label]="'ISO save location' | translate"
[nodeProvider]="directoryNodeProvider"
[canCreateDataset]="true"
[tooltip]="helptext.upload_iso_path_tooltip | translate"
></ix-explorer>

Expand Down
8 changes: 4 additions & 4 deletions src/assets/i18n/ko.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"": "",
"Enable General Purpose OS STIG compatibility mode": "범용 운영체제 STIG 호환 모드 활성화",
"Enable this mode to enhance system security to meet US federal government security requirements. Note that enabling STIG mode will restrict some functionality.": "이 모드를 활성화하여 미국 연방 정부 보안 요구 사항을 충족하도록 시스템 보안을 강화합니다. STIG 모드를 활성화하면 일부 기능이 제한됩니다.",
"Restart is required after changing these settings.": "이 설정들을 바꾼 후에는 재시작이 필요합니다.",
"\n It looks like your session has been inactive for more than {lifetime} seconds.<br>\n For security reasons we will log you out at {time}.\n ": "세션의 비활성화 시간이 {lifetime}초를 넘었습니다.<br />보안을 위해 {time}에 로그아웃 되었습니다.",
" Est. Usable Raw Capacity": " 사용 가능한 원시 용량 추정",
" When the <b>UPS Mode</b> is set to <i>slave</i>. Enter the open network port number of the UPS <i>Master</i> system. The default port is <i>3493</i>.": " <b>UPS 모드</b>가 <i>슬레이브</i>일 때, <i>마스터</i> UPS 시스템의 네트워크 포트 번호를 입력합니다. 기본 포트는 <i>3493</i>입니다.",
Expand Down Expand Up @@ -1594,6 +1591,7 @@
"Enable FSRVP": "FSRVP 활성화",
"Enable FXP": "FXP 활성화",
"Enable GMail OAuth authentication.": "GMail OAuth 인증을 활성화합니다.",
"Enable General Purpose OS STIG compatibility mode": "범용 운영체제 STIG 호환 모드 활성화",
"Enable HTTPS Redirect": "HTTPS 재연결 활성화",
"Enable Hyper-V Enlightenments": "Hyper-V Enlightenments 활성화",
"Enable Kernel Debug": "커널 디버그 활성화",
Expand Down Expand Up @@ -1628,6 +1626,7 @@
"Enable this SMB share. Unset to disable this SMB share without deleting it.": "이 SMB 공유를 활성화합니다. 설정하지 않으면 이 SMB 공유를 삭제하지 않고 비활성화합니다.",
"Enable this TrueCloud Backup Task. Unset to disable this TrueCloud Backup Task without deleting it.": "이 TrueCloud 백업 작업을 활성화합니다. 설정하지 않으면 이 TrueCloud 백업 작업을 삭제하지 않고 비활성화합니다.",
"Enable this cron job. When unset, disable the cron job without deleting it.": "이 Cron 작업을 활성화합니다. 설정하지 않으면 이 Cron 작업을 삭제하지 않고 비활성화합니다.",
"Enable this mode to enhance system security to meet US federal government security requirements. Note that enabling STIG mode will restrict some functionality.": "이 모드를 활성화하여 미국 연방 정부 보안 요구 사항을 충족하도록 시스템 보안을 강화합니다. STIG 모드를 활성화하면 일부 기능이 제한됩니다.",
"Enable this rsync task. Unset to disable this rsync task without deleting it.": "이 Rsync 작업을 활성화합니다. 설정하지 않으면 이 Rsync 작업을 삭제하지 않고 비활성화합니다",
"Enable this service to start automatically.": "이 서비스를 자동으로 시작합니다.",
"Enable this task. Unset to disable the task without deleting it.": "이 작업을 활성화합니다. 설정하지 않으면 이 작업을 삭제하지 않고 비활성화합니다.",
Expand Down Expand Up @@ -3555,6 +3554,7 @@
"Restart Standby": "재시작 대기",
"Restart Web Service": "웹 서비스 재시작",
"Restart is recommended for new FIPS setting to take effect. Would you like to restart now?": "새로운 FIPS 설정이 작용하기 위해 재시작을 권장합니다. 지금 재시작하시겠습니까?",
"Restart is required after changing these settings.": "이 설정들을 바꾼 후에는 재시작이 필요합니다.",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "새로운 FIPS 설정을 적용하기 위해 원격 시스템을 재시작해야 합니다. 지금 재시작하시겠습니까?",
"Restart standby TrueNAS controller": "대기중인 TrueNAS 컨트롤러 재시작",
"Restart to improve system performance speed.": "재시작하여 시스템 성능 속도를 개선합니다.",
Expand Down Expand Up @@ -5321,4 +5321,4 @@
"{used} of {total} ({used_pct})": "{total} 중 {used} ({used_pct})",
"{version} is available!": "{version}이 준비되었습니다!",
"{view} on {enclosure}": "{enclousure}의 {view}"
}
}
Loading