bfg-common 1.5.904 → 1.5.905
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/assets/localization/local_en.json +1 -1
- package/components/common/pages/scheduledTasks/modals/common/frequency/interval/Interval.vue +19 -53
- package/components/common/pages/scheduledTasks/modals/common/frequency/interval/New.vue +44 -0
- package/components/common/pages/scheduledTasks/modals/common/frequency/interval/Old.vue +68 -0
- package/components/common/pages/scheduledTasks/modals/common/frequency/lib/utils.ts +1 -1
- package/components/common/pages/scheduledTasks/modals/common/taskForm/New.vue +36 -14
- package/package.json +1 -1
package/components/common/pages/scheduledTasks/modals/common/frequency/interval/Interval.vue
CHANGED
|
@@ -1,34 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
'tooltip tooltip-validation tooltip-xs tooltip-top-left',
|
|
10
|
-
timeIntervalErrorText && 'invalid',
|
|
11
|
-
]"
|
|
12
|
-
for="frequency-time-interval"
|
|
13
|
-
>
|
|
14
|
-
<input
|
|
15
|
-
id="frequency-time-interval"
|
|
16
|
-
v-model="modelFrequencyLocal.frg_interval"
|
|
17
|
-
data-id="frequency-time-interval-input"
|
|
18
|
-
type="text"
|
|
19
|
-
@input="onInitTimeIntervalValidation"
|
|
20
|
-
@blur="onInitTimeIntervalValidation"
|
|
21
|
-
/>
|
|
22
|
-
|
|
23
|
-
<span class="tooltip-content">
|
|
24
|
-
{{ timeIntervalErrorText }}
|
|
25
|
-
</span>
|
|
26
|
-
</label>
|
|
27
|
-
|
|
28
|
-
<span class="interval__suffix">
|
|
29
|
-
{{ intervalSuffixLabel }}
|
|
30
|
-
</span>
|
|
31
|
-
</div>
|
|
2
|
+
<component
|
|
3
|
+
:is="currentComponent"
|
|
4
|
+
v-model="modelFrequencyLocal.frg_interval"
|
|
5
|
+
:time-interval-error-text="timeIntervalErrorText"
|
|
6
|
+
:time-interval-suffix-label="intervalSuffixLabel"
|
|
7
|
+
@init-validation="onInitValidation"
|
|
8
|
+
/>
|
|
32
9
|
</template>
|
|
33
10
|
|
|
34
11
|
<script lang="ts" setup>
|
|
@@ -39,17 +16,25 @@ import {
|
|
|
39
16
|
validateField,
|
|
40
17
|
} from '~/components/common/pages/scheduledTasks/modals/common/frequency/lib/utils'
|
|
41
18
|
|
|
42
|
-
const props = defineProps<{
|
|
43
|
-
type: string
|
|
44
|
-
}>()
|
|
45
19
|
const modelFrequencyLocal = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
46
20
|
required: true,
|
|
47
21
|
})
|
|
22
|
+
const props = defineProps<{
|
|
23
|
+
type: string
|
|
24
|
+
}>()
|
|
48
25
|
|
|
49
26
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
27
|
+
const { $store }: any = useNuxtApp()
|
|
28
|
+
|
|
29
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
30
|
+
const currentComponent = computed(() =>
|
|
31
|
+
isNewView.value
|
|
32
|
+
? defineAsyncComponent(() => import('./New.vue'))
|
|
33
|
+
: defineAsyncComponent(() => import('./Old.vue'))
|
|
34
|
+
)
|
|
50
35
|
|
|
51
36
|
const isInitTimeIntervalValidation = ref<boolean>(false)
|
|
52
|
-
const
|
|
37
|
+
const onInitValidation = (): void => {
|
|
53
38
|
isInitTimeIntervalValidation.value = true
|
|
54
39
|
}
|
|
55
40
|
|
|
@@ -81,22 +66,3 @@ const intervalSuffixLabel = computed<string>(() => {
|
|
|
81
66
|
)
|
|
82
67
|
})
|
|
83
68
|
</script>
|
|
84
|
-
|
|
85
|
-
<style lang="scss" scoped>
|
|
86
|
-
@import 'bfg-common/assets/scss/common/mixins.scss';
|
|
87
|
-
.interval {
|
|
88
|
-
@include flex($align: center);
|
|
89
|
-
margin-top: 10px;
|
|
90
|
-
&__prefix {
|
|
91
|
-
white-space: nowrap;
|
|
92
|
-
}
|
|
93
|
-
.tooltip {
|
|
94
|
-
& > .tooltip-content {
|
|
95
|
-
width: 10rem;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
input {
|
|
99
|
-
width: 70px;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="frequency-interval">
|
|
3
|
+
<h2>{{ localization.scheduledTasks.repeatEvery }}</h2>
|
|
4
|
+
<ui-input
|
|
5
|
+
id="ip-address"
|
|
6
|
+
v-model="intervalModel"
|
|
7
|
+
:error="props.timeIntervalErrorText"
|
|
8
|
+
:placeholder="localization.common.value"
|
|
9
|
+
test-id="frequency-time-interval-input"
|
|
10
|
+
autocomplete="off"
|
|
11
|
+
type="number"
|
|
12
|
+
@input="onInitValidation"
|
|
13
|
+
></ui-input>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script lang="ts" setup>
|
|
18
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
19
|
+
|
|
20
|
+
const intervalModel = defineModel<number>({ required: true })
|
|
21
|
+
const props = defineProps<{
|
|
22
|
+
timeIntervalErrorText: string
|
|
23
|
+
intervalSuffixLabel: string
|
|
24
|
+
}>()
|
|
25
|
+
const emits = defineEmits<{
|
|
26
|
+
(event: 'init-validation'): void
|
|
27
|
+
}>()
|
|
28
|
+
|
|
29
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
30
|
+
|
|
31
|
+
const onInitValidation = (): void => emits('init-validation')
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<style lang="scss" scoped>
|
|
35
|
+
.frequency-interval {
|
|
36
|
+
h2 {
|
|
37
|
+
font-family: 'Inter', sans-serif;
|
|
38
|
+
color: var(--title-form-first-color);
|
|
39
|
+
font-size: 14px;
|
|
40
|
+
font-weight: 500;
|
|
41
|
+
margin-bottom: 12px;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
</style>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="interval clr-col-6 pl-0">
|
|
3
|
+
<span class="interval__prefix">
|
|
4
|
+
{{ localization.scheduledTasks.repeatEvery }}
|
|
5
|
+
</span>
|
|
6
|
+
|
|
7
|
+
<label
|
|
8
|
+
:class="[
|
|
9
|
+
'tooltip tooltip-validation tooltip-xs tooltip-top-left',
|
|
10
|
+
props.timeIntervalErrorText && 'invalid',
|
|
11
|
+
]"
|
|
12
|
+
for="frequency-time-interval"
|
|
13
|
+
>
|
|
14
|
+
<input
|
|
15
|
+
id="frequency-time-interval"
|
|
16
|
+
v-model="intervalModel"
|
|
17
|
+
data-id="frequency-time-interval-input"
|
|
18
|
+
type="text"
|
|
19
|
+
@input="onInitValidation"
|
|
20
|
+
@blur="onInitValidation"
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
<span class="tooltip-content">
|
|
24
|
+
{{ props.timeIntervalErrorText }}
|
|
25
|
+
</span>
|
|
26
|
+
</label>
|
|
27
|
+
|
|
28
|
+
<span class="interval__suffix">
|
|
29
|
+
{{ props.intervalSuffixLabel }}
|
|
30
|
+
</span>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script lang="ts" setup>
|
|
35
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
36
|
+
|
|
37
|
+
const intervalModel = defineModel<number>({ required: true })
|
|
38
|
+
const props = defineProps<{
|
|
39
|
+
timeIntervalErrorText: string
|
|
40
|
+
intervalSuffixLabel: string
|
|
41
|
+
}>()
|
|
42
|
+
const emits = defineEmits<{
|
|
43
|
+
(event: 'init-validation'): void
|
|
44
|
+
}>()
|
|
45
|
+
|
|
46
|
+
const onInitValidation = (): void => emits('init-validation')
|
|
47
|
+
|
|
48
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<style lang="scss" scoped>
|
|
52
|
+
@import 'bfg-common/assets/scss/common/mixins.scss';
|
|
53
|
+
.interval {
|
|
54
|
+
@include flex($align: center);
|
|
55
|
+
margin-top: 10px;
|
|
56
|
+
&__prefix {
|
|
57
|
+
white-space: nowrap;
|
|
58
|
+
}
|
|
59
|
+
.tooltip {
|
|
60
|
+
& > .tooltip-content {
|
|
61
|
+
width: 10rem;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
input {
|
|
65
|
+
width: 70px;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
</style>
|
|
@@ -38,20 +38,31 @@
|
|
|
38
38
|
<div class="form__run">
|
|
39
39
|
<h2>{{ localization.common.run }}</h2>
|
|
40
40
|
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
41
|
+
<div
|
|
42
|
+
class="form__run-frequency"
|
|
43
|
+
:class="model.frequency === 'once' && 'grid-single-col'"
|
|
44
|
+
>
|
|
45
|
+
<div>
|
|
46
|
+
<h2 class="frequency">
|
|
47
|
+
{{ localization.scheduledTasks.frequency }}
|
|
48
|
+
</h2>
|
|
49
|
+
<ui-select
|
|
50
|
+
v-model="model.frequency"
|
|
51
|
+
:items="frequencyMethodOptionsLocal"
|
|
52
|
+
test-id="schedule-task-frequency-select"
|
|
53
|
+
:placeholder="localization.scheduledTasks.selectFrequency"
|
|
54
|
+
size="md"
|
|
55
|
+
select-width="100%"
|
|
56
|
+
class="mt-3"
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<common-pages-scheduled-tasks-modals-common-frequency
|
|
61
|
+
v-if="model.frequency"
|
|
62
|
+
v-model="model"
|
|
63
|
+
:type="model.frequency"
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
55
66
|
</div>
|
|
56
67
|
|
|
57
68
|
<div class="form__email">
|
|
@@ -152,6 +163,17 @@ const frequencyMethodOptionsLocal = computed<UI_I_Dropdown[]>(() =>
|
|
|
152
163
|
padding-top: 16px;
|
|
153
164
|
}
|
|
154
165
|
|
|
166
|
+
&__run {
|
|
167
|
+
&-frequency {
|
|
168
|
+
display: grid;
|
|
169
|
+
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
|
|
170
|
+
grid-gap: 16px;
|
|
171
|
+
&.grid-single-col {
|
|
172
|
+
grid-template-columns: 1fr;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
155
177
|
h2 {
|
|
156
178
|
font-family: 'Inter', sans-serif;
|
|
157
179
|
color: var(--title-form-first-color);
|