@c8y/tutorial 1020.4.1 → 1020.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cumulocity.config.ts
CHANGED
|
@@ -618,6 +618,13 @@ export default {
|
|
|
618
618
|
description: 'An introduction to datapoint without templates example.',
|
|
619
619
|
scope: 'self'
|
|
620
620
|
},
|
|
621
|
+
{
|
|
622
|
+
name: 'Introduction to alarm event selector',
|
|
623
|
+
module: 'AlarmEventSlectorExampleModule',
|
|
624
|
+
path: './src/selector/alarm-event-selector-example/alarm-event-selector.module.ts',
|
|
625
|
+
description: 'An introduction to alarm event selector example.',
|
|
626
|
+
scope: 'self'
|
|
627
|
+
},
|
|
621
628
|
{
|
|
622
629
|
name: 'Introduction to asset selector device child',
|
|
623
630
|
module: 'AssetSingleSelectModule',
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c8y/tutorial",
|
|
3
|
-
"version": "1020.
|
|
3
|
+
"version": "1020.5.0",
|
|
4
4
|
"description": "This package is used to scaffold a tutorial for Cumulocity IoT Web SDK which explains a lot of concepts.",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@c8y/style": "1020.
|
|
7
|
-
"@c8y/ngx-components": "1020.
|
|
8
|
-
"@c8y/client": "1020.
|
|
9
|
-
"@c8y/bootstrap": "1020.
|
|
6
|
+
"@c8y/style": "1020.5.0",
|
|
7
|
+
"@c8y/ngx-components": "1020.5.0",
|
|
8
|
+
"@c8y/client": "1020.5.0",
|
|
9
|
+
"@c8y/bootstrap": "1020.5.0",
|
|
10
10
|
"@angular/cdk": "^17.3.9",
|
|
11
11
|
"ngx-bootstrap": "12.0.0",
|
|
12
12
|
"leaflet": "1.9.4",
|
|
13
13
|
"rxjs": "^7.4.0"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@c8y/options": "1020.
|
|
17
|
-
"@c8y/devkit": "1020.
|
|
16
|
+
"@c8y/options": "1020.5.0",
|
|
17
|
+
"@c8y/devkit": "1020.5.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@angular/common": ">=16 <18"
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
3
|
+
import { CommonModule, CoreModule } from '@c8y/ngx-components';
|
|
4
|
+
import { AlarmEventSelectorModule, AlarmOrEvent } from '@c8y/ngx-components/alarm-event-selector';
|
|
5
|
+
import { AlarmEventSelectorModalOptions } from '@c8y/ngx-components/alarm-event-selector/alarm-event-selector-modal/alarm-event-selector-modal.model';
|
|
6
|
+
import { AssetSelectorModule } from '@c8y/ngx-components/assets-navigator';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'app-widget',
|
|
10
|
+
template: `
|
|
11
|
+
<div class="row">
|
|
12
|
+
<div class="col-md-6">
|
|
13
|
+
<form [formGroup]="formGroup">
|
|
14
|
+
<c8y-alarm-event-selection-list
|
|
15
|
+
name="alarms"
|
|
16
|
+
[config]="config"
|
|
17
|
+
[timelineType]="'ALARM'"
|
|
18
|
+
formControlName="alarms"
|
|
19
|
+
>
|
|
20
|
+
</c8y-alarm-event-selection-list>
|
|
21
|
+
<c8y-alarm-event-selection-list
|
|
22
|
+
name="events"
|
|
23
|
+
[config]="config"
|
|
24
|
+
[timelineType]="'EVENT'"
|
|
25
|
+
formControlName="events"
|
|
26
|
+
>
|
|
27
|
+
</c8y-alarm-event-selection-list>
|
|
28
|
+
</form>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
`,
|
|
32
|
+
standalone: true,
|
|
33
|
+
imports: [CommonModule, AssetSelectorModule, CoreModule, AlarmEventSelectorModule]
|
|
34
|
+
})
|
|
35
|
+
export class AlarmEventSelectorExampleComponent {
|
|
36
|
+
selectedAlarmEvent: AlarmOrEvent;
|
|
37
|
+
formGroup: FormGroup;
|
|
38
|
+
@Input() config: Partial<AlarmEventSelectorModalOptions> = {};
|
|
39
|
+
|
|
40
|
+
constructor(private formBuilder: FormBuilder) {}
|
|
41
|
+
|
|
42
|
+
ngOnInit(): void {
|
|
43
|
+
this.initForm();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
initForm() {
|
|
47
|
+
this.formGroup = this.formBuilder.group({
|
|
48
|
+
alarms: [[]],
|
|
49
|
+
events: [[]]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
3
|
+
|
|
4
|
+
@NgModule({
|
|
5
|
+
providers: [
|
|
6
|
+
hookRoute({
|
|
7
|
+
path: 'selector/alarm-event-selector-example',
|
|
8
|
+
loadComponent: () =>
|
|
9
|
+
import('./alarm-event-selector.component').then(m => m.AlarmEventSelectorExampleComponent)
|
|
10
|
+
}),
|
|
11
|
+
hookNavigator(
|
|
12
|
+
new NavigatorNode({
|
|
13
|
+
label: 'alarm event selector example',
|
|
14
|
+
path: '/selector/alarm-event-selector-example',
|
|
15
|
+
icon: 'th-list',
|
|
16
|
+
priority: 15
|
|
17
|
+
})
|
|
18
|
+
)
|
|
19
|
+
]
|
|
20
|
+
})
|
|
21
|
+
export class AlarmEventSlectorExampleModule {}
|