@c8y/sample-plugin 1022.9.6 → 1022.13.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/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@c8y/sample-plugin",
3
- "version": "1022.9.6",
3
+ "version": "1022.13.0",
4
4
  "description": "",
5
5
  "dependencies": {
6
- "@c8y/style": "1022.9.6",
7
- "@c8y/ngx-components": "1022.9.6",
8
- "@c8y/client": "1022.9.6",
9
- "@c8y/bootstrap": "1022.9.6",
6
+ "@c8y/style": "1022.13.0",
7
+ "@c8y/ngx-components": "1022.13.0",
8
+ "@c8y/client": "1022.13.0",
9
+ "@c8y/bootstrap": "1022.13.0",
10
10
  "@angular/cdk": "^19.2.18",
11
11
  "ngx-bootstrap": "19.0.2",
12
12
  "rxjs": "7.8.1"
13
13
  },
14
14
  "devDependencies": {
15
- "@c8y/options": "1022.9.6",
16
- "@c8y/devkit": "1022.9.6"
15
+ "@c8y/options": "1022.13.0",
16
+ "@c8y/devkit": "1022.13.0"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "@angular/common": ">=19 <20"
@@ -1,9 +1,9 @@
1
1
  import { CommonModule } from '@angular/common';
2
- import { Component } from '@angular/core';
2
+ import { Component, OnInit } from '@angular/core';
3
3
  import { HeaderModule, IconDirective, ListDisplaySwitchModule } from '@c8y/ngx-components';
4
4
  import { CODEX_HOOK_LINKS } from '../sample-plugin.model';
5
5
 
6
- interface HookCards {
6
+ interface HookCard {
7
7
  name: string;
8
8
  description: string;
9
9
  url: string;
@@ -15,96 +15,117 @@ interface HookCards {
15
15
  standalone: true,
16
16
  imports: [CommonModule, HeaderModule, IconDirective, ListDisplaySwitchModule]
17
17
  })
18
- export class SampleViewComponent {
18
+ export class SampleViewComponent implements OnInit {
19
19
  readonly CODEX_HOOK_LINKS = CODEX_HOOK_LINKS;
20
- cards: HookCards[] = [];
20
+ readonly BASE_URL =
21
+ 'https://styleguide.cumulocity.com/apps/codex/#/development-guides/extending-the-platform/hooks/';
22
+ readonly OVERVIEW_SUFFIX = '/overview';
23
+ cards: HookCard[] = [];
21
24
  listClass = '';
22
25
 
23
- constructor() {
24
- this.cards = this.getHookCards();
26
+ ngOnInit(): void {
27
+ this.initializeHookCards();
25
28
  }
26
29
 
27
- private getHookCards(): HookCards[] {
30
+ private initializeHookCards(): void {
31
+ this.cards = this.getSortedHookCards();
32
+ }
33
+
34
+ private getSortedHookCards(): HookCard[] {
35
+ return this.getHookCardsData().sort((a, b) => a.name.localeCompare(b.name));
36
+ }
37
+
38
+ private getHookCardsData(): HookCard[] {
28
39
  return [
29
40
  {
30
- name: 'hookActionBar',
41
+ name: 'hookAction',
31
42
  description:
32
- 'The action bar offers a user-friendly interface to efficiently navigate and manage records. ',
33
- url: 'https://styleguide.cumulocity.com/apps/codex/#/develop/hooks/action-bar/overview'
43
+ 'This hook adds a global action to the page header, which is displayed or enabled under certain conditions via `c8y-action-outlet`.',
44
+ url: `${this.BASE_URL}action-hook${this.OVERVIEW_SUFFIX}`
34
45
  },
35
46
  {
36
- name: 'hookAction',
47
+ name: 'hookActionBar',
37
48
  description:
38
- 'This hook adds a global action to the page header, which is displayed or enabled under certain conditions via `c8y-action-outlet`.',
39
- url: 'https://styleguide.cumulocity.com/apps/codex/#/develop/hooks/action/overview'
49
+ 'The action bar offers a user-friendly interface to efficiently navigate and manage records. ',
50
+ url: `${this.BASE_URL}action-bar-hook${this.OVERVIEW_SUFFIX}`
40
51
  },
41
52
  {
42
53
  name: 'hookBreadcrumb',
43
54
  description: 'This hook shows the navigation breadcrumbs in the header bar.',
44
- url: 'https://styleguide.cumulocity.com/apps/codex/#/develop/hooks/breadcrumbs/overview'
55
+ url: `${this.BASE_URL}breadcrumbs-hook${this.OVERVIEW_SUFFIX}`
45
56
  },
46
57
  {
47
58
  name: 'hookComponent',
48
59
  description: 'This hook adds dynamic components, for example, widgets, to the UI.',
49
- url: 'https://styleguide.cumulocity.com/apps/codex/#/develop/hooks/dynamic-component/overview'
60
+ url: `${this.BASE_URL}component-hook${this.OVERVIEW_SUFFIX}`
61
+ },
62
+ {
63
+ name: 'hookDocs',
64
+ description:
65
+ 'The hook allows you to add links to documentation, help & support, and predefined links in the quick links widget.',
66
+ url: `${this.BASE_URL}docs-hook${this.OVERVIEW_SUFFIX}`
50
67
  },
51
68
  {
52
69
  name: 'hookDrawer',
53
70
  description: 'This hook adds a component to left or right drawer.',
54
- url: 'https://styleguide.cumulocity.com/apps/codex/#/develop/hooks/drawer/overview'
71
+ url: `${this.BASE_URL}drawer-hook${this.OVERVIEW_SUFFIX}`
55
72
  },
56
73
  {
57
74
  name: 'hookNavigator',
58
75
  description: 'This hook allows for the registration and display of navigator nodes.',
59
- url: 'https://styleguide.cumulocity.com/apps/codex/#/develop/hooks/navigator-route/overview'
76
+ url: `${this.BASE_URL}navigator-route-hooks${this.OVERVIEW_SUFFIX}`
77
+ },
78
+ {
79
+ name: 'hookPreview',
80
+ description: 'This hook adds preview features which can be toggled for public preview.',
81
+ url: `${this.BASE_URL}preview-features-hook${this.OVERVIEW_SUFFIX}`
60
82
  },
61
83
  {
62
84
  name: 'hookRoute',
63
85
  description: 'A hook used to add new routes.',
64
- url: 'https://styleguide.cumulocity.com/apps/codex/#/develop/hooks/navigator-route/overview'
86
+ url: `${this.BASE_URL}navigator-route-hooks${this.OVERVIEW_SUFFIX}`
65
87
  },
66
88
  {
67
89
  name: 'hookService',
68
90
  description: 'This hook adds services that can be shared between plugins and host app.',
69
- url: 'https://styleguide.cumulocity.com/apps/codex/#/develop/hooks/service/overview'
91
+ url: `${this.BASE_URL}service-hook${this.OVERVIEW_SUFFIX}`
70
92
  },
71
93
  {
72
94
  name: 'hookStepper',
73
95
  description: 'This hook adds a step into an existing stepper.',
74
- url: 'https://styleguide.cumulocity.com/apps/codex/#/develop/hooks/stepper/overview'
96
+ url: `${this.BASE_URL}stepper-hook${this.OVERVIEW_SUFFIX}`
75
97
  },
76
98
  {
77
99
  name: 'hookTab',
78
100
  description: 'This hook allows you to show tabs on certain conditions.',
79
- url: 'https://styleguide.cumulocity.com/apps/codex/#/develop/hooks/tabs/overview'
101
+ url: `${this.BASE_URL}tabs-hook${this.OVERVIEW_SUFFIX}`
80
102
  },
81
103
  {
82
104
  name: 'hookUserMenu',
83
105
  description: 'Add user menu to the right drawer.',
84
- url: 'https://styleguide.cumulocity.com/apps/codex/#/develop/hooks/user-menu/overview'
106
+ url: `${this.BASE_URL}user-menu-hook${this.OVERVIEW_SUFFIX}`
85
107
  },
86
108
  {
87
109
  name: 'hookVersion',
88
110
  description: 'Add versions to the right drawer.',
89
- url: 'https://styleguide.cumulocity.com/apps/codex/#/develop/hooks/versions/overview'
111
+ url: `${this.BASE_URL}versions-hook${this.OVERVIEW_SUFFIX}`
90
112
  },
91
113
  {
92
114
  name: 'hookWidget',
93
115
  description: 'This hook adds widgets to the UI.',
94
- url: 'https://styleguide.cumulocity.com/apps/codex/#/develop/hooks/dynamic-widget-component/overview'
116
+ url: `${this.BASE_URL}widget-hook${this.OVERVIEW_SUFFIX}`
117
+ },
118
+ {
119
+ name: 'hookWidgetConfig',
120
+ description:
121
+ 'This hook adds sections to the widget configuration view, like: "Time context".',
122
+ url: `${this.BASE_URL}widget-config-hook${this.OVERVIEW_SUFFIX}`
95
123
  },
96
124
  {
97
125
  name: 'hookWizard',
98
126
  description: 'This hook adds an entry into an existing wizard.',
99
- url: 'https://styleguide.cumulocity.com/apps/codex/#/develop/hooks/wizard/overview'
127
+ url: `${this.BASE_URL}wizard-hook${this.OVERVIEW_SUFFIX}`
100
128
  }
101
- // TODO: Uncomment when the codex entry is available
102
- // {
103
- // name: 'hookWidgetConfig',
104
- // description:
105
- // 'This hook adds sections to the widget configuration view, like: "Time context".',
106
- // url: 'https://styleguide.cumulocity.com/apps/codex/#/develop/hooks/widget-config/overview'
107
- // }
108
129
  ];
109
130
  }
110
131
  }