@mediafly/js-ui 50.5.0 → 51.1.0-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/.node-version +1 -1
- package/.semaphore/promotion-deploy-docs.yml +35 -0
- package/.semaphore/scripts/notify_jira.sh +115 -0
- package/.semaphore/semaphore.yml +91 -0
- package/CHANGELOG.md +25 -346
- package/README.md +7 -4
- package/archive/old-changelog.md +347 -0
- package/lib/checkbox/checkbox.html +2 -0
- package/lib/color-input/spectrum-color-picker.js +1 -2
- package/lib/color-input/spectrum-color-picker.js.map +1 -1
- package/lib/constants/constants.js +0 -1
- package/lib/constants/constants.js.map +1 -1
- package/lib/date-input/date-input.js +2 -3
- package/lib/date-input/date-input.js.map +1 -1
- package/lib/date-input/validate-date.js +1 -2
- package/lib/date-input/validate-date.js.map +1 -1
- package/lib/date-time-zone-picker/date-time-zone-picker.js +1 -2
- package/lib/date-time-zone-picker/date-time-zone-picker.js.map +1 -1
- package/lib/date-time-zone-picker/datepicker.html +17 -18
- package/lib/date-time-zone-picker/timepicker.html +19 -9
- package/lib/first-time-motivator/first-time-motivator.js +3 -4
- package/lib/first-time-motivator/first-time-motivator.js.map +1 -1
- package/lib/fonts.css +1 -1
- package/lib/gesture-handler/gesture-handler.js +14 -6
- package/lib/gesture-handler/gesture-handler.js.map +1 -1
- package/lib/hover-tooltip/hover-tooltip.js +7 -4
- package/lib/hover-tooltip/hover-tooltip.js.map +1 -1
- package/lib/index.d.ts +0 -5
- package/lib/index.js +0 -5
- package/lib/index.js.map +1 -1
- package/lib/jsui.module.css +46 -49
- package/lib/loading-indicator/loading-indicator.component.html +6 -6
- package/lib/metadata-form/metadata-form.component.d.ts +1 -0
- package/lib/metadata-form/metadata-form.component.js +32 -0
- package/lib/metadata-form/metadata-form.component.js.map +1 -1
- package/lib/metadata-form/metadata-form.html +1 -1
- package/lib/rich-text/rich-text.component.d.ts +3 -2
- package/lib/rich-text/rich-text.component.js +8 -0
- package/lib/rich-text/rich-text.component.js.map +1 -1
- package/lib/styles.css +176 -369
- package/lib/time-input/time-input.html +1 -1
- package/lib/time-input/time-input.js +2 -3
- package/lib/time-input/time-input.js.map +1 -1
- package/lib/time-input/validate-time.js +1 -2
- package/lib/time-input/validate-time.js.map +1 -1
- package/lib/tree/tree.js +3 -4
- package/lib/tree/tree.js.map +1 -1
- package/lib/tsconfig.deploy.tsbuildinfo +26 -155
- package/package.json +1 -2
- package/src/components/checkbox/checkbox.html +2 -0
- package/src/components/color-input/spectrum-color-picker.js +2 -3
- package/src/components/constants/constants.js +0 -1
- package/src/components/date-input/date-input.js +2 -3
- package/src/components/date-input/validate-date.js +1 -2
- package/src/components/date-time-zone-picker/date-time-zone-picker.less +20 -19
- package/src/components/date-time-zone-picker/date-time-zone-picker.ts +10 -7
- package/src/components/date-time-zone-picker/datepicker.html +17 -18
- package/src/components/date-time-zone-picker/timepicker.html +19 -9
- package/src/components/feedback/feedback.less +1 -1
- package/src/components/first-time-motivator/first-time-motivator.ts +4 -5
- package/src/components/font-selector/font-selector.less +2 -1
- package/src/components/gesture-handler/{gesture-handler.js → gesture-handler.ts} +18 -6
- package/src/components/hover-tooltip/hover-tooltip.ts +7 -4
- package/src/components/index.less +0 -1
- package/src/components/index.ts +0 -5
- package/src/components/legacy/mediafly-bootstrap.css +0 -5
- package/src/components/less/fonts/mfly-webfont.less +1 -1
- package/src/components/less/objects/buttons.less +12 -63
- package/src/components/less/objects/buttons.module.css +8 -2
- package/src/components/less/objects/containers.less +2 -2
- package/src/components/less/objects/forms.less +31 -245
- package/src/components/less/objects/labels.less +5 -1
- package/src/components/less/objects/radios-checkboxes.less +2 -1
- package/src/components/less/utilities/reset.less +1 -1
- package/src/components/less/utilities/utilities.less +2 -0
- package/src/components/less/variables/colors.less +39 -44
- package/src/components/less/variables/effects.less +3 -7
- package/src/components/less/variables.module.css +37 -46
- package/src/components/less/vendor/pikaday.css +12 -8
- package/src/components/loading-indicator/loading-indicator.component.html +6 -6
- package/src/components/metadata-form/metadata-form.component.ts +39 -0
- package/src/components/metadata-form/metadata-form.html +1 -1
- package/src/components/progress-bar/progress-bar.less +2 -1
- package/src/components/rich-text/rich-text.component.ts +8 -2
- package/src/components/time-input/time-input.html +1 -1
- package/src/components/time-input/time-input.js +3 -3
- package/src/components/time-input/validate-time.js +1 -2
- package/src/components/tree/tree.less +16 -8
- package/src/components/tree/tree.ts +5 -6
- package/src/fonts/mfly-webfont.woff +0 -0
- package/src/index.html +3 -2
- package/src/index.spec.js +0 -6
- package/Dockerfile +0 -42
- package/Jenkinsfile +0 -138
- package/lib/date-time-utilities/date-time-utilities.d.ts +0 -1
- package/lib/date-time-utilities/date-time-utilities.js +0 -79
- package/lib/date-time-utilities/date-time-utilities.js.map +0 -1
- package/lib/date-time-utilities/index.d.ts +0 -1
- package/lib/date-time-utilities/index.js +0 -4
- package/lib/date-time-utilities/index.js.map +0 -1
- package/lib/disable-context-menu/disable-context-menu.d.ts +0 -1
- package/lib/disable-context-menu/disable-context-menu.js +0 -23
- package/lib/disable-context-menu/disable-context-menu.js.map +0 -1
- package/lib/disable-context-menu/index.d.ts +0 -1
- package/lib/disable-context-menu/index.js +0 -4
- package/lib/disable-context-menu/index.js.map +0 -1
- package/lib/show-image-loader/index.d.ts +0 -1
- package/lib/show-image-loader/index.js +0 -4
- package/lib/show-image-loader/index.js.map +0 -1
- package/lib/show-image-loader/show-image-loader.d.ts +0 -1
- package/lib/show-image-loader/show-image-loader.js +0 -23
- package/lib/show-image-loader/show-image-loader.js.map +0 -1
- package/lib/slides/index.d.ts +0 -1
- package/lib/slides/index.js +0 -4
- package/lib/slides/index.js.map +0 -1
- package/lib/slides/slides.d.ts +0 -1
- package/lib/slides/slides.html +0 -17
- package/lib/slides/slides.js +0 -96
- package/lib/slides/slides.js.map +0 -1
- package/lib/time-conversion/index.d.ts +0 -1
- package/lib/time-conversion/index.js +0 -4
- package/lib/time-conversion/index.js.map +0 -1
- package/lib/time-conversion/time-conversion-factory.d.ts +0 -1
- package/lib/time-conversion/time-conversion-factory.js +0 -91
- package/lib/time-conversion/time-conversion-factory.js.map +0 -1
- package/src/components/date-time-utilities/date-time-utilities.js +0 -94
- package/src/components/date-time-utilities/index.ts +0 -1
- package/src/components/disable-context-menu/disable-context-menu.ts +0 -21
- package/src/components/disable-context-menu/index.ts +0 -1
- package/src/components/show-image-loader/index.ts +0 -1
- package/src/components/show-image-loader/show-image-loader.js +0 -22
- package/src/components/slides/index.ts +0 -1
- package/src/components/slides/slides.html +0 -17
- package/src/components/slides/slides.less +0 -155
- package/src/components/slides/slides.ts +0 -101
- package/src/components/time-conversion/index.ts +0 -1
- package/src/components/time-conversion/time-conversion-factory.ts +0 -114
- package/tsconfig.tsbuildinfo +0 -7221
|
@@ -226,6 +226,45 @@ export default class MetadataFormController implements ng.IComponentController {
|
|
|
226
226
|
this.bulkEnabled[name] = false
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
+
getFieldForAttribute(schemaField: MetadataDefinition): string {
|
|
230
|
+
|
|
231
|
+
// Keywords fields are technically array fields, but they don't have indexed inputs.
|
|
232
|
+
// Same for lookup fields.
|
|
233
|
+
if (schemaField.isArray && schemaField.format === 'tag') {
|
|
234
|
+
return schemaField.name
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (schemaField.isArray && schemaField.format === 'lookup') {
|
|
238
|
+
return schemaField.name
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// For plain array fields, return the label of the first input.
|
|
242
|
+
// Array controls are identified by their index.
|
|
243
|
+
if (schemaField.isArray && schemaField.type !== 'object') {
|
|
244
|
+
return `${schemaField.name}-0`
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// For array-of-object fields, return the label of the first input.
|
|
248
|
+
// These controls are identified by property name _and_ index.
|
|
249
|
+
if (schemaField.isArray && schemaField.type === 'object') {
|
|
250
|
+
if (!schemaField.objectDefinition) {
|
|
251
|
+
throw new Error(`Object type schema field, but no object definition`)
|
|
252
|
+
}
|
|
253
|
+
return `${schemaField.name}-${schemaField.objectDefinition[0].name}-0`
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// For plain object fields, return the label of the first input.
|
|
257
|
+
// Object controls are identified by their property names.
|
|
258
|
+
if (schemaField.type === 'object') {
|
|
259
|
+
if (!schemaField.objectDefinition) {
|
|
260
|
+
throw new Error(`Object type schema field, but no object definition`)
|
|
261
|
+
}
|
|
262
|
+
return `${schemaField.name}-${schemaField.objectDefinition[0].name}`
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
return schemaField.name
|
|
266
|
+
}
|
|
267
|
+
|
|
229
268
|
inputClick(name: string) {
|
|
230
269
|
if (this.isBulkEdit) {
|
|
231
270
|
this.enableField(name)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<label
|
|
9
9
|
ng-if="$ctrl.isBulkEdit || schemaField.type !== 'boolean'"
|
|
10
10
|
ng-class="{ 'has-bulk-toggles': $ctrl.isBulkEdit }"
|
|
11
|
-
for="{{ schemaField
|
|
11
|
+
for="{{ $ctrl.getFieldForAttribute(schemaField) }}">
|
|
12
12
|
<span>{{ schemaField.label }}</span>
|
|
13
13
|
<span
|
|
14
14
|
class="far fa-question-circle"
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.c-progress-bar__fill {
|
|
9
|
-
background-color: @color-
|
|
9
|
+
background-color: @color-ui-theme-primary-light;
|
|
10
10
|
height: 100%;
|
|
11
11
|
left: 0;
|
|
12
12
|
position: absolute;
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.c-progress-bar__contents {
|
|
20
|
+
color: #fff;
|
|
20
21
|
padding: 0 4px;
|
|
21
22
|
position: relative;
|
|
22
23
|
z-index: 2;
|
|
@@ -6,7 +6,7 @@ import { Component, Inject, Input } from '../decorators'
|
|
|
6
6
|
import type { TranslateFactory } from '../translate/translate-factory'
|
|
7
7
|
import { v4 as uuidv4 } from 'uuid'
|
|
8
8
|
import RichTextService from './rich-text.service'
|
|
9
|
-
|
|
9
|
+
import { IComponentController } from 'angular'
|
|
10
10
|
|
|
11
11
|
@Component({
|
|
12
12
|
selector: 'richText',
|
|
@@ -15,10 +15,11 @@ import RichTextService from './rich-text.service'
|
|
|
15
15
|
},
|
|
16
16
|
template: require('./rich-text.component.html'),
|
|
17
17
|
})
|
|
18
|
-
export default class RichTextComponentController implements
|
|
18
|
+
export default class RichTextComponentController implements IComponentController {
|
|
19
19
|
|
|
20
20
|
@Input() allowColorSelection?: boolean
|
|
21
21
|
@Input() allowFontSelection?: boolean
|
|
22
|
+
@Input() allowImages?: boolean
|
|
22
23
|
@Input() isRequired!: boolean
|
|
23
24
|
|
|
24
25
|
protected cachedSelection?: Range | null
|
|
@@ -167,6 +168,11 @@ export default class RichTextComponentController implements ng.IComponentControl
|
|
|
167
168
|
|
|
168
169
|
if (source !== 'user') { return }
|
|
169
170
|
|
|
171
|
+
if (!this.allowImages && delta.ops.some(op => op.insert && typeof op.insert === 'object' && 'image' in op.insert)) {
|
|
172
|
+
// Don't allow images to be added in any way: pasted, drag-dropped, etc.
|
|
173
|
+
this.editor.history.undo()
|
|
174
|
+
}
|
|
175
|
+
|
|
170
176
|
this.$timeout(() => {
|
|
171
177
|
// In some cases, toggling Bold/Italic/Underline clears the font.
|
|
172
178
|
this.fixClearedFonts(oldContents, delta)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import angular from 'angular'
|
|
2
2
|
import template from './time-input.html'
|
|
3
|
-
import is from 'is_js'
|
|
4
3
|
import moment from 'moment'
|
|
5
4
|
|
|
5
|
+
|
|
6
6
|
angular.module('app').directive('mflyTimeInput', [
|
|
7
7
|
'$timeout',
|
|
8
8
|
'translateFactory',
|
|
@@ -39,7 +39,7 @@ angular.module('app').directive('mflyTimeInput', [
|
|
|
39
39
|
// The result of this function is assigned to `ngModelCtrl.$viewValue`.
|
|
40
40
|
ngModelCtrl.$formatters.push(function (nativeDate) {
|
|
41
41
|
|
|
42
|
-
if (
|
|
42
|
+
if (!nativeDate) {
|
|
43
43
|
return '';
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -59,7 +59,7 @@ angular.module('app').directive('mflyTimeInput', [
|
|
|
59
59
|
|
|
60
60
|
// If the user backspaced the date we will get an empty string as the
|
|
61
61
|
// viewValue, in which case we want a null date on the model.
|
|
62
|
-
if (
|
|
62
|
+
if (viewValue === '') {
|
|
63
63
|
return null;
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import angular from 'angular'
|
|
2
|
-
import is from 'is_js'
|
|
3
2
|
import moment from 'moment'
|
|
4
3
|
|
|
5
4
|
angular.module('app').directive('mflyValidateTime', function mflyValidateTime () {
|
|
@@ -16,7 +15,7 @@ angular.module('app').directive('mflyValidateTime', function mflyValidateTime ()
|
|
|
16
15
|
];
|
|
17
16
|
|
|
18
17
|
// Empty models shouldn't be "invalid" - that's covered by "required".
|
|
19
|
-
if (
|
|
18
|
+
if (viewValue === '') {
|
|
20
19
|
return true;
|
|
21
20
|
}
|
|
22
21
|
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
+
@import '../less/variables/colors.less';
|
|
2
|
+
|
|
1
3
|
.c-tree-item {
|
|
2
4
|
display: block;
|
|
3
5
|
padding: 3px 0;
|
|
4
6
|
white-space: nowrap;
|
|
5
7
|
|
|
6
|
-
&.is-muted {
|
|
7
|
-
opacity: 0.5;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
8
|
&.is-active > div > a > .c-tree-item__tree-title,
|
|
11
9
|
&.is-active > a > .c-tree-item__tree-title { // regular nodes
|
|
12
|
-
background-color:
|
|
13
|
-
color: #fff;
|
|
10
|
+
background-color: @color-gray-xx-light;
|
|
14
11
|
}
|
|
15
12
|
|
|
16
13
|
& .c-tree-item {
|
|
@@ -25,15 +22,26 @@
|
|
|
25
22
|
border-radius: 3px;
|
|
26
23
|
padding: 5px;
|
|
27
24
|
position: relative;
|
|
25
|
+
transition: 0.25s all;
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
& a {
|
|
31
|
-
color:
|
|
29
|
+
color: @color-ui-theme-text-primary;
|
|
32
30
|
text-decoration: none;
|
|
33
31
|
}
|
|
34
32
|
|
|
33
|
+
/* Ideally, this wouldn't use disabled text color, but we're maintaining old behavior when switching palette. */
|
|
34
|
+
&.is-muted a,
|
|
35
|
+
&.is-muted {
|
|
36
|
+
color: @color-ui-theme-text-disabled;
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
& a:hover .c-tree-item__tree-title {
|
|
36
|
-
background-color:
|
|
40
|
+
background-color: @color-button-default-hover-background;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.is-active > a:hover > .c-tree-item__tree-title {
|
|
44
|
+
background-color: darken(@color-gray-xx-light, 5%);
|
|
37
45
|
}
|
|
38
46
|
}
|
|
39
47
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import angular from 'angular'
|
|
2
|
-
import is from 'is_js'
|
|
3
2
|
import _ from 'lodash'
|
|
4
3
|
import template from './tree.html'
|
|
5
4
|
|
|
@@ -16,7 +15,7 @@ angular.module('app').directive('mflyTree', function mflyTab() {
|
|
|
16
15
|
const lastActiveItems: any[] = []
|
|
17
16
|
|
|
18
17
|
// if we're given an initial active node, attempt to find and activate it.
|
|
19
|
-
if (
|
|
18
|
+
if ($scope.initialActiveNode) {
|
|
20
19
|
$scope.initialActiveNode.active = true
|
|
21
20
|
lastActiveItems.push($scope.initialActiveNode)
|
|
22
21
|
|
|
@@ -81,11 +80,12 @@ angular.module('app').directive('mflyTree', function mflyTab() {
|
|
|
81
80
|
function expandToActiveNode(nodes, nodeToFind) {
|
|
82
81
|
const foundNode = _.find(nodes, nodeToFind)
|
|
83
82
|
|
|
84
|
-
if (
|
|
83
|
+
if (foundNode) {
|
|
85
84
|
return foundNode
|
|
86
|
-
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
87
|
return _.map(nodes, (node: ITreeItem) => {
|
|
88
|
-
if (
|
|
88
|
+
if (node.children && node.children.length > 0) {
|
|
89
89
|
node.collapsed = false
|
|
90
90
|
return expandToActiveNode(node.children, nodeToFind)
|
|
91
91
|
}
|
|
@@ -105,5 +105,4 @@ angular.module('app').directive('mflyTree', function mflyTab() {
|
|
|
105
105
|
},
|
|
106
106
|
template,
|
|
107
107
|
}
|
|
108
|
-
|
|
109
108
|
})
|
|
Binary file
|
package/src/index.html
CHANGED
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
<meta charset="utf-8" />
|
|
7
7
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
9
|
-
<meta name="
|
|
10
|
-
<meta name="jobname" content="<%= htmlWebpackPlugin.options.
|
|
9
|
+
<meta name="commit" content="<%= htmlWebpackPlugin.options.SEMAPHORE_GIT_SHA %>">
|
|
10
|
+
<meta name="jobname" content="<%= htmlWebpackPlugin.options.SEMAPHORE_GIT_BRANCH %>">
|
|
11
|
+
<meta name="workflowid" content="<%= htmlWebpackPlugin.options.SEMAPHORE_WORKFLOW_ID %>">
|
|
11
12
|
|
|
12
13
|
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico" />
|
|
13
14
|
|
package/src/index.spec.js
CHANGED
|
@@ -4,15 +4,11 @@ import './app/canary.spec'
|
|
|
4
4
|
import './components/auto-complete/tests/auto-complete-match-renderer.spec'
|
|
5
5
|
import './components/auto-complete/tests/auto-complete.spec'
|
|
6
6
|
import './components/auto-focus/tests/auto-focus.spec'
|
|
7
|
-
import './components/badge/tests/badge.spec'
|
|
8
7
|
import './components/checkbox/tests/checkbox.spec'
|
|
9
8
|
import './components/color-input/tests/color-input.spec'
|
|
10
9
|
import './components/constants/tests/constants.spec'
|
|
11
|
-
import './components/date-input/tests/date-input.spec'
|
|
12
|
-
import './components/date-time-utilities/tests/date-time-utilities.spec'
|
|
13
10
|
import './components/date-time-zone-picker/tests/date-time-zone-picker.spec'
|
|
14
11
|
import './components/date-time-zone-picker/tests/time-format-filters.spec'
|
|
15
|
-
import './components/disable-context-menu/tests/disable-context-menu.spec'
|
|
16
12
|
import './components/dropdown-menu/tests/dropdown-menu-items.spec'
|
|
17
13
|
import './components/dropdown-menu/tests/dropdown-menu.spec'
|
|
18
14
|
import './components/dropdown/tests/dropdown.spec'
|
|
@@ -34,12 +30,10 @@ import './components/progress-bar/tests/progress-bar.spec'
|
|
|
34
30
|
import './components/progress-circle/tests/progress-circle.spec'
|
|
35
31
|
import './components/rich-text/tests/rich-text.service.spec'
|
|
36
32
|
import './components/response-handlers/tests/error-response.service.spec'
|
|
37
|
-
import './components/show-image-loader/tests/show-image-loader.spec'
|
|
38
33
|
import './components/table-blank-slate/tests/table-blank-slate.spec'
|
|
39
34
|
import './components/tabs/tests/tab-group.spec'
|
|
40
35
|
import './components/tag-input/tests/tag-input.component.spec'
|
|
41
36
|
import './components/textarea/tests/textarea.spec'
|
|
42
37
|
import './components/textinput/tests/textinput.spec'
|
|
43
|
-
import './components/time-conversion/tests/time-conversion-factory.spec'
|
|
44
38
|
import './components/time-input/tests/time-input.spec'
|
|
45
39
|
import './components/translate/tests/translate-factory.spec'
|
package/Dockerfile
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
FROM node:20.5.0
|
|
2
|
-
ARG NPM_AUTH_TOKEN
|
|
3
|
-
|
|
4
|
-
RUN apt-get update
|
|
5
|
-
RUN apt-get install -y python3-pip
|
|
6
|
-
|
|
7
|
-
# Cypress: https://docs.cypress.io/guides/continuous-integration/introduction#Dependencies
|
|
8
|
-
RUN apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
|
|
9
|
-
|
|
10
|
-
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
|
|
11
|
-
&& apt install -y ./google-chrome-stable_current_amd64.deb
|
|
12
|
-
|
|
13
|
-
RUN npm install -g npm@8.16.0
|
|
14
|
-
|
|
15
|
-
WORKDIR /home/node
|
|
16
|
-
USER node
|
|
17
|
-
|
|
18
|
-
ENV npm_config_cache="/home/node/cache"
|
|
19
|
-
ENV CHROME_BIN=/usr/bin/google-chrome
|
|
20
|
-
ENV CI=true
|
|
21
|
-
ENV NODE_OPTIONS="--max-old-space-size=2048"
|
|
22
|
-
ENV TERM=xterm-256color
|
|
23
|
-
|
|
24
|
-
# Cypress: Needs access to a cache for its binaries, as well as the .config folder for Electron appData
|
|
25
|
-
# We also turn off its advertisements (lol)
|
|
26
|
-
ENV CYPRESS_CACHE_FOLDER="/home/node/.cypress-cache"
|
|
27
|
-
ENV XDG_CONFIG_HOME="/home/node/.config"
|
|
28
|
-
ENV CYPRESS_COMMERCIAL_RECOMMENDATIONS=0
|
|
29
|
-
|
|
30
|
-
RUN curl -L 'https://download.cypress.io/desktop/12.12.0?platform=linux&arch=x64' --output /home/node/cypress.zip
|
|
31
|
-
ENV CYPRESS_INSTALL_BINARY=/home/node/cypress.zip
|
|
32
|
-
|
|
33
|
-
COPY --chown=node:node package*.json ./
|
|
34
|
-
COPY --chown=node:node .npmrc ./
|
|
35
|
-
|
|
36
|
-
RUN mkdir -p ${CYPRESS_CACHE_FOLDER}
|
|
37
|
-
|
|
38
|
-
RUN npm set //registry.npmjs.org/:_authToken $NPM_AUTH_TOKEN
|
|
39
|
-
|
|
40
|
-
RUN npm clean-install
|
|
41
|
-
|
|
42
|
-
COPY --chown=node:node . ./
|
package/Jenkinsfile
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
def slot
|
|
2
|
-
def version
|
|
3
|
-
|
|
4
|
-
switch (env.BRANCH_NAME) {
|
|
5
|
-
case 'main':
|
|
6
|
-
slot = 'test'
|
|
7
|
-
break
|
|
8
|
-
default:
|
|
9
|
-
// try to extract the slot from env.BRANCH_NAME
|
|
10
|
-
// env.BRANCH_NAME convention is {slot}/{type}/{name}
|
|
11
|
-
def tokens = env.BRANCH_NAME.split( '/' )
|
|
12
|
-
// we will need to require at least 2 slashes
|
|
13
|
-
if (tokens.length > 1 && tokens[0] != 'desktop') {
|
|
14
|
-
slot = tokens[0]
|
|
15
|
-
}
|
|
16
|
-
break
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
pipeline {
|
|
20
|
-
agent {
|
|
21
|
-
label 'linux'
|
|
22
|
-
}
|
|
23
|
-
environment {
|
|
24
|
-
AWS_PROFILE = "integration"
|
|
25
|
-
NPM_AUTH_TOKEN = credentials('npm.auth-token')
|
|
26
|
-
VERSION = "${env.BUILD_ID}-${env.GIT_COMMIT}"
|
|
27
|
-
}
|
|
28
|
-
options {
|
|
29
|
-
buildDiscarder(logRotator(numToKeepStr: '5'))
|
|
30
|
-
disableConcurrentBuilds()
|
|
31
|
-
}
|
|
32
|
-
stages {
|
|
33
|
-
stage('Clean') {
|
|
34
|
-
steps {
|
|
35
|
-
dir('dist') {
|
|
36
|
-
deleteDir()
|
|
37
|
-
}
|
|
38
|
-
// manually clean cypress folders since there is an error when Cypress attempts to clean them itself
|
|
39
|
-
fileOperations([
|
|
40
|
-
folderDeleteOperation(folderPath: 'cypress/screenshots'),
|
|
41
|
-
folderDeleteOperation(folderPath: 'cypress/logs'),
|
|
42
|
-
folderDeleteOperation(folderPath: 'cypress/videos'),
|
|
43
|
-
])
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
stage('Docker') {
|
|
47
|
-
agent {
|
|
48
|
-
dockerfile {
|
|
49
|
-
additionalBuildArgs '--build-arg NPM_AUTH_TOKEN=$NPM_AUTH_TOKEN'
|
|
50
|
-
args '--volume $WORKSPACE/dist:/dist --volume $WORKSPACE/cypress:/cypress'
|
|
51
|
-
label 'linux'
|
|
52
|
-
reuseNode true
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
stages {
|
|
56
|
-
stage('Build') {
|
|
57
|
-
steps {
|
|
58
|
-
sh 'npm --prefix /home/node run build'
|
|
59
|
-
sh 'cp -R /home/node/dist/. /dist/'
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
stage('Unit Tests') {
|
|
63
|
-
steps {
|
|
64
|
-
sh 'npm --prefix /home/node test'
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
stage('Cypress') {
|
|
68
|
-
when { anyOf { branch "PR-*"; branch "main"; } }
|
|
69
|
-
steps {
|
|
70
|
-
sh 'npm --prefix /home/node run cypress:ci'
|
|
71
|
-
}
|
|
72
|
-
post {
|
|
73
|
-
always {
|
|
74
|
-
sh 'cp -vR /home/node/cypress/. /cypress'
|
|
75
|
-
junit 'cypress/xmloutput/*.xml'
|
|
76
|
-
}
|
|
77
|
-
failure {
|
|
78
|
-
dir('cypress/screenshots') {
|
|
79
|
-
archiveArtifacts artifacts: '**/*.png', allowEmptyArchive: true
|
|
80
|
-
}
|
|
81
|
-
dir('cypress/logs') {
|
|
82
|
-
archiveArtifacts artifacts: '**/*.json', allowEmptyArchive: true
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
stage('Deploy JSUI Site') {
|
|
91
|
-
when {
|
|
92
|
-
branch 'main'
|
|
93
|
-
expression {
|
|
94
|
-
currentBuild.result == null || currentBuild.result == 'SUCCESS'
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
steps {
|
|
98
|
-
dir('dist') {
|
|
99
|
-
sh 'aws s3 sync . s3://mediafly-js-ui/ --acl public-read --delete'
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
stage ('Success') {
|
|
104
|
-
steps {
|
|
105
|
-
script {
|
|
106
|
-
currentBuild.result = 'SUCCESS'
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
post {
|
|
112
|
-
always {
|
|
113
|
-
script {
|
|
114
|
-
dir('cypress/screenshots') {
|
|
115
|
-
archiveArtifacts artifacts: '**/*.png', allowEmptyArchive: true
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
if (currentBuild.result == 'FAILURE' || currentBuild.result == 'SUCCESS') {
|
|
119
|
-
if (slot == 'test') {
|
|
120
|
-
step([$class: 'Mailer',
|
|
121
|
-
notifyEveryUnstableBuild: true,
|
|
122
|
-
recipients: "mediafly-developers-frontend@mediafly.com",
|
|
123
|
-
sendToIndividuals: true])
|
|
124
|
-
|
|
125
|
-
slackSend channel:"#jenkins",
|
|
126
|
-
color: "${currentBuild.result == 'FAILURE' ? 'danger' : 'good'}",
|
|
127
|
-
message: "JSUI `${env.BRANCH_NAME}` <${env.BUILD_URL}|#${env.BUILD_ID}>: ${currentBuild.result}"
|
|
128
|
-
}
|
|
129
|
-
else if (slot) {
|
|
130
|
-
slackSend channel:"@${slot}",
|
|
131
|
-
color: "${currentBuild.result == 'FAILURE' ? 'danger' : 'good'}",
|
|
132
|
-
message: "JSUI `${env.BRANCH_NAME}` <${env.BUILD_URL}|#${env.BUILD_ID}>: ${currentBuild.result}"
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const angular_1 = __importDefault(require("angular"));
|
|
7
|
-
const moment_1 = __importDefault(require("moment"));
|
|
8
|
-
angular_1.default.module('app').factory('dateTimeUtilities', function dateTimeUtilities() {
|
|
9
|
-
// These methods all accept and return JS Date objects.
|
|
10
|
-
// Returns true if the year/month/day of `a` and `b` match.
|
|
11
|
-
// (Moment checks year & month automatically when given `day`.)
|
|
12
|
-
var isSameDate = function (a, b) {
|
|
13
|
-
return moment_1.default(a).isSame(moment_1.default(b), 'day');
|
|
14
|
-
};
|
|
15
|
-
// Returns true if the hour/minute/second of `a` and `b` match.
|
|
16
|
-
var isSameTime = function (a, b) {
|
|
17
|
-
return moment_1.default(a).hour() === moment_1.default(b).hour() &&
|
|
18
|
-
moment_1.default(a).minute() === moment_1.default(b).minute() &&
|
|
19
|
-
moment_1.default(a).second() === moment_1.default(b).second();
|
|
20
|
-
};
|
|
21
|
-
// Returns a date that is `minutes` after `date`.
|
|
22
|
-
var minutesAfter = function (date, minutes) {
|
|
23
|
-
return moment_1.default(date)
|
|
24
|
-
.add(minutes, 'minutes')
|
|
25
|
-
.toDate();
|
|
26
|
-
};
|
|
27
|
-
// Returns a date that is `minutes` before `date`.
|
|
28
|
-
var minutesBefore = function (date, minutes) {
|
|
29
|
-
return moment_1.default(date)
|
|
30
|
-
.subtract(minutes, 'minutes')
|
|
31
|
-
.toDate();
|
|
32
|
-
};
|
|
33
|
-
// Rounds a date to the nearest earlier half-hour.
|
|
34
|
-
var roundDownToHalfHour = function (date) {
|
|
35
|
-
if (moment_1.default(date).minute() > 30) {
|
|
36
|
-
return moment_1.default(date).minute(30).toDate();
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
return moment_1.default(date).minute(0).toDate();
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
// Rounds a date to the end of the minute (:59 seconds).
|
|
43
|
-
var roundToEndOfMinute = function (date) {
|
|
44
|
-
return moment_1.default(date)
|
|
45
|
-
.endOf('minute')
|
|
46
|
-
.toDate();
|
|
47
|
-
};
|
|
48
|
-
// Returns `baseDate` with the date parts changed to match `targetDate`.
|
|
49
|
-
var updateDateOnly = function (baseDate, targetDate) {
|
|
50
|
-
var targetMoment = moment_1.default(targetDate);
|
|
51
|
-
return moment_1.default(baseDate)
|
|
52
|
-
.year(targetMoment.year())
|
|
53
|
-
.month(targetMoment.month())
|
|
54
|
-
.date(targetMoment.date())
|
|
55
|
-
.toDate();
|
|
56
|
-
};
|
|
57
|
-
// Returns `baseDate` with the time parts changed to match `targetDate`.
|
|
58
|
-
var updateTimeOnly = function (baseDate, targetDate) {
|
|
59
|
-
var targetMoment = moment_1.default(targetDate);
|
|
60
|
-
return moment_1.default(baseDate)
|
|
61
|
-
.hour(targetMoment.hour())
|
|
62
|
-
.minute(targetMoment.minute())
|
|
63
|
-
.second(targetMoment.second())
|
|
64
|
-
.toDate();
|
|
65
|
-
};
|
|
66
|
-
// API
|
|
67
|
-
// ------------------------------------------
|
|
68
|
-
return {
|
|
69
|
-
isSameDate,
|
|
70
|
-
isSameTime,
|
|
71
|
-
minutesAfter,
|
|
72
|
-
minutesBefore,
|
|
73
|
-
roundDownToHalfHour,
|
|
74
|
-
roundToEndOfMinute,
|
|
75
|
-
updateDateOnly,
|
|
76
|
-
updateTimeOnly
|
|
77
|
-
};
|
|
78
|
-
});
|
|
79
|
-
//# sourceMappingURL=date-time-utilities.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-time-utilities.js","sourceRoot":"","sources":["../../src/components/date-time-utilities/date-time-utilities.js"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './date-time-utilities';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/date-time-utilities/index.ts"],"names":[],"mappings":";;AAAA,iCAA8B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const angular_1 = __importDefault(require("angular"));
|
|
7
|
-
angular_1.default.module('app').directive('mflyDisableContextMenu', function mflyDisableContextMenu() {
|
|
8
|
-
return {
|
|
9
|
-
restrict: 'A',
|
|
10
|
-
scope: {
|
|
11
|
-
mflyDisableContextMenu: '<'
|
|
12
|
-
},
|
|
13
|
-
link($scope, element) {
|
|
14
|
-
// enable unless explicitly set to false
|
|
15
|
-
if ($scope.mflyDisableContextMenu !== false) {
|
|
16
|
-
element.on('contextmenu', () => {
|
|
17
|
-
return false;
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
//# sourceMappingURL=disable-context-menu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"disable-context-menu.js","sourceRoot":"","sources":["../../src/components/disable-context-menu/disable-context-menu.ts"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAE7B,iBAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,wBAAwB,EAAE,SAAS,sBAAsB;IAExF,OAAO;QAEN,QAAQ,EAAE,GAAG;QACb,KAAK,EAAE;YACN,sBAAsB,EAAE,GAAG;SAC3B;QACD,IAAI,CAAC,MAAyB,EAAE,OAA4B;YAE3D,wCAAwC;YACxC,IAAI,MAAM,CAAC,sBAAsB,KAAK,KAAK,EAAE;gBAC5C,OAAO,CAAC,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE;oBAC9B,OAAO,KAAK,CAAA;gBACb,CAAC,CAAC,CAAA;aACF;QACF,CAAC;KACD,CAAA;AACF,CAAC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './disable-context-menu';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/disable-context-menu/index.ts"],"names":[],"mappings":";;AAAA,kCAA+B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './show-image-loader';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/show-image-loader/index.ts"],"names":[],"mappings":";;AAAA,+BAA4B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const angular_1 = __importDefault(require("angular"));
|
|
7
|
-
angular_1.default.module('app').directive('mflyShowImageLoader', ['$timeout', function mflyShowImageLoader($timeout) {
|
|
8
|
-
return {
|
|
9
|
-
restrict: 'A',
|
|
10
|
-
scope: {
|
|
11
|
-
showImageLoader: '=mflyShowImageLoader',
|
|
12
|
-
src: '@',
|
|
13
|
-
},
|
|
14
|
-
link: function ($scope, element) {
|
|
15
|
-
element.bind('load', function () {
|
|
16
|
-
$timeout(function () {
|
|
17
|
-
$scope.showImageLoader = false;
|
|
18
|
-
}, 0);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
}]);
|
|
23
|
-
//# sourceMappingURL=show-image-loader.js.map
|