register-device/extensible/single/extensible-device-registration-stepper.component.ts
OnInit
| selector | c8y-extensible-device-registration-stepper |
| imports |
C8yStepper
NgFor
CdkStep
FormGroupComponent
FormlyModule
NgIf
C8yStepperButtons
OperationResultComponent
C8yTranslatePipe
|
| templateUrl | extensible-device-registration-stepper.component.html |
Properties |
Methods |
Inputs |
constructor(customProviderService: ExtensibleDeviceRegistrationService, registerDeviceService: RegisterDeviceService, bsModalRef: BsModalRef, gainsightService: GainsightService)
|
|||||||||||||||
|
Parameters :
|
| contextPath |
Type : string
|
| labels |
Type : string[]
|
| steps |
Type : FormlyFieldConfig[][]
|
| close |
close()
|
|
Returns :
void
|
| complete |
complete()
|
|
Returns :
void
|
| finalStepStatus |
finalStepStatus()
|
|
Returns :
any
|
| goToFirstStep |
goToFirstStep()
|
|
Returns :
void
|
| isRegistrationStep |
isRegistrationStep()
|
|
Returns :
boolean
|
| ngOnInit |
ngOnInit()
|
|
Returns :
void
|
| Async save |
save()
|
|
Returns :
any
|
| errorMessage |
Type : string
|
| forms |
Type : FormGroup[]
|
Default value : []
|
| message |
Type : string
|
| model |
Type : any
|
Default value : {}
|
| pendingStatus |
Type : unknown
|
Default value : false
|
| stepper |
Type : C8yStepper
|
Decorators :
@ViewChild(C8yStepper, {static: true})
|
<c8y-stepper
[disableProgressButtons]="true"
[disableDefaultIcons]="{ edit: true, done: false }"
[customClasses]="['m-40', 'm-t-8', 'm-b-16']"
>
<cdk-step *ngFor="let step of steps; let i = index" [stepControl]="forms[i]" [label]="labels[i]">
<c8y-form-group class="form-group p-24 p-b-0 p-t-16">
<formly-form [form]="forms[i]" [fields]="step" [model]="model"></formly-form>
</c8y-form-group>
<c8y-stepper-buttons
class="sticky-bottom d-block modal-footer separator-top bg-component"
*ngIf="isRegistrationStep()"
[showButtons]="{ cancel: true, back: true, next: true }"
[labels]="{ next: 'Register' }"
(onCancel)="close()"
(onNext)="save()"
[pending]="pendingStatus"
[disabled]="forms[i].invalid"
></c8y-stepper-buttons>
<c8y-stepper-buttons
class="sticky-bottom d-block modal-footer separator-top bg-component"
*ngIf="!isRegistrationStep()"
[showButtons]="{ cancel: true, back: i !== 0, next: true }"
[disabled]="forms[i].invalid"
(onCancel)="close()"
></c8y-stepper-buttons>
</cdk-step>
<cdk-step [state]="finalStepStatus()" label="{{ 'Summary' | translate }}">
<c8y-operation-result
*ngIf="!errorMessage; else errorInfo"
text="{{ message | translate }}"
[size]="84"
[vertical]="true"
type="success"
class="lead"
data-cy="success"
></c8y-operation-result>
<ng-template #errorInfo>
<c8y-operation-result
text="{{ errorMessage | translate }}"
[size]="84"
[vertical]="true"
type="error"
class="lead"
data-cy="error"
></c8y-operation-result>
</ng-template>
<c8y-stepper-buttons
class="sticky-bottom d-block modal-footer separator-top bg-component"
[showButtons]="{ cancel: errorMessage, back: errorMessage, next: !errorMessage }"
[labels]="{ back: 'Fix issue', next: 'Close' }"
(onCancel)="close()"
(onNext)="complete()"
(onBack)="goToFirstStep()"
></c8y-stepper-buttons>
</cdk-step>
</c8y-stepper>