Browse Source

feat(iot-hub): show resolution labels in provisioning step

Track which resolution was used per entity step (created, use-existing,
overwrite, create-copy). Store in installState for review mode.

Provisioning step now shows green resolution label on the right:
"Created", "Used existing", "Overwritten", or "Created copy".

Visible in both live install and read-only review dialog.
pull/15508/head
Andrii Shvaika 6 months ago
parent
commit
7e2a644e15
  1. 3
      ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.html
  2. 8
      ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.scss
  3. 8
      ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.ts
  4. 1
      ui-ngx/src/app/shared/models/iot-hub/device-package.models.ts
  5. 4
      ui-ngx/src/assets/locale/locale.constant-en_US.json

3
ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.html

@ -194,6 +194,9 @@
<span class="tb-progress-conflict-msg">{{ 'iot-hub.device-install-conflict-exists' | translate:{ type: ('iot-hub.device-install-step-type-' + ep.step.type | translate) } }}</span>
}
</div>
@if (ep.status === 'success' && ep.resolution) {
<span class="tb-progress-resolution">{{ 'iot-hub.device-install-resolution-' + ep.resolution | translate }}</span>
}
@if (ep.status === 'conflict') {
<div class="tb-progress-conflict-actions">
@if (ep.conflictType === 'use-or-overwrite') {

8
ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.scss

@ -286,6 +286,14 @@
color: #f57f17;
}
.tb-progress-resolution {
margin-left: auto;
flex-shrink: 0;
font-size: 13px;
color: #2e7d32;
font-weight: 500;
}
.tb-progress-conflict-actions {
display: flex;
gap: 8px;

8
ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.ts

@ -293,6 +293,7 @@ export class TbDeviceInstallDialogComponent extends DialogComponent<TbDeviceInst
ep.entityOutput = output;
ep.existingEntity = null;
ep.conflictType = null;
ep.resolution = resolution;
ep.status = 'success';
const alias = stepTypeAliasMap[ep.step.type];
@ -565,11 +566,13 @@ export class TbDeviceInstallDialogComponent extends DialogComponent<TbDeviceInst
ws.entitySteps = ws.rawSteps.map(s => {
const alias = stepTypeAliasMap[s.type];
const output = alias ? this.entityOutputs.get(alias) : null;
const storedState = this.data.installState?.[s.name] || this.data.installState?.[this.resolveVariables(s.name)];
return {
step: s,
status: 'success' as const,
resolvedName: this.resolveVariables(s.name),
entityOutput: output || undefined
entityOutput: output || undefined,
resolution: storedState?.resolution || 'created'
};
});
ws.progressDone = true;
@ -615,6 +618,7 @@ export class TbDeviceInstallDialogComponent extends DialogComponent<TbDeviceInst
await this.delay(ENTITY_STEP_MIN_DELAY - elapsed);
}
ep.entityOutput = output;
ep.resolution = 'created';
ep.status = 'success';
const alias = stepTypeAliasMap[ep.step.type];
@ -912,7 +916,7 @@ export class TbDeviceInstallDialogComponent extends DialogComponent<TbDeviceInst
} else if (ws.type === 'progress' && ws.entitySteps) {
for (const ep of ws.entitySteps) {
if (ep.status === 'success' && ep.entityOutput) {
state[ep.step.name] = { entityOutput: ep.entityOutput };
state[ep.step.name] = { entityOutput: ep.entityOutput, resolution: ep.resolution || 'created' };
}
}
}

1
ui-ngx/src/app/shared/models/iot-hub/device-package.models.ts

@ -147,4 +147,5 @@ export interface EntityStepProgress {
errorMessage?: string;
existingEntity?: EntityStepOutput;
conflictType?: ConflictType;
resolution?: string;
}

4
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -3899,6 +3899,10 @@
"device-install-use-existing": "Use existing",
"device-install-overwrite": "Overwrite",
"device-install-create-copy": "Create copy",
"device-install-resolution-created": "Created",
"device-install-resolution-use-existing": "Used existing",
"device-install-resolution-overwrite": "Overwritten",
"device-install-resolution-create-copy": "Created copy",
"device-install-gateway-docker-compose": "Download docker-compose.yml for your gateway",
"device-install-title": "Install \"{{name}}\"",
"device-install-complete-title": "Install \"{{name}}\" — Complete",

Loading…
Cancel
Save