iguazio.dashboard-controls 1.3.2 → 1.3.4

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": "iguazio.dashboard-controls",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "main": "dist/js/iguazio.dashboard-controls.js",
5
5
  "description": "Collection of resources (such as CSS styles, fonts and images) and AngularJs 1.x components and services to share among different Iguazio repos.",
6
6
  "repository": {
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@babel/core": "^7.24.0",
25
- "@babel/preset-env": "^7.24.0",
25
+ "@babel/preset-env": "^7.29.5",
26
26
  "@uirouter/angularjs": "^1.0.20",
27
27
  "angular": "^1.8.0",
28
28
  "angular-download": "0.0.5",
@@ -33,7 +33,7 @@
33
33
  "bootstrap": "~3.4.1",
34
34
  "del": "^6.1.1",
35
35
  "eslint-plugin-angular": "^4.0.1",
36
- "express": "4.20.0",
36
+ "express": "4.22.2",
37
37
  "gulp": "^4.0.2",
38
38
  "gulp-babel": "^8.0.0",
39
39
  "gulp-concat": "^2.6.1",
@@ -51,10 +51,10 @@
51
51
  "gulp-rev-collector": "^1.0.2",
52
52
  "gulp-uglify": "^3.0.2",
53
53
  "i18next": "^21.6.14",
54
- "jquery": ">=3.7.1",
54
+ "jquery": "^3.7.1",
55
55
  "jquery-ui": "1.13.2",
56
56
  "js-base64": "^2.4.8",
57
- "lodash": "^4.17.21",
57
+ "lodash": "^4.18.0",
58
58
  "merge2": "^0.3.6",
59
59
  "moment": "^2.24.0",
60
60
  "monaco-editor": "^0.11.1",
@@ -76,6 +76,19 @@
76
76
  "karma-chrome-launcher": "^3.1.0",
77
77
  "karma-jasmine": "^3.1.1"
78
78
  },
79
+ "overrides": {
80
+ "lodash": "^4.18.0",
81
+ "flatted": "^3.4.2",
82
+ "qs": ">=6.15.2",
83
+ "ws": ">=8.20.1",
84
+ "http-cache-semantics": ">=4.1.1",
85
+ "cross-spawn": ">=6.0.6",
86
+ "semver-regex": ">=3.1.4",
87
+ "tmp": ">=0.2.6",
88
+ "got": ">=11.8.5",
89
+ "uuid": ">=11.1.1",
90
+ "fast-xml-parser": ">=5.7.0"
91
+ },
79
92
  "autoupdate": {
80
93
  "source": "git",
81
94
  "target": "https://github.com/iguazio/dashboard-controls.git",
@@ -32,6 +32,7 @@
32
32
  "BUILD_COMMANDS_DESCRIPTION": "Custom build commands to execute as part of the container-image build",
33
33
  "BUILD_LOG": "Build log",
34
34
  "BYTES_TO_FETCH_DEFAULT": "Bytes to fetch (default)",
35
+ "CA_CERTIFICATE": "CA Certificate",
35
36
  "CANARY": "Canary",
36
37
  "CANNOT_CREATE_TRIGGER": "Cannot create more than one trigger of this kind",
37
38
  "CHOOSE_TEMPLATE": "Choose a template",
@@ -92,6 +93,8 @@
92
93
  "EDIT_API_GATEWAY": "Edit the API Gateway",
93
94
  "EDIT_FUNCTION_EVENT": "Edit the function event",
94
95
  "EDIT_PROJECT": "Edit the project",
96
+ "ENABLE_SASL": "Enable SASL",
97
+ "ENABLE_TLS": "Enable TLS",
95
98
  "ENDPOINT": "Endpoint",
96
99
  "ENRICHED_SERVICE_ACCOUNT": "Enriched service account",
97
100
  "ENTER_HOST_TO_SEE_ENDPOINT": "Enter host to see endpoint",
@@ -192,6 +195,10 @@
192
195
  "NORMAL": "Normal",
193
196
  "NOT_START_WITH_FORBIDDEN_WORDS_LABEL": "Must not start with 'kubernetes.io', 'k8s.io' or 'nuclio.io'",
194
197
  "NOT_YET_DEPLOYED": "Not yet deployed",
198
+ "OAUTH_CLIENT_ID": "OAuth Client ID",
199
+ "OAUTH_CLIENT_SECRET": "OAuth Client Secret",
200
+ "OAUTH_TOKEN_URL": "OAuth Token URL",
201
+ "OAUTH_SCOPES": "OAuth Scopes (comma separated)",
195
202
  "OAUTH2": "OAuth2",
196
203
  "ONBUILD_IMAGE": "Onbuild image",
197
204
  "ONBUILD_IMAGE_DESCRIPTION": "The name of an \"onbuild\" container image from which to build the function's processor image; the name can include {{ .Label }} and {{ .Arch }} for formatting",
@@ -282,6 +289,8 @@
282
289
  "RUN_ON_SPOT_NODES": "Run on Spot nodes",
283
290
  "RUNTIME": "Runtime",
284
291
  "RUNTIME_ATTRIBUTES": "Runtime attributes",
292
+ "SASL_HANDSHAKE": "SASL Handshake",
293
+ "SASL_MECHANISM": "SASL Mechanism",
285
294
  "SASL_PASSWORD": "SASL password",
286
295
  "SASL_USERNAME": "SASL username",
287
296
  "SAVED": "Saved",
@@ -311,6 +320,10 @@
311
320
  "TEMPLATES": "Templates",
312
321
  "THEME": "Theme",
313
322
  "TIMEOUT": "Timeout",
323
+ "TLS_ACCESS_KEY": "TLS Access Key",
324
+ "TLS_ACCESS_CERTIFICATE": "TLS Access Certificate",
325
+ "TLS_INSECURE_SKIP_VERIFY": "TLS Insecure Skip Verify",
326
+ "TLS_MINIMUM_VERSION": "TLS Minimum Version",
314
327
  "TOKEN": "Token",
315
328
  "TOOLTIP": {
316
329
  "ADD_LABELS": "Labels can be set on function creation only.",
@@ -1,4 +1,4 @@
1
- <div class="field-label">
1
+ <div class="field-label" data-ng-if="$ctrl.field.type !== 'checkbox'">
2
2
  <span data-ng-class="{ asterisk: $ctrl.field.allowEmpty === false }">
3
3
  {{$ctrl.field.label || $ctrl.convertFromCamelCase($ctrl.field.name)}}
4
4
  </span>
@@ -73,4 +73,18 @@
73
73
  data-is-disabled="$ctrl.readOnly"
74
74
  data-min-value="$ctrl.field.min"
75
75
  data-max-value="$ctrl.field.max">
76
- </igz-number-input>
76
+ </igz-number-input>
77
+ <div class="checkbox-field-wrapper item-checkbox-wrapper"
78
+ data-ng-if="$ctrl.field.type === 'checkbox'">
79
+ <input type="checkbox"
80
+ class="small"
81
+ id="item_{{$ctrl.field.name}}"
82
+ data-ng-init="$ctrl.checkboxModel = ($ctrl.getFieldValue() || $ctrl.getFieldValue())"
83
+ data-ng-model="$ctrl.checkboxModel"
84
+ data-ng-change="$ctrl.onSelectDropdownValue({item: {id: $ctrl.checkboxModel}, field: $ctrl.field.path || $ctrl.field.name})"
85
+ data-ng-disabled="$ctrl.readOnly">
86
+
87
+ <label for="item_{{$ctrl.field.name}}" class="checkbox-inline" style="margin: 0;">
88
+ {{$ctrl.field.label || $ctrl.convertFromCamelCase($ctrl.field.name)}}
89
+ </label>
90
+ </div>
@@ -177,8 +177,6 @@ such restriction.
177
177
  password: ''
178
178
  }
179
179
  });
180
- ctrl.item.attributes.sasl.enable = !lodash.isEmpty(ctrl.item.attributes.sasl.user) &&
181
- !lodash.isEmpty(ctrl.item.attributes.sasl.password);
182
180
 
183
181
  ctrl.topics = lodash.chain(ctrl.item.attributes.topics)
184
182
  .defaultTo([])
@@ -603,16 +601,13 @@ such restriction.
603
601
  * @returns {Function} filter expression
604
602
  */
605
603
  function isFieldVisible(showAdvanced) {
606
- /**
607
- * Filter expression
608
- * @param {Object} field - The field to test.
609
- * @param {string} field.type - The type of the field.
610
- * @param {boolean} field.visible - The visibility of the field.
611
- * @returns {boolean} `true` in case the field should be displayed, or `false` otherwise.
612
- */
613
604
  return function (field) {
614
- return lodash.defaultTo(field.visible, true) &&
615
- lodash.includes(['input', 'dropdown', 'number-input', 'arrayInt'], field.type) &&
605
+ var isVisible = angular.isFunction(field.visible) ?
606
+ field.visible(ctrl.item) :
607
+ lodash.defaultTo(field.visible, true);
608
+
609
+ return isVisible &&
610
+ lodash.includes(['input', 'dropdown', 'number-input', 'arrayInt', 'checkbox'], field.type) &&
616
611
  (showAdvanced ? field.isAdvanced : !field.isAdvanced);
617
612
  };
618
613
  }
@@ -1173,7 +1168,7 @@ such restriction.
1173
1168
  /**
1174
1169
  * Validate interval and schedule fields
1175
1170
  */
1176
- /* eslint complexity: ["error", 11] */
1171
+ /* eslint complexity: ["error", 15] */
1177
1172
  function validateValues() {
1178
1173
  if (ctrl.item.kind === 'cron') {
1179
1174
  var scheduleField = lodash.find(ctrl.selectedClass.fields, {name: 'schedule'});
@@ -1206,8 +1201,25 @@ such restriction.
1206
1201
  ctrl.editItemForm.item_queueName.$setValidity('text', queueName.allowEmpty || queueNameIsFilled);
1207
1202
  ctrl.editItemForm.item_topics.$setValidity('text', topics.allowEmpty || topicsIsFilled);
1208
1203
  } else if (ctrl.item.kind === 'kafka-cluster') {
1209
- ctrl.item.attributes.sasl.enable = !lodash.isEmpty(ctrl.item.attributes.sasl.user) &&
1210
- !lodash.isEmpty(ctrl.item.attributes.sasl.password);
1204
+ var isSaslEnabled = lodash.get(ctrl.item, 'attributes.sasl.enable');
1205
+
1206
+ if (!isSaslEnabled) {
1207
+ lodash.unset(ctrl.item, 'attributes.sasl.handshake');
1208
+ lodash.unset(ctrl.item, 'attributes.sasl.mechanism');
1209
+ lodash.unset(ctrl.item, 'attributes.sasl.oauth');
1210
+ } else if (lodash.get(ctrl.item, 'attributes.sasl.mechanism') !== 'oauthbearer') {
1211
+ lodash.unset(ctrl.item, 'attributes.sasl.oauth');
1212
+ }
1213
+
1214
+ var isTlsEnabled = lodash.get(ctrl.item, 'attributes.tls.enable');
1215
+
1216
+ if (!isTlsEnabled) {
1217
+ lodash.unset(ctrl.item, 'attributes.tls.insecureSkipVerify');
1218
+ lodash.unset(ctrl.item, 'attributes.tls.minimumVersion');
1219
+ lodash.unset(ctrl.item, 'attributes.tls.caCert');
1220
+ lodash.unset(ctrl.item, 'attributes.tls.accessKey');
1221
+ lodash.unset(ctrl.item, 'attributes.tls.accessCertificate');
1222
+ }
1211
1223
  }
1212
1224
  }
1213
1225
  }
@@ -59,6 +59,12 @@
59
59
  .more-info-wrapper {
60
60
  height: auto;
61
61
  }
62
+
63
+ .item-checkbox-wrapper {
64
+ display: flex;
65
+ align-items: center;
66
+ height: 58px;
67
+ }
62
68
  }
63
69
 
64
70
  .no-class-selected {
@@ -414,7 +414,8 @@
414
414
 
415
415
  <div class="collapsed-block-content-wrapper" data-uib-collapse="$ctrl.isAdvancedCollapsed">
416
416
  <div class="igz-col-{{field.fieldType === 'schedule' ? '91' : '45'}} attribute-field"
417
- data-ng-repeat="field in $ctrl.selectedClass.fields | filter:$ctrl.isFieldVisible(true) track by field.name">
417
+ data-ng-repeat="field in $ctrl.selectedClass.fields | filter:$ctrl.isFieldVisible(true) track by field.name"
418
+ data-ng-style="field.breakRow ? {'clear': 'both'} : {}">
418
419
  <ncl-edit-item-field data-edit-item-form="$ctrl.editItemForm"
419
420
  data-field="field"
420
421
  data-item="$ctrl.item"
@@ -112,23 +112,14 @@ such restriction.
112
112
  type: 'input',
113
113
  fieldType: 'input',
114
114
  path: 'attributes.consumerGroup',
115
- placeholder:
116
- $i18next.t('functions:PLACEHOLDER.ENTER_CONSUMER_GROUP_NAME', { lng: lng }),
115
+ placeholder: $i18next.t('functions:PLACEHOLDER.ENTER_CONSUMER_GROUP_NAME', { lng: lng }),
117
116
  allowEmpty: false
118
117
  },
119
118
  {
120
119
  name: 'initialOffset',
121
120
  values: [
122
- {
123
- id: 'earliest',
124
- name: 'Earliest',
125
- visible: true
126
- },
127
- {
128
- id: 'latest',
129
- name: 'Latest',
130
- visible: true
131
- }
121
+ { id: 'earliest', name: 'Earliest', visible: true },
122
+ { id: 'latest', name: 'Latest', visible: true }
132
123
  ],
133
124
  defaultValue: 'latest',
134
125
  path: 'attributes.initialOffset',
@@ -137,16 +128,8 @@ such restriction.
137
128
  {
138
129
  name: 'workerAllocationMode',
139
130
  values: [
140
- {
141
- id: 'pool',
142
- name: 'Pool',
143
- visible: true
144
- },
145
- {
146
- id: 'static',
147
- name: 'Static',
148
- visible: true
149
- }
131
+ { id: 'pool', name: 'Pool', visible: true },
132
+ { id: 'static', name: 'Static', visible: true }
150
133
  ],
151
134
  isAdvanced: true,
152
135
  defaultValue: 'pool',
@@ -192,7 +175,7 @@ such restriction.
192
175
  allowEmpty: true,
193
176
  unit: $i18next.t('common:BYTES', { lng: lng }),
194
177
  min: 1,
195
- max: 67108864, // 64 * 1024 * 1024 bytes = 64 MiB
178
+ max: 67108864,
196
179
  defaultValue: 1048576
197
180
  },
198
181
  {
@@ -225,6 +208,167 @@ such restriction.
225
208
  fieldType: 'input',
226
209
  isAdvanced: true,
227
210
  allowEmpty: true
211
+ },
212
+ {
213
+ name: 'saslEnable',
214
+ label: $i18next.t('functions:ENABLE_SASL', { lng: lng }),
215
+ type: 'checkbox',
216
+ path: 'attributes.sasl.enable',
217
+ isAdvanced: true,
218
+ defaultValue: false,
219
+ breakRow: true
220
+ },
221
+ {
222
+ name: 'saslHandshake',
223
+ label: $i18next.t('functions:SASL_HANDSHAKE', { lng: lng }),
224
+ type: 'checkbox',
225
+ path: 'attributes.sasl.handshake',
226
+ isAdvanced: true,
227
+ defaultValue: true,
228
+ visible: function (item) {
229
+ return lodash.get(item, 'attributes.sasl.enable');
230
+ }
231
+ },
232
+ {
233
+ name: 'saslMechanism',
234
+ label: $i18next.t('functions:SASL_MECHANISM', { lng: lng }),
235
+ type: 'dropdown',
236
+ path: 'attributes.sasl.mechanism',
237
+ isAdvanced: true,
238
+ defaultValue: 'plain',
239
+ values: [
240
+ { id: 'plain', name: 'Plain', visible: true },
241
+ { id: 'oauthbearer', name: 'OAuthBearer', visible: true }
242
+ ],
243
+ visible: function (item) {
244
+ return lodash.get(item, 'attributes.sasl.enable');
245
+ }
246
+ },
247
+ {
248
+ name: 'saslOauthClientID',
249
+ label: $i18next.t('functions:OAUTH_CLIENT_ID', { lng: lng }),
250
+ type: 'input',
251
+ fieldType: 'input',
252
+ path: 'attributes.sasl.oauth.clientID',
253
+ isAdvanced: true,
254
+ allowEmpty: true,
255
+ visible: function (item) {
256
+ return lodash.get(item, 'attributes.sasl.enable') &&
257
+ lodash.get(item, 'attributes.sasl.mechanism') === 'oauthbearer';
258
+ }
259
+ },
260
+ {
261
+ name: 'saslOauthClientSecret',
262
+ label: $i18next.t('functions:OAUTH_CLIENT_SECRET', { lng: lng }),
263
+ type: 'input',
264
+ fieldType: 'password',
265
+ path: 'attributes.sasl.oauth.clientSecret',
266
+ isAdvanced: true,
267
+ allowEmpty: true,
268
+ autocomplete: 'new-password',
269
+ visible: function (item) {
270
+ return lodash.get(item, 'attributes.sasl.enable') &&
271
+ lodash.get(item, 'attributes.sasl.mechanism') === 'oauthbearer';
272
+ }
273
+ },
274
+ {
275
+ name: 'saslOauthTokenURL',
276
+ label: $i18next.t('functions:OAUTH_TOKEN_URL', { lng: lng }),
277
+ type: 'input',
278
+ fieldType: 'input',
279
+ path: 'attributes.sasl.oauth.tokenURL',
280
+ isAdvanced: true,
281
+ allowEmpty: true,
282
+ visible: function (item) {
283
+ return lodash.get(item, 'attributes.sasl.enable') &&
284
+ lodash.get(item, 'attributes.sasl.mechanism') === 'oauthbearer';
285
+ }
286
+ },
287
+ {
288
+ name: 'saslOauthScopes',
289
+ label: $i18next.t('functions:OAUTH_SCOPES', { lng: lng }),
290
+ type: 'input',
291
+ fieldType: 'input',
292
+ path: 'attributes.sasl.oauth.scopes',
293
+ isAdvanced: true,
294
+ allowEmpty: true,
295
+ visible: function (item) {
296
+ return lodash.get(item, 'attributes.sasl.enable') &&
297
+ lodash.get(item, 'attributes.sasl.mechanism') === 'oauthbearer';
298
+ }
299
+ },
300
+ {
301
+ name: 'tlsEnable',
302
+ label: $i18next.t('functions:ENABLE_TLS', { lng: lng }),
303
+ type: 'checkbox',
304
+ path: 'attributes.tls.enable',
305
+ isAdvanced: true,
306
+ defaultValue: false,
307
+ breakRow: true
308
+ },
309
+ {
310
+ name: 'tlsInsecureSkipVerify',
311
+ label: $i18next.t('functions:TLS_INSECURE_SKIP_VERIFY', { lng: lng }),
312
+ type: 'checkbox',
313
+ path: 'attributes.tls.insecureSkipVerify',
314
+ isAdvanced: true,
315
+ defaultValue: false,
316
+ visible: function (item) {
317
+ return lodash.get(item, 'attributes.tls.enable');
318
+ }
319
+ },
320
+ {
321
+ name: 'tlsMinimumVersion',
322
+ label: $i18next.t('functions:TLS_MINIMUM_VERSION', { lng: lng }),
323
+ type: 'dropdown',
324
+ path: 'attributes.tls.minimumVersion',
325
+ isAdvanced: true,
326
+ defaultValue: '1.2',
327
+ values: [
328
+ { id: '1.0', name: '1.0', visible: true },
329
+ { id: '1.1', name: '1.1', visible: true },
330
+ { id: '1.2', name: '1.2', visible: true },
331
+ { id: '1.3', name: '1.3', visible: true }
332
+ ],
333
+ visible: function (item) {
334
+ return lodash.get(item, 'attributes.tls.enable');
335
+ }
336
+ },
337
+ {
338
+ name: 'tlsCaCert',
339
+ label: $i18next.t('functions:CA_CERTIFICATE', { lng: lng }),
340
+ type: 'input',
341
+ fieldType: 'input',
342
+ path: 'attributes.tls.caCert',
343
+ isAdvanced: true,
344
+ allowEmpty: true,
345
+ visible: function (item) {
346
+ return lodash.get(item, 'attributes.tls.enable');
347
+ }
348
+ },
349
+ {
350
+ name: 'tlsAccessKey',
351
+ label: $i18next.t('functions:TLS_ACCESS_KEY', { lng: lng }),
352
+ type: 'input',
353
+ fieldType: 'input',
354
+ path: 'attributes.tls.accessKey',
355
+ isAdvanced: true,
356
+ allowEmpty: true,
357
+ visible: function (item) {
358
+ return lodash.get(item, 'attributes.tls.enable');
359
+ }
360
+ },
361
+ {
362
+ name: 'tlsAccessCertificate',
363
+ label: $i18next.t('functions:TLS_ACCESS_CERTIFICATE', { lng: lng }),
364
+ type: 'input',
365
+ fieldType: 'input',
366
+ path: 'attributes.tls.accessCertificate',
367
+ isAdvanced: true,
368
+ allowEmpty: true,
369
+ visible: function (item) {
370
+ return lodash.get(item, 'attributes.tls.enable');
371
+ }
228
372
  }
229
373
  ]
230
374
  },