+
-
}
@if (selectAgent && !embedded && !checkingManaged && !managedApp) {
-
+
+
+
+ @if (!checkingManaged && !managedApp && (canGoBack() || showNext())) {
+
+ @if (canGoBack()) {
+
+ }
+
+ @if (showNext()) {
+
+ }
+
+ @if (!embedded || canInstall()) {
+
+ }
+ }
+ @if (!embedded || canInstall()) {
+
+ @if (!embedded) {
+
+ }
+ @if (canInstall()) {
+
+ }
+
+ }
+
diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.scss b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.scss
index 1af432721a..95d4951c34 100644
--- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.scss
+++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.scss
@@ -2,10 +2,18 @@
// SPDX-License-Identifier: BUSL-1.1
@use 'agent-wizard' as *;
-@include wizard-chrome;
+@include wizard-stepper-dialog(1280px);
@include wizard-step-basics;
@include wizard-type-cards;
@include wizard-yaml-editor;
@include wizard-diff;
@include wizard-summary;
@include agent-virtual-profile-badge;
+@include wizard-steps-locked;
+
+:host(.tb-embedded) {
+ display: block;
+ width: auto;
+ height: auto;
+ max-height: none;
+}
diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.ts b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.ts
index 4e42694692..ece77cd194 100644
--- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.ts
+++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.ts
@@ -38,22 +38,28 @@ import {
buildVirtualAppProfiles,
VIRTUAL_APP_TYPES
} from '@home/pages/agent/util/virtual-app-profiles';
-import {
- AgentAppProfileWizardComponent,
- AgentAppProfileWizardData
-} from '@home/pages/agent/wizard/agent-app-profile-wizard.component';
+import { openAgentAppProfileWizard } from '@home/pages/agent/wizard/agent-app-profile-wizard-dialog';
import { UserPermissionsService } from '@core/http/user-permissions.service';
import { Operation, Resource } from '@shared/models/security.models';
import { AgentAppWizardLoaderService } from '@home/pages/agent/wizard/agent-app-wizard-loader.service';
import { AgentAppWizardSubmitService } from '@home/pages/agent/wizard/agent-app-wizard-submit.service';
-import { AgentAppUpgradeResult, AgentAppWizardFinish, AgentTypeCard } from '@home/pages/agent/wizard/agent-app-wizard.models';
+import {
+ AGENT_APP_INSTALL_STEP_LABELS,
+ AgentAppInstallStepKey,
+ AgentAppUpgradeResult,
+ AgentAppWizardFinish,
+ AgentTypeCard
+} from '@home/pages/agent/wizard/agent-app-wizard.models';
import { EdgeTemplateCompatibilityService } from '@home/pages/agent/util/edge-template-compatibility.service';
@Component({
selector: 'tb-agent-app-install-flow',
templateUrl: './agent-app-install-flow.component.html',
styleUrls: ['./agent-app-install-flow.component.scss'],
- standalone: false
+ standalone: false,
+ host: {
+ '[class.tb-embedded]': 'embedded'
+ }
})
export class AgentAppInstallFlowComponent extends PageComponent implements OnInit {
@@ -82,6 +88,9 @@ export class AgentAppInstallFlowComponent extends PageComponent implements OnIni
@ViewChild('stepper', { static: false })
stepper: MatStepper;
+ readonly stepLabels = AGENT_APP_INSTALL_STEP_LABELS;
+ steps: AgentAppInstallStepKey[] = [];
+ selectedIndex = 0;
bindings: StepBinding[] = [];
@@ -207,6 +216,7 @@ export class AgentAppInstallFlowComponent extends PageComponent implements OnIni
}
ngOnInit() {
+ this.steps = this.buildSteps();
this.relatedEntityId = this.lockedRelatedEntity || null;
if (this.selectAgent && this.lockedRelatedEntity?.id && this.lockedRelatedEntity?.entityType) {
this.checkingManaged = true;
@@ -402,12 +412,7 @@ export class AgentAppInstallFlowComponent extends PageComponent implements OnIni
const appType = this.selectedType || this.lockedType;
if (!appType) { return; }
const presetName = this.relatedEntityName ? `${this.relatedEntityName} profile` : undefined;
- this.dialog.open
(
- AgentAppProfileWizardComponent, {
- disableClose: true,
- panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-agent-wizard-dialog'],
- data: { lockedAppType: appType, presetName }
- }).afterClosed().subscribe(saved => {
+ openAgentAppProfileWizard(this.dialog, { lockedAppType: appType, presetName }).subscribe(saved => {
if (saved) {
this.availableProfiles = [
...this.availableProfiles.filter(p => !(isVirtualAppProfile(p) && p.templateVersion === saved.templateVersion)),
@@ -421,12 +426,7 @@ export class AgentAppInstallFlowComponent extends PageComponent implements OnIni
openEditProfile() {
if (!this.selectedProfile || isVirtualAppProfile(this.selectedProfile)) { return; }
- this.dialog.open(
- AgentAppProfileWizardComponent, {
- disableClose: true,
- panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-agent-wizard-dialog'],
- data: { profile: this.selectedProfile }
- }).afterClosed().subscribe(saved => {
+ openAgentAppProfileWizard(this.dialog, { profile: this.selectedProfile }).subscribe(saved => {
if (saved) {
this.availableProfiles = this.availableProfiles.map(p => p.id?.id === saved.id?.id ? saved : p);
this.cacheRealProfiles(saved.appType);
@@ -731,4 +731,55 @@ export class AgentAppInstallFlowComponent extends PageComponent implements OnIni
cancel() {
this.cancelled.emit(null);
}
+
+ currentStep(): AgentAppInstallStepKey | undefined {
+ return this.steps[this.selectedIndex];
+ }
+
+ canGoBack(): boolean {
+ return this.selectedIndex > 0 && !this.installedApplication;
+ }
+
+ canInstall(): boolean {
+ return !this.checkingManaged && !this.managedApp && !this.installedApplication;
+ }
+
+ showNext(): boolean {
+ const hasNext = this.selectedIndex < this.steps.length - 1;
+ return hasNext && (this.currentStep() !== 'summary' || !!this.installedApplication);
+ }
+
+ canGoNext(): boolean {
+ switch (this.currentStep()) {
+ case 'agent':
+ return this.canProceedFromAgent();
+ case 'type':
+ return this.canProceedFromType();
+ case 'config':
+ return this.canSubmit();
+ case 'summary':
+ return !!this.installedApplication;
+ default:
+ return false;
+ }
+ }
+
+ nextStepLabel(): string {
+ return this.stepLabels[this.steps[this.selectedIndex + 1]] ?? '';
+ }
+
+ private buildSteps(): AgentAppInstallStepKey[] {
+ const keys: AgentAppInstallStepKey[] = [];
+ if (this.selectAgent) {
+ keys.push('agent');
+ }
+ if (!this.lockedType) {
+ keys.push('type');
+ }
+ keys.push('config', 'summary');
+ if (this.selectAgent) {
+ keys.push('deploy');
+ }
+ return keys;
+ }
}
diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard-dialog.ts b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard-dialog.ts
new file mode 100644
index 0000000000..c4d6a400fd
--- /dev/null
+++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard-dialog.ts
@@ -0,0 +1,22 @@
+// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
+// SPDX-License-Identifier: BUSL-1.1
+import { MatDialog } from '@angular/material/dialog';
+import { Observable } from 'rxjs';
+import {
+ AgentAppInstallWizardComponent,
+ AgentAppInstallWizardData,
+ AgentAppInstallWizardResult
+} from '@home/components/agent/wizard/agent-app-install-wizard.component';
+
+export function openAgentAppInstallWizard(
+ dialog: MatDialog,
+ data: AgentAppInstallWizardData
+): Observable {
+ return dialog.open(
+ AgentAppInstallWizardComponent, {
+ disableClose: false,
+ panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-wide-dialog'],
+ data
+ }
+ ).afterClosed();
+}
diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard.component.scss b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard.component.scss
deleted file mode 100644
index d662554d66..0000000000
--- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard.component.scss
+++ /dev/null
@@ -1,5 +0,0 @@
-// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
-// SPDX-License-Identifier: BUSL-1.1
-@use 'agent-wizard' as *;
-
-@include wizard-chrome;
diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard.component.ts b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard.component.ts
index 6b74694329..2a95ed1705 100644
--- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard.component.ts
+++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard.component.ts
@@ -47,7 +47,6 @@ export { isAgentAppUpgradeResult } from '@home/pages/agent/wizard/agent-app-wiza
@Component({
selector: 'tb-agent-app-install-wizard',
templateUrl: './agent-app-install-wizard.component.html',
- styleUrls: ['./agent-app-install-wizard.component.scss'],
standalone: false,
providers: [AgentAppWizardLoaderService, AgentAppWizardSubmitService]
})
diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.html b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.html
index 46c50b18b7..6f42c808d0 100644
--- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.html
+++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.html
@@ -5,36 +5,28 @@
-->
@if (!embedded) {
-
+
@if (showBack) {
-
}
-
-
+
-
+
agent.app-install-name
@@ -124,13 +116,6 @@
agent.app-update-compare-hint
}
-
-
@@ -171,18 +156,33 @@
info_outline
agent.app-install-confirm-info
-
-
+
+
+ @if (selectedIndex > 0) {
+ {{ 'action.back' | translate }}
+ }
+
+ @if (selectedIndex === 0) {
+ {{ 'action.next-with-label' | translate: { label: ('agent.app-install-step4' | translate) } }}
+ }
+
+
+
+ {{ 'action.cancel' | translate }}
+ {{ 'agent.app-update-cta' | translate }}
+
+
diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.scss b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.scss
index 29da806e40..a5d3ab398a 100644
--- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.scss
+++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.scss
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: BUSL-1.1
@use 'agent-wizard' as *;
-@include wizard-chrome;
+@include wizard-stepper-dialog(1280px);
@include wizard-step-basics;
@include wizard-config-section;
@include wizard-diff;
diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.ts b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.ts
index 83dc7275e8..481316fb06 100644
--- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.ts
+++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.ts
@@ -23,10 +23,7 @@ import { buildStepInputs, createStepBinding, StepBinding } from '@home/pages/age
import { buildUpdateApplication } from '@home/pages/agent/util/agent-app-payloads';
import { buildUpdateMergeDraft } from '@home/pages/agent/util/agent-app-compose-preview';
import { composeTemplateKeys, composeTypeLabelKey, dumpCompose, pickComposeType } from '@home/pages/agent/util/agent-compose-yaml';
-import {
- AgentAppProfileWizardComponent,
- AgentAppProfileWizardData
-} from '@home/pages/agent/wizard/agent-app-profile-wizard.component';
+import { openAgentAppProfileWizard } from '@home/pages/agent/wizard/agent-app-profile-wizard-dialog';
import { AgentAppWizardLoaderService } from '@home/pages/agent/wizard/agent-app-wizard-loader.service';
import { AgentAppWizardSubmitService } from '@home/pages/agent/wizard/agent-app-wizard-submit.service';
import { AgentAppUpgradeResult, AgentAppWizardFinish } from '@home/pages/agent/wizard/agent-app-wizard.models';
@@ -52,6 +49,8 @@ export class AgentAppUpdateFlowComponent extends PageComponent implements OnInit
@Output() cancelled = new EventEmitter();
@Output() back = new EventEmitter();
+ selectedIndex = 0;
+
bindings: StepBinding[] = [];
proposedYaml = '';
@@ -237,12 +236,7 @@ export class AgentAppUpdateFlowComponent extends PageComponent implements OnInit
openEditProfile() {
if (!this.profileForCompare) { return; }
- this.dialog.open(
- AgentAppProfileWizardComponent, {
- disableClose: true,
- panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-agent-wizard-dialog'],
- data: { profile: this.profileForCompare }
- }).afterClosed().subscribe(saved => {
+ openAgentAppProfileWizard(this.dialog, { profile: this.profileForCompare }).subscribe(saved => {
if (saved) {
this.profileForCompare = saved;
this.refreshFutureCompare();
diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.html b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.html
index aba02480fa..bf7cfeb2e2 100644
--- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.html
+++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.html
@@ -5,30 +5,21 @@
-->
@if (!embedded) {
-
+
@if (showBack) {
-
- arrow_back
+
+ arrow_back
}
-
-
{{ 'agent.app-upgrade-title' | translate }}@if (existingApplication) {
- :
- }
- @if (existingApplication) {
-
- {{ 'agent.app-upgrade-heading' | translate: { name: existingApplication?.name, from: fromVersion || '—', to: toVersion || '—' } }}
-
- }
-
+ {{ 'agent.app-upgrade-title' | translate }}@if (existingApplication) {: {{ 'agent.app-upgrade-heading' | translate: { name: existingApplication?.name, from: fromVersion || '—', to: toVersion || '—' } }}}
+
-
- close
+
+ close
}
-
-
+
@if (loadingTemplate || loadingProfile) {
@@ -45,143 +36,154 @@
@if (!(loadingTemplate || loadingProfile || loadError)) {
- @if (showProfileUpgradeStep) {
-
- @if (loadingProfile) {
-
-
- agent.app-upgrade-profile-loading
-
+ @for (step of steps; track step) {
+ @switch (step) {
+ @case ('profile') {
+
+ @if (loadingProfile) {
+
+
+ agent.app-upgrade-profile-loading
+
+ }
+ @if (!loadingProfile && profileLoadError) {
+
+ error_outline
+ {{ profileLoadError }}
+
+ }
+ @if (!loadingProfile && !profileLoadError && profile && template) {
+
+
+ agent.app-upgrade-profile-name
+ {{ profile.name }}
+
+
+ agent.app-upgrade-summary-versions
+ {{ fromVersion || '—' }} → {{ toVersion || '—' }}
+
+
+ agent.app-upgrade-profile-hint
+
+
+ agent.app-upgrade-diff-hint
+ }
+
}
- @if (!loadingProfile && profileLoadError) {
-
- error_outline
- {{ profileLoadError }}
-
+ @case ('config') {
+
+ @if (canHaveRelatedEntity && isProfileBoundUpgrade) {
+
+
+ }
+
+ @if (!isProfileBoundUpgrade) {
+
+
+ agent.app-upgrade-diff-hint
+ }
+
}
- @if (!loadingProfile && !profileLoadError && profile && template) {
-
-
- agent.app-upgrade-profile-name
- {{ profile.name }}
-
-
-
agent.app-upgrade-summary-versions
-
{{ fromVersion || '—' }} → {{ toVersion || '—' }}
+ @case ('summary') {
+
+
+