@c8y/ng1-modules 1018.429.0 → 1018.431.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,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1018.429.0",
3
+ "version": "1018.431.0",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",
@@ -1,13 +0,0 @@
1
- {
2
- "name": "IMPACT mappings",
3
- "ngModules": [
4
- "c8y.impact"
5
- ],
6
- "js": [
7
- "impact.module.js",
8
- "impact.provider.js",
9
- "impact-create-step.component.js",
10
- "impact-detail.component.js",
11
- "impact-resource.component.js"
12
- ]
13
- }
@@ -1 +0,0 @@
1
- "use strict";!function(){function t(e){var n=this;function c(t){n.wizardCtrl.close({path:t})}function r(){n.pending=!1}_.assign(n,{model:{},create:function(t){return n.pending=!0,e.create(t).then(e.detailPath).then(c,r)}})}t.$inject=["c8yImpact"],angular.module("c8y.impact").component("c8yImpactCreateStep",{require:{wizardCtrl:"^c8yWizardStep"},templateUrl:":::PLUGIN_PATH:::/impact-create-step.html",controller:t,controllerAs:"vm"})}();
@@ -1,74 +0,0 @@
1
- <div class="modal-inner-scroll">
2
- <p
3
- class="text-medium text-center p-l-24 p-r-24 p-t-16 p-b-16 bg-component separator-bottom sticky-top"
4
- >
5
- {{ vm.wizardCtrl.data.selectedProtocol.name }}
6
- </p>
7
- <div class="c8y-wizard-body p-t-16">
8
- <form class="form" name="modelForm" novalidate>
9
- <div class="form-group">
10
- <label for="id" translate>ID</label>
11
- <input
12
- id="id"
13
- name="id"
14
- class="form-control"
15
- ng-model="vm.model.id"
16
- ng-maxlength="50"
17
- placeholder="{{ 'e.g.' | translate }} 25"
18
- required
19
- ng-disabled="vm.pending"
20
- />
21
- <c8y-error-feedback field="modelForm.id"></c8y-error-feedback>
22
- </div>
23
- <div class="form-group">
24
- <label for="name" translate>Name</label>
25
- <input
26
- id="name"
27
- name="name"
28
- class="form-control"
29
- ng-model="vm.model.name"
30
- ng-max="100"
31
- placeholder="{{ 'e.g. My Impact protocol' | translate }}"
32
- required
33
- ng-disabled="vm.pending"
34
- />
35
- <c8y-error-feedback field="modelForm.name"></c8y-error-feedback>
36
- </div>
37
- <div class="form-group">
38
- <label for="description" translate>Description</label>
39
- <textarea
40
- id="description"
41
- rows="7"
42
- class="form-control"
43
- ng-model="vm.model.description"
44
- ng-disabled="vm.pending"
45
- ></textarea>
46
- </div>
47
- </form>
48
- </div>
49
-
50
- <div class="c8y-wizard-footer bg-component sticky-bottom">
51
- <button
52
- title="{{ 'Back' | translate }}"
53
- class="btn btn-default"
54
- ng-click="vm.wizardCtrl.goToIndex(0)"
55
- >
56
- {{ 'Back' | translate }}
57
- </button>
58
- <button
59
- title="{{ 'Cancel' | translate }}"
60
- class="btn btn-default"
61
- ng-click="vm.wizardCtrl.dismiss()"
62
- >
63
- {{ 'Cancel' | translate }}
64
- </button>
65
- <button
66
- title="{{ 'Create' | translate }}"
67
- class="btn btn-primary"
68
- ng-click="vm.create(vm.model)"
69
- ng-disabled="modelForm.$invalid || vm.pending"
70
- >
71
- {{ 'Create' | translate }}
72
- </button>
73
- </div>
74
- </div>
@@ -1 +0,0 @@
1
- "use strict";!function(){function e(c,i){var r=this;function u(e){r.object=e,r.title=c.getName(e),o(),t()}function n(e){r.customActions=e}function t(){delete r.newResource}function e(){r.editingMain=!r.editingMain}function o(){r.objectMain=_.pick(_.clone(i.getMainProperties(r.object)),["id","name","description"]),r.mainPropertiesForm.$setPristine(),r.editingMain=!1}function s(){return i.getResources(r.object)}_.assign(r,{$onChanges:function(e){e.id&&(c.detail(r.id).then(u),c.getCustomActions().then(n))},addResource:function(){r.newResource={multiple:!1}},noResources:function(){return!r.newResource&&0===i.countResources(r.object)},cancelNewResourceMapping:t,saveResourceAndMapping:function(e,n,t){var o=_.cloneDeep(r.object);if(o=i.updateResource(e,t,o),o=i.updateMappingToResource(n,e,o),function(n,e){var t=s(r.object);if(i.isSameResource(n,e))return;return _.find(t,function(e){return e.id===n.id})}(e,t))return c.overwriteResourceConfirm(e).then(function(){return c.save(o)}).then(u);return c.save(o).then(u)},removeResource:function(e){var n=_.cloneDeep(r.object);return c.removeResourceConfirm(e).then(function(e){return i.removeResource(e,n)}).then(i.saveToInventory).then(u).then(c.alertRemoveResourceSuccess)},toggleMainEdit:e,saveMainProperties:function(){var e=_.cloneDeep(r.object);return e=i.updateMainProperties(r.objectMain,e),i.saveToInventory(e).then(u).then(c.alertUpdateProtocolSuccess)},cancelMainProperties:function(){e(),o()},getResources:s,getMappingForResource:function(e){return _.get(i.getMappings(r.object),e)},getMainObject:function(){return i.getMainObject(r.object)}})}e.$inject=["c8yImpact","c8yObjectMappings"],angular.module("c8y.impact").component("c8yImpactDetail",{bindings:{id:"<"},templateUrl:":::PLUGIN_PATH:::/impact-detail.html",controller:e,controllerAs:"vm"})}();
@@ -1,152 +0,0 @@
1
- <c8y-ui-title-set title="vm.title"></c8y-ui-title-set>
2
- <c8y-device-protocol-breadcrumb></c8y-device-protocol-breadcrumb>
3
-
4
- <div class="row">
5
- <div class="col-lg-12 col-lg-max">
6
- <div class="card card--fullpage">
7
- <div class="card-block bg-level-1 flex-no-shrink p-t-24 p-b-24">
8
- <div class="content-flex-70">
9
- <div class="text-center">
10
- <i class="c8y-icon-duocolor icon-48 c8y-icon c8y-icon-device-protocols"></i>
11
- <p ng-if="!vm.isNew()">
12
- <small class="label label-info">IMPACT</small>
13
- </p>
14
- </div>
15
- <div class="flex-grow col-10">
16
- <div class="content-flex-80">
17
- <div class="col-9">
18
- <form class="form" name="vm.mainPropertiesForm" novalidate>
19
- <div class="content-flex-80">
20
- <div class="col-9">
21
- <div class="form-group form-group-lg">
22
- <label class="sr-only" translate>Name</label>
23
- <label class="editable">
24
- <input
25
- name="name"
26
- class="form-control"
27
- ng-model="vm.objectMain.name"
28
- placeholder="{{ 'e.g. My Impact protocol' | translate }}"
29
- required
30
- style="max-width:calc( {{
31
- vm.objectMain.name.length || 25
32
- }} * 1ch + 14px)"
33
- ng-max="200"
34
- />
35
- </label>
36
- <c8y-error-feedback field="vm.mainPropertiesForm.name"></c8y-error-feedback>
37
- </div>
38
- </div>
39
- <div class="flex-grow">
40
- <div class="form-group d-flex a-i-center">
41
- <label class="m-b-0 m-r-8" translate>ID</label>
42
- <span class="flex-grow">
43
- <label class="editable">
44
- <input
45
- name="id"
46
- class="form-control"
47
- ng-model="vm.objectMain.id"
48
- placeholder="{{ 'e.g.' | translate }} 25"
49
- required
50
- style="max-width:calc( {{
51
- vm.objectMain.id.length || 16
52
- }} * 1ch + 14px)"
53
- ng-max="100"
54
- />
55
- </label>
56
- <c8y-error-feedback field="vm.mainPropertiesForm.id"></c8y-error-feedback>
57
- </span>
58
- </div>
59
- </div>
60
- </div>
61
- <div class="form-group">
62
- <label class="sr-only" translate>Description</label>
63
- <label class="editable">
64
- <textarea
65
- class="form-control"
66
- rows="1"
67
- placeholder="{{ 'e.g. My protocol description' | translate }}"
68
- style="max-width:calc( {{
69
- vm.objectMain.description.length || 22
70
- }} * 1ch + 14px)"
71
- ng-model="vm.objectMain.description"
72
- ></textarea>
73
- </label>
74
- </div>
75
- <div ng-show="vm.mainPropertiesForm.$dirty">
76
- <button
77
- title="{{ 'Save' | translate }}"
78
- class="btn btn-primary m-t-8 m-b-8"
79
- ng-click="vm.saveMainProperties()"
80
- ng-disabled="vm.mainPropertiesForm.$invalid || vm.mainPropertiesForm.$pristine"
81
- translate
82
- >
83
- Save
84
- </button>
85
- </div>
86
- </form>
87
- </div>
88
-
89
- <div class="flex-grow">
90
- <ul class="list-unstyled small">
91
- <li class="p-t-4 p-b-4 d-flex separator-bottom text-nowrap">
92
- <label class="small m-b-0 m-r-8" translate>Date created</label>
93
- <span class="m-l-auto">{{ vm.object.creationTime | absoluteDate }}</span>
94
- </li>
95
- <li class="p-t-4 p-b-4 d-flex separator-bottom text-nowrap">
96
- <label class="small m-b-0 m-r-8" translate>Last update</label>
97
- <span class="m-l-auto">{{ vm.object.lastUpdated | absoluteDate }}</span>
98
- </li>
99
- </ul>
100
- </div>
101
- </div>
102
- </div>
103
- </div>
104
- </div>
105
- <div class="inner-scroll">
106
- <div class="card-header sticky-top separator-top-bottom">
107
- <div class="h4" translate>Resources</div>
108
- </div>
109
- <div class="p-l-16 p-r-16 p-t-16" ng-show="vm.noResources()">
110
- <div class="c8y-empty-state text-left">
111
- <h1 c8y-icon="c8y-data-points"></h1>
112
- <p class="text-medium" translate>No resources to display.</p>
113
- <p translate>Click below to add your first resource.</p>
114
- </div>
115
- </div>
116
- <div class="p-l-16 p-r-16">
117
- <div class="c8y-list__group">
118
- <c8y-impact-resource
119
- ng-repeat="(resourceId, resource) in vm.getResources()"
120
- resource="resource"
121
- mapping="vm.getMappingForResource(resourceId)"
122
- on-remove="vm.removeResource(resource)"
123
- on-update="vm.saveResourceAndMapping(changedResource, mapping, resource)"
124
- ></c8y-impact-resource>
125
-
126
- <div ng-if="vm.newResource">
127
- <c8y-impact-resource
128
- ng-show="vm.newResource"
129
- start-open="true"
130
- resource="vm.newResource"
131
- on-cancel="vm.cancelNewResourceMapping()"
132
- on-remove="vm.cancelNewResourceMapping()"
133
- on-update="vm.saveResourceAndMapping(changedResource, mapping)"
134
- ></c8y-impact-resource>
135
- </div>
136
- </div>
137
- </div>
138
- <div class="card-footer" ng-hide="vm.newResource">
139
- <button
140
- type="button"
141
- title="{{ 'Add resource' | translate }}"
142
- class="btn btn-default m-t-8"
143
- ng-click="vm.addResource()"
144
- >
145
- <i c8y-icon="plus-circle"></i>
146
- {{ 'Add resource' | translate }}
147
- </button>
148
- </div>
149
- </div>
150
- </div>
151
- </div>
152
- </div>
@@ -1 +0,0 @@
1
- "use strict";!function(){function e(e){var n=this;function o(){n.isDetailOpen=!n.isDetailOpen,n.isDetailOpen&&(c(),t())}function c(){n.resource=_.cloneDeep(n.serverResource)}function t(){n.mapping=_.cloneDeep(n.serverMapping)||{}}_.assign(n,{dataTypes:e.DATA_TYPES,$onChanges:function(e){e.serverMapping&&t();e.serverResource&&c()},$onInit:function(){n.isDetailOpen=n.startOpen,e.getCustomActions().then(function(e){n.customActions=e})},toggleDetail:o,save:function(){n.mapping.resourceID=n.resource.id,n.onUpdate({changedResource:n.resource,mapping:n.mapping}).then(o)},cancel:function(){n.onCancel(),o()},remove:function(){n.onRemove({resource:n.resource})}})}e.$inject=["c8yImpact"],angular.module("c8y.impact").component("c8yImpactResource",{bindings:{serverResource:"<resource",serverMapping:"<mapping",onUpdate:"&",onCancel:"&",onRemove:"&",startOpen:"<"},templateUrl:":::PLUGIN_PATH:::/impact-resource.html",controller:e,controllerAs:"vm"})}();
@@ -1,172 +0,0 @@
1
- <div class="c8y-list__item collapsible" ng-class="{ expanded: vm.isDetailOpen }">
2
- <div class="c8y-list__item__block">
3
- <div class="c8y-list__item__icon">
4
- <i c8y-icon="c8y-data-points"></i>
5
- </div>
6
-
7
- <div class="c8y-list__item__body">
8
- <div class="content-flex-70">
9
- <div class="col-5">
10
- <small class="text-muted">{{ vm.serverResource.id }}</small>
11
- {{ vm.serverResource.name }}
12
- </div>
13
- <div class="col-6">
14
- <div class="list-functionalities">
15
- <label class="small hidden-xs m-0" translate>Functionalities</label>
16
- &nbsp;
17
- <c8y-object-mapping-status-icons
18
- mapping="vm.serverMapping"
19
- ></c8y-object-mapping-status-icons>
20
- </div>
21
- </div>
22
- <div class="flex-grow d-flex">
23
- <button
24
- class="btn btn-dot btn-dot--danger text-danger showOnHover m-l-auto"
25
- type="button"
26
- aria-label="{{ 'Remove' | translate }}"
27
- uib-tooltip="{{ 'Remove' | translate }}"
28
- tooltip-popup-delay="500"
29
- tooltip-trigger="'mouseenter'"
30
- tooltip-append-to-body="true"
31
- ng-click="$event.stopPropagation();vm.remove()"
32
- >
33
- <i c8y-icon="minus-circle"></i>
34
- </button>
35
- </div>
36
- </div>
37
- </div>
38
-
39
- <div class="c8y-list__item__actions">
40
- <button
41
- class="collapse-btn"
42
- title="{{ 'Expand' | translate }}"
43
- type="button"
44
- ng-class="{ active: vm.isDetailOpen }"
45
- ng-click="vm.toggleDetail()"
46
- >
47
- <i c8y-icon="chevron-down"></i>
48
- </button>
49
- </div>
50
- </div>
51
-
52
- <div class="collapse" uib-collapse="!vm.isDetailOpen">
53
- <form name="wrapperForm" novalidate class="c8y-list__item__collapse--container">
54
- <div class="form tight-grid" ng-form="resourceForm">
55
- <div class="col-md-4">
56
- <div class="form-group form-group-sm">
57
- <label translate>ID</label>
58
- <input
59
- name="id"
60
- class="form-control"
61
- ng-model="vm.resource.id"
62
- placeholder="{{ 'e.g.' | translate }} 12"
63
- required
64
- ng-maxlength="100"
65
- />
66
- <c8y-error-feedback field="resourceForm.id"></c8y-error-feedback>
67
- </div>
68
- </div>
69
- <div class="col-md-8">
70
- <div class="form-group form-group-sm">
71
- <label translate>Name</label>
72
- <input
73
- name="name"
74
- class="form-control"
75
- ng-model="vm.resource.name"
76
- placeholder="{{ 'e.g. My resource' | translate }}"
77
- required
78
- ng-maxlength="200"
79
- />
80
- <c8y-error-feedback field="resourceForm.name"></c8y-error-feedback>
81
- </div>
82
- </div>
83
- <div class="col-md-4">
84
- <div class="form-group form-group-sm">
85
- <label translate>Type</label>
86
- <div class="c8y-select-wrapper">
87
- <select
88
- required
89
- name="type"
90
- class="form-control"
91
- ng-model="vm.resource.type"
92
- ng-options="dataType as (dataType | translate) for dataType in vm.dataTypes"
93
- ></select>
94
- <span></span>
95
- </div>
96
- <c8y-error-feedback field="resourceForm.type"></c8y-error-feedback>
97
- </div>
98
- </div>
99
- <div class="col-md-4">
100
- <div class="form-group form-group-sm">
101
- <label translate>Unit</label>
102
- <input name="unit" class="form-control" ng-model="vm.resource.unit" ng-maxlength="50" />
103
- <c8y-error-feedback field="resourceForm.unit"></c8y-error-feedback>
104
- </div>
105
- </div>
106
- <div class="col-md-4">
107
- <div class="form-group form-group-sm">
108
- <label translate>Instance type</label>
109
- <div>
110
- <label title="{{ 'Single' | translate }}" class="c8y-radio radio-inline">
111
- <input
112
- type="radio"
113
- name="multiple"
114
- ng-model="vm.resource.multiple"
115
- ng-value="false"
116
- />
117
- <span></span>
118
- <span>{{ 'Single' | translate }}</span>
119
- </label>
120
- <label title="{{ 'Multiple' | translate }}" class="c8y-radio radio-inline">
121
- <input
122
- type="radio"
123
- name="multiple"
124
- ng-model="vm.resource.multiple"
125
- ng-value="true"
126
- />
127
- <span></span>
128
- <span>{{ 'Multiple' | translate }}</span>
129
- </label>
130
- </div>
131
- <c8y-error-feedback field="resourceForm.multiple"></c8y-error-feedback>
132
- </div>
133
- </div>
134
- <div class="col-md-8">
135
- <div class="form-group form-group-sm">
136
- <label translate>Description</label>
137
- <textarea
138
- class="form-control"
139
- name="description"
140
- ng-model="vm.resource.description"
141
- ></textarea>
142
- <c8y-error-feedback field="resourceForm.description"></c8y-error-feedback>
143
- </div>
144
- </div>
145
- </div>
146
-
147
- <c8y-object-mapping
148
- mapping="vm.mapping"
149
- auto-observe-params="false"
150
- custom-actions="vm.customActions"
151
- ></c8y-object-mapping>
152
-
153
- <button
154
- class="btn btn-default m-t-8 m-b-8"
155
- type="button"
156
- title="{{ 'Cancel' | translate }}"
157
- ng-click="vm.cancel()"
158
- >
159
- {{ 'Cancel' | translate }}
160
- </button>
161
- <button
162
- class="btn btn-primary m-t-8 m-b-8"
163
- type="submit"
164
- title="{{ 'Save' | translate }}"
165
- ng-click="vm.save()"
166
- ng-disabled="wrapperForm.$invalid || wrapperForm.$pristine"
167
- >
168
- {{ 'Save' | translate }}
169
- </button>
170
- </form>
171
- </div>
172
- </div>
@@ -1 +0,0 @@
1
- "use strict";!function(){function c(c){c.initUi()}c.$inject=["c8yImpactProvider"],angular.module("c8y.impact",["c8y.deviceProtocols"]).config(c)}();
@@ -1 +0,0 @@
1
- "use strict";!function(){e.$inject=["c8yDeviceProtocolUiProvider","c8yViewsProvider","gettext"];var o="c8yImpact";function e(e,t,h){n.$inject=["c8yTenant","c8yBase","c8yInventory","c8yObjectMappings","c8yModal","c8yAlert","gettextCatalog","$q","$http"],r.$inject=["$routeParams"];var c={service:o,id:"impact",name:h("IMPACT")},y={path:"/deviceprotocols/".concat(c.id,"/:id"),template:'<c8y-impact-detail id="vm.id"></c8y-impact-detail>',controllerAs:"vm",controller:r};return{initUi:function(){e.register(c),t.when(y.path,y)},$get:n};function r(e){_.assign(this,e)}function n(e,c,t,r,n,o,a,i,u){var s,d=c.url("service/impact/"),l="".concat(d,"objectResourceMappings"),p="".concat(l,"/json"),g=[h("BOOLEAN"),h("STRING"),h("INTEGER"),h("FLOAT")];return{showIf:m,isServiceSubscribed:v,flow:_.constant(["c8yImpactCreateStep"]),detail:function(e){e=c.getId(e);return t.detail(e).then(c.getResData)},detailPath:function(e){e=c.getId(e);return y.path.replace(/:id$/,e)},create:function(e){e=r.createManagedObject(e);return e.type="impact_object_mapping",u.post(p,e).then(c.getResData)},save:function(e){var t=r.fragments.BASE_FRAGMENT,e=_.pick(e,["id",t]);if(!_.get(e,t))throw new Error("c8yImpact.save: ".concat(t," is not defined"));if(_.get(e,"id"))return u.post(p,e).then(c.getResData);throw new Error("c8yImpact.save: Id is not defined")},remove:t.remove,removeResourceConfirm:function(t){var e={title:h("Delete resource"),body:a.getString('You are about to delete the resource with the ID "{{id}}". Do you want to proceed?',t),status:"danger",labels:{ok:h("Delete"),cancel:h("Cancel")}};return n(e).then(function(e){return e?t:i.reject()})},overwriteResourceConfirm:function(t){var e={title:h("Overwrite resource"),body:a.getString('You are about to overwrite the resource with the ID "{{id}}". Do you want to proceed?',t),status:"warning",labels:{ok:h("Overwrite"),cancel:h("Cancel")}};return n(e).then(function(e){return e?t:i.reject()})},list:function(){return u.get(l,{silentError:!0}).then(c.getResData)},getName:r.getName,DATA_TYPES:g,alertRemoveResourceSuccess:function(){var e=h("Resource deleted.");o.success(e)},alertUpdateProtocolSuccess:function(){var e=h("Device protocol updated");o.success(e)},listRowInfoComponent:"c8yDeviceProtocolRowCountResources",getCustomActions:function(){s=s||u.get("".concat(d,"mappingActions/resourceactions")).then(c.getResData).then(f);return s}};function m(){return m.cached=m.cached?m.cached:v()}function v(){return e.isSubscribed({name:"impact",type:"MICROSERVICE"})}function f(e){return _.reduce(e,function(e,t){var c=t.name,t=t.args,t=_.get(t,"length")?t.map(function(e){return"".concat(c,":").concat(e)}):[c];return e.concat(t)},[])}}}angular.module("c8y.impact").provider(o,e)}();