@c8y/tutorial 1023.26.1 → 1023.28.5

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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@c8y/tutorial",
3
- "version": "1023.26.1",
3
+ "version": "1023.28.5",
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": "1023.26.1",
7
- "@c8y/ngx-components": "1023.26.1",
8
- "@c8y/client": "1023.26.1",
9
- "@c8y/bootstrap": "1023.26.1",
6
+ "@c8y/style": "1023.28.5",
7
+ "@c8y/ngx-components": "1023.28.5",
8
+ "@c8y/client": "1023.28.5",
9
+ "@c8y/bootstrap": "1023.28.5",
10
10
  "@angular/cdk": "^20.2.14",
11
11
  "monaco-editor": "~0.53.0",
12
12
  "ngx-bootstrap": "20.0.2",
@@ -14,8 +14,8 @@
14
14
  "rxjs": "7.8.2"
15
15
  },
16
16
  "devDependencies": {
17
- "@c8y/options": "1023.26.1",
18
- "@c8y/devkit": "1023.26.1"
17
+ "@c8y/options": "1023.28.5",
18
+ "@c8y/devkit": "1023.28.5"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "@angular/common": ">=20 <21"
@@ -147,6 +147,110 @@ export class InventoryInterceptor implements HttpInterceptor {
147
147
  }),
148
148
  language: () => ({
149
149
  managedObjects: [generateUserPreferences()]
150
+ }),
151
+ c8y_JsonSchema: () => ({
152
+ managedObjects: [
153
+ {
154
+ id: '100001',
155
+ type: 'c8y_JsonSchema',
156
+ name: 'Temperature Sensor Configuration',
157
+ lastUpdated: new Date().toISOString(),
158
+ creationTime: new Date().toISOString(),
159
+ owner: 'admin',
160
+ c8y_Global: {},
161
+ c8y_JsonSchema: {
162
+ type: 'object',
163
+ properties: {
164
+ temperatureThreshold: {
165
+ type: 'number',
166
+ title: 'Temperature Threshold',
167
+ minimum: -50,
168
+ maximum: 150,
169
+ default: 25,
170
+ required: true
171
+ },
172
+ unit: {
173
+ type: 'string',
174
+ title: 'Temperature Unit',
175
+ enum: ['Celsius', 'Fahrenheit'],
176
+ default: 'Celsius'
177
+ }
178
+ }
179
+ },
180
+ appliesTo: {
181
+ MANAGED_OBJECTS: true
182
+ }
183
+ },
184
+ {
185
+ id: '100002',
186
+ type: 'c8y_JsonSchema',
187
+ name: 'Device Metadata',
188
+ lastUpdated: new Date().toISOString(),
189
+ creationTime: new Date().toISOString(),
190
+ owner: 'admin',
191
+ c8y_Global: {},
192
+ c8y_JsonSchema: {
193
+ type: 'object',
194
+ properties: {
195
+ deviceName: {
196
+ type: 'string',
197
+ title: 'Device Name',
198
+ minLength: 3,
199
+ maxLength: 50,
200
+ required: true
201
+ },
202
+ isActive: {
203
+ type: 'boolean',
204
+ title: 'Device Active',
205
+ default: true
206
+ },
207
+ lastMaintenance: {
208
+ type: 'string',
209
+ format: 'datetime',
210
+ title: 'Last Maintenance Date'
211
+ }
212
+ }
213
+ },
214
+ appliesTo: {
215
+ MANAGED_OBJECTS: true
216
+ }
217
+ },
218
+ {
219
+ id: '100003',
220
+ type: 'c8y_JsonSchema',
221
+ name: 'Alert Configuration',
222
+ lastUpdated: new Date().toISOString(),
223
+ creationTime: new Date().toISOString(),
224
+ owner: 'admin',
225
+ c8y_Global: {},
226
+ c8y_JsonSchema: {
227
+ type: 'object',
228
+ properties: {
229
+ alertPriority: {
230
+ type: 'integer',
231
+ title: 'Alert Priority',
232
+ minimum: 1,
233
+ maximum: 5,
234
+ default: 3
235
+ },
236
+ enableNotifications: {
237
+ type: 'boolean',
238
+ title: 'Enable Email Notifications',
239
+ default: false
240
+ }
241
+ }
242
+ },
243
+ appliesTo: {
244
+ MANAGED_OBJECTS: true
245
+ }
246
+ }
247
+ ],
248
+ statistics: {
249
+ totalPages: 1,
250
+ pageSize: 20,
251
+ currentPage: 1,
252
+ totalElements: 3
253
+ }
150
254
  })
151
255
  };
152
256
  }
@@ -1,6 +1,7 @@
1
1
  <c8y-title>Data grid examples</c8y-title>
2
2
 
3
3
  <c8y-data-grid
4
+ class="content-fullpage d-flex d-col border-top border-bottom"
4
5
  [title]="title"
5
6
  [columns]="columns"
6
7
  [rows]="data"
@@ -9,9 +10,9 @@
9
10
  (itemsSelect)="onItemsSelect($event)"
10
11
  [actionControls]="actionControls"
11
12
  [bulkActionControls]="bulkActionControls"
13
+ [loading]="loading"
12
14
  (onConfigChange)="onConfigChange($event)"
13
15
  (onFilter)="onFilter($event)"
14
16
  (onAddCustomColumn)="onAddCustomColumn($event)"
15
17
  (onRemoveCustomColumn)="onRemoveCustomColumn($event)"
16
- class="content-fullpage d-flex d-col border-top border-bottom"
17
18
  ></c8y-data-grid>
@@ -107,10 +107,16 @@ export class ClientGridExampleComponent implements OnInit {
107
107
  ];
108
108
  /** Static data to display. */
109
109
  data: any[];
110
+ /** Indicates whether the grid is in loading state. */
111
+ loading = true;
110
112
 
111
113
  ngOnInit() {
112
114
  // load static data from another file, could be loaded from anywhere
113
- this.data = getData();
115
+ // simulating loading delay with setTimeout
116
+ setTimeout(() => {
117
+ this.data = getData();
118
+ this.loading = false;
119
+ }, 5_000);
114
120
  }
115
121
 
116
122
  /** Executes an edit action on the selected item. */
@@ -1,4 +1,6 @@
1
1
  import { NavigatorNode, hookNavigator, hookRoute } from '@c8y/ngx-components';
2
+ import { hookComputedProperty } from '@c8y/ngx-components/asset-properties';
3
+ import { alarmCountLastWeek } from '../properties-selector-computed-properties/alarm-count-last-week-computed-property';
2
4
 
3
5
  export const propertiesSelectorInlineExampleProviders = [
4
6
  hookRoute({
@@ -15,5 +17,6 @@ export const propertiesSelectorInlineExampleProviders = [
15
17
  icon: 'th-list',
16
18
  priority: 4
17
19
  })
18
- )
20
+ ),
21
+ hookComputedProperty([alarmCountLastWeek])
19
22
  ];