8000 NAS-134619 / 25.10 / App page uses both "update" and "upgrade" as terminology … by undsoft · Pull Request #12137 · truenas/webui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

NAS-134619 / 25.10 / App page uses both "update" and "upgrade" as terminology … #12137

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

Merged
merged 4 commits into from
Jun 16, 2025
Merged
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
2 changes: 1 addition & 1 deletion src/app/helptext/apps/apps.ts
10000
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const helptextApps = {

apps: {
deleting: T('Deleting...'),
upgrading: T('Upgrading...'),
upgrading: T('Updating...'),

rollbackDialog: {
version: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { App } from 'app/interfaces/app.interface';
import { AppUpgradeSummary } from 'app/interfaces/application.interface';

export interface AppUpgradeDialogConfig {
export interface AppUpdateDialogConfig {
appInfo: App;
upgradeSummary: AppUpgradeSummary;
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ const appVersion121 = {
{ name: 'Port Forwarding' },
{ name: 'Health Check' },
{ name: 'Workload Details' },
{ name: 'Scaling/Upgrade Policy' },
{ name: 'Scaling/Update Policy' },
{ name: 'Restart Policy' },
{ name: 'IPFS Configuration' },
],
questions: [
{
group: 'Scaling/Upgrade Policy',
group: 'Scaling/Update Policy',
label: 'Update Strategy',
schema: {
default: 'RollingUpdate',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<h1 matDialogTitle>{{ 'Upgrade' | translate }}</h1>
<h1 matDialogTitle>{{ 'Update' | translate }}</h1>
<form class="ix-form-container" [formGroup]="form" (submit)="onSubmit()">
<p>
<strong>
{{ 'The following { n, plural, one {application} other {# applications} } will be upgraded. Are you sure you want to proceed?' | translate: { n: bulkItems.size } }}
{{ 'The following { n, plural, one {application} other {# applications} } will be updated. Are you sure you want to proceed?' | translate: { n: bulkItems.size } }}
</strong>
</p>

Expand Down Expand Up @@ -41,7 +41,7 @@ <h1 matDialogTitle>{{ 'Upgrade' | translate }}</h1>
@if(isItemExpanded(bulkItem)) {
<ix-select
[formControlName]="bulkItem.key"
[label]="'Version to be upgraded to' | translate"
[label]="'Version to be updated to' | translate"
[required]="true"
[options]="optionsMap.get(bulkItem.key)"
></ix-select>
Expand Down Expand Up @@ -80,10 +80,10 @@ <h1 matDialogTitle>{{ 'Upgrade' | translate }}</h1>
mat-button
type="submit"
color="primary"
ixTest="upgrade"
ixTest="update"
[disabled]="form.invalid || bulkItems.size === 0"
>
{{ 'Upgrade' | translate }}
{{ 'Update' | translate }}
</button>
<button mat-button type="button" matDialogClose ixTest="cancel">
{{ 'Cancel' | translate }}
Expand Down
B41A
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { BulkListItemComponent } from 'app/modules/lists/bulk-list-item/bulk-lis
import { FakeProgressBarComponent } from 'app/modules/loader/components/fake-progress-bar/fake-progress-bar.component';
import { SnackbarService } from 'app/modules/snackbar/services/snackbar.service';
import { ApiService } from 'app/modules/websocket/api.service';
import { AppBulkUpgradeComponent } from 'app/pages/apps/components/installed-apps/app-bulk-upgrade/app-bulk-upgrade.component';
import { AppBulkUpdateComponent } from 'app/pages/apps/components/installed-apps/app-bulk-update/app-bulk-update.component';

const fakeAppOne = {
name: 'test-app-one',
Expand Down Expand Up @@ -70,12 +70,12 @@ const fakeUpgradeSummary: AppUpgradeSummary = {
upgrade_human_version: '24.0.6_15.3.36',
};

describe('AppBulkUpgradeComponent', () => {
let spectator: Spectator<AppBulkUpgradeComponent>;
describe('AppBulkUpdateComponent', () => {
let spectator: Spectator<AppBulkUpdateComponent>;
let loader: HarnessLoader;

const createComponent = createComponentFactory({
component: AppBulkUpgradeComponent,
component: AppBulkUpdateComponent,
imports: [
ReactiveFormsModule,
ImgFallbackModule,
Expand Down Expand Up @@ -109,7 +109,7 @@ describe('AppBulkUpgradeComponent', () => {

it('checks dialog confirmation text', () => {
expect(spectator.fixture.nativeElement).toHaveText(
'The following 2 applications will be upgraded. Are you sure you want to proceed?',
'The following 2 applications will be updated. Are you sure you want to proceed?',
);
});

Expand All @@ -122,10 +122,10 @@ describe('AppBulkUpgradeComponent', () => {
['test-app-two'],
]];

const updatedButton = await loader.getHarness(MatButtonHarness.with({ text: 'Upgrade' }));
const updatedButton = await loader.getHarness(MatButtonHarness.with({ text: 'Update' }));
await updatedButton.click();

expect(spectator.inject(ApiService).job).toHaveBeenCalledWith('core.bulk', jobArguments);
expect(spectator.inject(SnackbarService).success).toHaveBeenCalledWith('Upgrading Apps. Please check on the progress in Task Manager.');
expect(spectator.inject(SnackbarService).success).toHaveBeenCalledWith('Updating Apps. Please check on the progress in Task Manager.');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ import { ErrorHandlerService } from 'app/services/errors/error-handler.service';

@UntilDestroy()
@Component({
selector: 'ix-app-bulk-upgrade',
templateUrl: './app-bulk-upgrade.component.html',
styleUrls: ['./app-bulk-upgrade.component.scss'],
selector: 'ix-app-bulk-update',
templateUrl: './app-bulk-update.component.html',
styleUrls: ['./app-bulk-update.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
ReactiveFormsModule,
Expand All @@ -63,7 +63,7 @@ import { ErrorHandlerService } from 'app/services/errors/error-handler.service';
MatButton,
],
})
export class AppBulkUpgradeComponent {
export class AppBulkUpdateComponent {
readonly expandedItems = signal<string[]>([]);

form = this.formBuilder.group<Record<string, string>>({});
Expand All @@ -80,7 +80,7 @@ export class AppBulkUpgradeComponent {
private formBuilder: FormBuilder,
private api: ApiService,
private translate: TranslateService,
private dialogRef: MatDialogRef<AppBulkUpgradeComponent>,
private dialogRef: MatDialogRef<AppBulkUpdateComponent>,
private appService: ApplicationsService,
private snackbar: SnackbarService,
private errorHandler: ErrorHandlerService,
Expand Down Expand Up @@ -160,7 +160,7 @@ export class AppBulkUpgradeComponent {
.subscribe(() => {
this.dialogRef.close();
this.snackbar.success(
this.translate.instant('Upgrading Apps. Please check on the progress in Task Manager.'),
this.translate.instant('Updating Apps. Please check on the progress in Task Manager.'),
);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { AppDeleteDialog } from 'app/pages/apps/components/app-delete-dialog/app
import { CustomAppFormComponent } from 'app/pages/apps/components/custom-app-form/custom-app-form.component';
import { AppInfoCardComponent } from 'app/pages/apps/components/installed-apps/app-info-card/app-info-card.component';
import { AppRollbackModalComponent } from 'app/pages/apps/components/installed-apps/app-rollback-modal/app-rollback-modal.component';
import { AppUpgradeDialog } from 'app/pages/apps/components/installed-apps/app-upgrade-dialog/app-upgrade-dialog.component';
import { AppUpdateDialog } from 'app/pages/apps/components/installed-apps/app-update-dialog/app-update-dialog.component';
import { ApplicationsService } from 'app/pages/apps/services/applications.service';
import { InstalledAppsStore } from 'app/pages/apps/store/installed-apps-store.service';
import { RedirectService } from 'app/services/redirect.service';
Expand Down Expand Up @@ -62,7 +62,7 @@ describe('AppInfoCardComponent', () => {
},
close: jest.fn(),
afterClosed: () => of(true),
} as unknown as MatDialogRef<AppUpgradeDialog>;
} as unknown as MatDialogRef<AppUpdateDialog>;

const createComponent = createComponentFactory({
component: AppInfoCardComponent,
Expand Down Expand Up @@ -184,13 +184,13 @@ describe('AppInfoCardComponent', () => {
expect(await menuItems[1].getText()).toContain('Convert to custom app');
});

it('opens upgrade app dialog when Update button is pressed', async () => {
it('opens update app dialog when Update button is pressed', async () => {
setupTest(fakeApp);

const menu = await loader.getHarness(MatMenuHarness.with({ selector: '[ixTest="app-info-menu"]' }));
await menu.clickItem({ text: 'Update' });

expect(spectator.inject(MatDialog).open).toHaveBeenCalledWith(AppUpgradeDialog, {
expect(spectator.inject(MatDialog).open).toHaveBeenCalledWith(AppUpdateDialog, {
maxWidth: '750px',
minWidth: '500px',
width: '50vw',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { AppState } from 'app/enums/app-state.enum';
import { Role } from 'app/enums/role.enum';
import { WINDOW } from 'app/helpers/window.helper';
import { helptextApps } from 'app/helptext/apps/apps';
import { AppUpgradeDialogConfig } from 'app/interfaces/app-upgrade-dialog-config.interface';
import { AppUpdateDialogConfig } from 'app/interfaces/app-upgrade-dialog-config.interface';
import { App } from 'app/interfaces/app.interface';
import { DialogService } from 'app/modules/dialog/dialog.service';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';
Expand All @@ -38,7 +38,7 @@ import { AppDeleteDialog } from 'app/pages/apps/components/app-delete-dialog/app
import { AppDeleteDialogInputData, AppDeleteDialogOutputData } from 'app/pages/apps/components/app-delete-dialog/app-delete-dialog.interface';
import { CustomAppFormComponent } from 'app/pages/apps/components/custom-app-form/custom-app-form.component';
import { AppRollbackModalComponent } from 'app/pages/apps/components/installed-apps/app-rollback-modal/app-rollback-modal.component';
import { AppUpgradeDialog } from 'app/pages/apps/components/installed-apps/app-upgrade-dialog/app-upgrade-dialog.component';
import { AppUpdateDialog } from 'app/pages/apps/components/installed-apps/app-update-dialog/app-update-dialog.component';
import { ApplicationsService } from 'app/pages/apps/services/applications.service';
import { InstalledAppsStore } from 'app/pages/apps/store/installed-apps-store.service';
import { AppVersionPipe } from 'app/pages/dashboard/widgets/apps/common/utils/app-version.pipe';
Expand Down Expand Up @@ -152,14 +152,14 @@ export class AppInfoCardComponent {
this.appService.getAppUpgradeSummary(name).pipe(
this.loader.withLoader(),
switchMap(
(summary) => this.matDialog.open(AppUpgradeDialog, {
(summary) => this.matDialog.open(AppUpdateDialog, {
width: '50vw',
minWidth: '500px',
maxWidth: '750px',
data: {
appInfo: this.app(),
upgradeSummary: summary,
} as AppUpgradeDialogConfig,
} as AppUpdateDialogConfig,
}).afterClosed(),
),
filter(Boolean),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('AppUpdateCellComponent', () => {
`, { hostProps: { app } });
}

it('shows up to date when app does not have upgrade available', () => {
it('shows up to date when app does not have update available', () => {
setupTest({ upgrade_available: false } as App);

expect(spectator.query('span')).toHaveText('Up to date');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class AppUpdateCellComponent {
protected getVersionMsg(version: string): string {
return this.translate.instant(
'{version} is available!',
{ version: this.appVersionPipe.transform(version) || 'Upgrade' },
{ version: this.appVersionPipe.transform(version) || 'Update' },
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

@if (selectedVersion?.available_versions_for_upgrade?.length) {
<div class="resource">
<span>{{ 'Version to be upgraded to' | translate }}:</span>
<span>{{ 'Version to be updated to' | translate }}:</span>
<mat-form-field class="form-element">
<mat-select
ixTest="versions"
Expand Down Expand Up @@ -67,10 +67,10 @@
*ixRequiresRoles="requiredRoles"
mat-button
color="primary"
ixTest="upgrade"
ixTest="update"
(click)="dialogRef.close(selectedVersionKey)"
>
{{ 'Upgrade' | translate }}
{{ 'Update' | translate }}
</button>
</ix-form-actions>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FormsModule } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest';
import { ImgFallbackModule } from 'ngx-img-fallback';
import { AppUpgradeDialog } from 'app/pages/apps/components/installed-apps/app-upgrade-dialog/app-upgrade-dialog.component';
import { AppUpdateDialog } from 'app/pages/apps/components/installed-apps/app-update-dialog/app-update-dialog.component';

const fakeAppInfo = {
name: 'elastic-search',
Expand Down Expand Up @@ -30,10 +30,10 @@ const fakeUpgradeSummary = {
upgrade_human_version: '8.7.0_1.0.2',
};

describe('AppUpgradeDialogComponent', () => {
let spectator: Spectator<AppUpgradeDialog>;
describe('AppUpdateDialog', () => {
let spectator: Spectator<AppUpdateDialog>;
const createComponent = createComponentFactory({
component: AppUpgradeDialog,
component: AppUpdateDialog,
imports: [
FormsModule,
ImgFallbackModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { appImagePlaceholder } from 'app/constants/catalog.constants';
import { RequiresRolesDirective } from 'app/directives/requires-roles/requires-roles.directive';
import { Role } from 'app/enums/role.enum';
import { helptextApps } from 'app/helptext/apps/apps';
import { AppUpgradeDialogConfig } from 'app/interfaces/app-upgrade-dialog-config.interface';
import { AppUpdateDialogConfig } from 'app/interfaces/app-upgrade-dialog-config.interface';
import { ChartContainerImage } from 'app/interfaces/app.interface';
import { AppUpgradeSummary } from 'app/interfaces/application.interface';
import { DialogService } from 'app/modules/dialog/dialog.service';
Expand All @@ -32,9 +32,9 @@ type Version = Omit<AppUpgradeSummary, 'upgrade_version' | 'image_update_availab

@UntilDestroy()
@Component({
selector: 'ix-app-upgrade-dialog',
styleUrls: ['./app-upgrade-dialog.component.scss'],
templateUrl: './app-upgrade-dialog.component.html',
selector: 'ix-app-update-dialog',
styleUrls: ['./app-update-dialog.component.scss'],
templateUrl: './app-update-dialog.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
MatDialogContent,
Expand All @@ -55,8 +55,8 @@ type Version = Omit<AppUpgradeSummary, 'upgrade_version' | 'image_update_availab
RequiresRolesDirective,
],
})
export class AppUpgradeDialog {
dialogConfig: AppUpgradeDialogConfig;
export class AppUpdateDialog {
dialogConfig: AppUpdateDialogConfig;
imagePlaceholder = appImagePlaceholder;
helptext = helptextApps;
versionOptions = new Map<string, Version>();
Expand All @@ -66,12 +66,12 @@ export class AppUpgradeDialog {
protected readonly requiredRoles = [Role.AppsWrite];

constructor(
public dialogRef: MatDialogRef<AppUpgradeDialog>,
public dialogRef: MatDialogRef<AppUpdateDialog>,
private loader: LoaderService,
private errorHandler: ErrorHandlerService,
private appService: ApplicationsService,
public dialogService: DialogService,
@Inject(MAT_DIALOG_DATA) public data: AppUpgradeDialogConfig,
@Inject(MAT_DIALOG_DATA) public data: AppUpdateDialogConfig,
) {
this.dialogConfig = data;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
<button
*ixRequiresRoles="requiredRoles"
mat-menu-item
ixTest="upgrade-selected"
[disabled]="isBulkUpgradeDisabled()"
(click)="bulkUpgrade.emit()"
ixTest="update-selected"
[disabled]="isBulkUpdateDisabled()"
(click)="bulkUpdate.emit()"
>
<span>{{ 'Upgrade All Selected' | translate }}</span>
<span>{{ 'Update All Selected' | translate }}</span>
</button>
<button
*ixRequiresRoles="requiredRoles"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ describe('InstalledAppsListBulkActionsComponent', () => {
expect(stopSpy).toHaveBeenCalled();
});

it('emits bulkUpgrade after actions', async () => {
const upgradeSpy = jest.spyOn(spectator.component.bulkUpgrade, 'emit');
it('emits bulkUpdate after actions', async () => {
const updateSpy = jest.spyOn(spectator.component.bulkUpdate, 'emit');

await menu.open();
await menu.clickItem({ text: 'Upgrade All Selected' });
await menu.clickItem({ text: 'Update All Selected' });

expect(upgradeSpy).toHaveBeenCalled();
expect(updateSpy).toHaveBeenCalled();
});

it('emits bulkDelete after actions', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class InstalledAppsListBulkActionsComponent {
readonly checkedApps = input.required<App[]>();
readonly bulkStart = output();
readonly bulkStop = output();
readonly bulkUpgrade = output();
readonly bulkUpdate = output();
readonly bulkDelete = output();

protected readonly requiredRoles = [Role.AppsWrite];
Expand All @@ -54,7 +54,7 @@ export class InstalledAppsListBulkActionsComponent {
);
});

protected isBulkUpgradeDisabled = computed(() => {
protected isBulkUpdateDisabled = computed(() => {
return !this.checkedApps().some((app) => app.upgrade_available);
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h2>{{ 'Applications' | translate }}</h2>
[checkedApps]="checkedApps"
(bulkStart)="onBulkStart()"
(bulkStop)="onBulkStop()"
(bulkUpgrade)="onBulkUpgrade()"
(bulkUpdate)="onBulkUpdate()"
(bulkDelete)="onBulkDelete()"
></ix-installed-apps-list-bulk-actions>
}
Expand Down
Loading
Loading
0