context-dashboard/dashboard-settings/typed-dashboard-settings.component.ts
ControlValueAccessor
OnInit
| providers |
)
|
| selector | c8y-typed-dashboard-settings |
| standalone | true |
| imports |
C8yTranslatePipe
CoreModule
TypeDashboardInfoComponent
ProductExperienceDirective
|
| templateUrl | ./typed-dashboard-settings.component.html |
Properties |
Methods |
|
Inputs |
Outputs |
constructor(inventory: InventoryService, interAppService: InterAppService, route: ActivatedRoute)
|
||||||||||||
|
Parameters :
|
| allowTypeDashboard |
Type : AllowTypeDashboard
|
| deviceTypeValue |
Type : string
|
| displayDeviceTypeValue |
Type : string
|
| formInvalid |
Type : boolean
|
| isDevice |
Type : boolean
|
| mo |
Type : ContextDashboardManagedObject
|
| onDuplicateWithoutType |
Type : EventEmitter
|
| Async goToDeviceView |
goToDeviceView()
|
|
Returns :
Promise<void>
|
| markAsTouched |
markAsTouched()
|
|
Returns :
void
|
| Async ngOnInit |
ngOnInit()
|
|
Returns :
any
|
| registerOnChange | ||||||
registerOnChange(fn: any)
|
||||||
|
Parameters :
Returns :
void
|
| registerOnTouched | ||||||
registerOnTouched(onTouched: any)
|
||||||
|
Parameters :
Returns :
void
|
| setDisabledState | ||||||
setDisabledState(disabled: boolean)
|
||||||
|
Parameters :
Returns :
void
|
| Async toggle |
toggle()
|
|
Returns :
Promise<void>
|
| writeValue | ||||||
writeValue(value: boolean)
|
||||||
|
Parameters :
Returns :
void
|
| context |
Type : any
|
| deviceManagementAppKey |
Type : SupportedAppKey
|
Default value : SupportedApps.devicemanagement
|
| deviceManagementLinkTitle |
Type : unknown
|
Default value : gettext('Device Info page in {{ deviceManagementAppName }}')
|
| deviceTypeInstancesCount |
Type : number
|
| disabled |
Type : unknown
|
Default value : false
|
| infoText |
Type : string
|
| onChange |
Type : unknown
|
Default value : () => {...}
|
| onTouched |
Type : unknown
|
Default value : () => {...}
|
| PRODUCT_EXPERIENCE |
Type : unknown
|
Default value : PRODUCT_EXPERIENCE
|
| showSourceNavigationLink$ |
Type : Observable<boolean>
|
| touched |
Type : unknown
|
Default value : false
|
| typedDashboardStatus |
Type : string
|
| userDeviceManagementApp$ |
Type : Observable<IApplication>
|
| value |
Type : boolean
|
<fieldset class="c8y-fieldset c8y-fieldset--lg">
<legend>{{ 'Dashboard template' | translate }}</legend>
<div class="d-flex p-b-16 gap-16">
<label class="c8y-switch flex-no-shrink">
<input
type="checkbox"
[checked]="value"
[disabled]="disabled"
(click)="toggle()"
/>
<span></span>
<span>{{ typedDashboardStatus | translate }}</span>
</label>
<div class="flex-grow d-flex d-col">
<div
class="flex-grow"
[innerHtml]="infoText | translate: { displayDeviceTypeValue: displayDeviceTypeValue }"
></div>
<button
class="btn-link p-0 m-r-auto"
type="button"
*ngIf="allowTypeDashboard === 'allow_if_type_filled' && showSourceNavigationLink$ | async"
(click)="goToDeviceView()"
>
{{
deviceManagementLinkTitle
| translate
: {
deviceManagementAppName:
userDeviceManagementApp$ | async | humanizeAppName | async
}
}}
<i c8yIcon="external-link"></i>
</button>
</div>
</div>
<c8y-type-dashboard-info
*ngIf="allowTypeDashboard === 'allow'"
[context]="mo"
[deviceTypeValue]="deviceTypeValue"
[displayDeviceTypeValue]="displayDeviceTypeValue"
></c8y-type-dashboard-info>
<div
class="p-t-8 p-b-16"
*ngIf="mo?.c8y_Dashboard && value"
>
<button
class="btn btn-default btn-sm"
type="button"
c8yProductExperience
[actionName]="PRODUCT_EXPERIENCE.DASHBOARD.EVENTS.DASHBOARD_TEMPLATE"
[actionData]="{
component: PRODUCT_EXPERIENCE.DASHBOARD.COMPONENTS.TYPED_DASHBOARD_SETTINGS,
action: PRODUCT_EXPERIENCE.DASHBOARD.ACTIONS.DUPLICATE_AS_REGULAR_DASHBOARD
}"
(click)="onDuplicateWithoutType.emit()"
[disabled]="formInvalid"
>
{{ 'Duplicate as regular dashboard' | translate }}
</button>
</div>
</fieldset>