bfg-common 1.5.921 → 1.5.923
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_be.json +4 -16
- package/assets/localization/local_en.json +4 -16
- package/assets/localization/local_hy.json +4 -16
- package/assets/localization/local_kk.json +4 -16
- package/assets/localization/local_ru.json +4 -16
- package/assets/localization/local_zh.json +4 -16
- package/components/common/pages/scheduledTasks/lib/models/interfaces.ts +0 -6
- package/components/common/pages/scheduledTasks/modals/common/frequency/Frequency.vue +42 -46
- package/components/common/pages/scheduledTasks/modals/common/frequency/afterStartup/AfterStartup.vue +48 -15
- package/components/common/pages/scheduledTasks/modals/common/frequency/end/End.vue +69 -15
- package/components/common/pages/scheduledTasks/modals/common/frequency/interval/Interval.vue +53 -19
- package/components/common/pages/scheduledTasks/modals/common/frequency/lib/utils.ts +1 -1
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/On.vue +168 -28
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/lib/config/options.ts +0 -17
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/SelectWeek.vue +28 -17
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/lib/config/weekOptions.ts +50 -20
- package/components/common/pages/scheduledTasks/modals/common/frequency/startOn/StartOn.vue +51 -15
- package/components/common/pages/scheduledTasks/modals/common/{taskForm/Old.vue → newTaskForm/NewTaskForm.vue} +69 -12
- package/components/common/pages/scheduledTasks/table/Table.vue +81 -27
- package/components/common/pages/scheduledTasks/table/expandDetails/ExpandDetails.vue +2 -2
- package/components/common/pages/scheduledTasks/table/expandDetails/New.vue +17 -48
- package/components/common/pages/scheduledTasks/table/expandDetails/Old.vue +3 -1
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/HistoryRun.vue +54 -16
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/{old/lib → lib}/config/historyRunsTable.ts +4 -4
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/{old/lib → lib}/config/tableKeys.ts +1 -1
- package/components/common/pages/scheduledTasks/table/expandDetails/lib/config/expandDetails.ts +5 -7
- package/components/common/pages/scheduledTasks/table/{old/lib → lib}/config/scheduledTasksTable.ts +9 -13
- package/components/common/pages/scheduledTasks/table/lib/config/schedulerStatus.ts +4 -0
- package/components/common/pages/scheduledTasks/table/{old/lib → lib}/config/tableKeys.ts +1 -1
- package/components/common/pages/scheduledTasks/table/lib/models/interfaces.ts +11 -0
- package/package.json +1 -1
- package/components/common/pages/scheduledTasks/modals/common/frequency/afterStartup/New.vue +0 -43
- package/components/common/pages/scheduledTasks/modals/common/frequency/afterStartup/Old.vue +0 -65
- package/components/common/pages/scheduledTasks/modals/common/frequency/end/New.vue +0 -73
- package/components/common/pages/scheduledTasks/modals/common/frequency/end/Old.vue +0 -112
- package/components/common/pages/scheduledTasks/modals/common/frequency/interval/New.vue +0 -49
- package/components/common/pages/scheduledTasks/modals/common/frequency/interval/Old.vue +0 -68
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/New.vue +0 -137
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/Old.vue +0 -234
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/New.vue +0 -66
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/Old.vue +0 -44
- package/components/common/pages/scheduledTasks/modals/common/frequency/startOn/New.vue +0 -46
- package/components/common/pages/scheduledTasks/modals/common/frequency/startOn/Old.vue +0 -77
- package/components/common/pages/scheduledTasks/modals/common/taskForm/New.vue +0 -194
- package/components/common/pages/scheduledTasks/modals/common/taskForm/TaskForm.vue +0 -129
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/new/New.vue +0 -147
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/new/lib/config/historyRunsTable.ts +0 -161
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/old/Old.vue +0 -68
- package/components/common/pages/scheduledTasks/table/expandDetails/lib/models/interfaces.ts +0 -8
- package/components/common/pages/scheduledTasks/table/lib/models/enums.ts +0 -4
- package/components/common/pages/scheduledTasks/table/new/New.vue +0 -320
- package/components/common/pages/scheduledTasks/table/new/lib/config/scheduledTasksTable.ts +0 -218
- package/components/common/pages/scheduledTasks/table/new/lib/models/enums.ts +0 -14
- package/components/common/pages/scheduledTasks/table/old/Old.vue +0 -93
- /package/components/common/pages/scheduledTasks/modals/common/{taskForm → newTaskForm}/lib/models/interfaces.ts +0 -0
- /package/components/common/pages/scheduledTasks/modals/common/{taskForm → newTaskForm}/lib/utils.ts +0 -0
- /package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/{old/lib → lib}/models/types.ts +0 -0
- /package/components/common/pages/scheduledTasks/table/{old/lib → lib}/models/types.ts +0 -0
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="on-time">
|
|
3
|
-
<label class="on-time__label">
|
|
4
|
-
{{ localization.common.on }}
|
|
5
|
-
</label>
|
|
6
|
-
|
|
7
|
-
<common-pages-scheduled-tasks-modals-common-frequency-on-select-week
|
|
8
|
-
v-if="props.type === 'week'"
|
|
9
|
-
v-model="scheduledTaskFormLocal"
|
|
10
|
-
/>
|
|
11
|
-
|
|
12
|
-
<div v-if="props.type === 'month'">
|
|
13
|
-
<div class="on-time__radio radio">
|
|
14
|
-
<input
|
|
15
|
-
id="on-time-monthly-by-day"
|
|
16
|
-
v-model="scheduledTaskFormLocal.frg_monthly_mode"
|
|
17
|
-
data-id="on-time-monthly-by-day"
|
|
18
|
-
type="radio"
|
|
19
|
-
value="day"
|
|
20
|
-
class="custom-radio-button"
|
|
21
|
-
name="name"
|
|
22
|
-
/>
|
|
23
|
-
<label for="on-time-monthly-by-day" class="custom-radio-label">
|
|
24
|
-
{{ localization.scheduledTasks.day }}
|
|
25
|
-
</label>
|
|
26
|
-
|
|
27
|
-
<label
|
|
28
|
-
:class="[
|
|
29
|
-
'tooltip tooltip-validation tooltip-xs tooltip-top-left',
|
|
30
|
-
schedulerOnDayErrorText && 'invalid',
|
|
31
|
-
]"
|
|
32
|
-
for="monthly-by-day-field"
|
|
33
|
-
>
|
|
34
|
-
<input
|
|
35
|
-
id="monthly-by-day-field"
|
|
36
|
-
v-model="scheduledTaskFormLocal.frg_monthly_day"
|
|
37
|
-
:disabled="isDisabledMonthlyDayField"
|
|
38
|
-
data-id="edit-lockout-policy-time-interval-input"
|
|
39
|
-
type="text"
|
|
40
|
-
class="monthly-day-field"
|
|
41
|
-
@input="onInitTimeIntervalValidation"
|
|
42
|
-
@blur="onInitTimeIntervalValidation"
|
|
43
|
-
/>
|
|
44
|
-
|
|
45
|
-
<span class="tooltip-content">
|
|
46
|
-
{{ schedulerOnDayErrorText }}
|
|
47
|
-
</span>
|
|
48
|
-
</label>
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
<div class="on-time__radio radio">
|
|
52
|
-
<input
|
|
53
|
-
id="on-time-monthly-by-week"
|
|
54
|
-
v-model="scheduledTaskFormLocal.frg_monthly_mode"
|
|
55
|
-
data-id="on-time-monthly-by-week"
|
|
56
|
-
type="radio"
|
|
57
|
-
value="week"
|
|
58
|
-
class="custom-radio-button"
|
|
59
|
-
name="name"
|
|
60
|
-
/>
|
|
61
|
-
|
|
62
|
-
<label for="on-time-monthly-by-week" class="custom-radio-label mr-6">
|
|
63
|
-
{{ localization.scheduledTasks.the }}
|
|
64
|
-
</label>
|
|
65
|
-
<common-select-input
|
|
66
|
-
v-model="scheduledTaskFormLocal.frq_ordinal_number"
|
|
67
|
-
:data="props.frequencyOnOrdinalNumber"
|
|
68
|
-
:class="[
|
|
69
|
-
'radio__select ordinary-day',
|
|
70
|
-
!isDisabledMonthlyDayField && 'disabled',
|
|
71
|
-
]"
|
|
72
|
-
/>
|
|
73
|
-
|
|
74
|
-
<common-select-input
|
|
75
|
-
v-model="scheduledTaskFormLocal.frq_week_day"
|
|
76
|
-
:data="props.frequencyOnWeeksDays"
|
|
77
|
-
:class="[
|
|
78
|
-
'radio__select week-days',
|
|
79
|
-
!isDisabledMonthlyDayField && 'disabled',
|
|
80
|
-
]"
|
|
81
|
-
/>
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<label
|
|
86
|
-
v-if="props.type === 'once'"
|
|
87
|
-
:class="[
|
|
88
|
-
'tooltip tooltip-validation tooltip-xs tooltip-top-left',
|
|
89
|
-
schedulerAtOnceErrorText && 'invalid',
|
|
90
|
-
]"
|
|
91
|
-
for="frequency-on-date"
|
|
92
|
-
>
|
|
93
|
-
<input
|
|
94
|
-
id="frequency-on-date"
|
|
95
|
-
v-model.lazy="scheduledTaskFormLocal.frg_on_time"
|
|
96
|
-
data-id="frequency-on-date-input"
|
|
97
|
-
type="datetime-local"
|
|
98
|
-
/>
|
|
99
|
-
|
|
100
|
-
<span class="tooltip-content">
|
|
101
|
-
{{ schedulerAtOnceErrorText }}
|
|
102
|
-
</span>
|
|
103
|
-
</label>
|
|
104
|
-
</div>
|
|
105
|
-
</template>
|
|
106
|
-
|
|
107
|
-
<script lang="ts" setup>
|
|
108
|
-
import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
|
|
109
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
110
|
-
import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
|
|
111
|
-
import {
|
|
112
|
-
validateDate,
|
|
113
|
-
validateField,
|
|
114
|
-
} from '~/components/common/pages/scheduledTasks/modals/common/frequency/lib/utils'
|
|
115
|
-
|
|
116
|
-
const scheduledTaskFormLocal = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
117
|
-
required: true,
|
|
118
|
-
})
|
|
119
|
-
const props = defineProps<{
|
|
120
|
-
type: string
|
|
121
|
-
frequencyOnWeeksDays: UI_I_SelectInputItem[]
|
|
122
|
-
frequencyOnOrdinalNumber: UI_I_SelectInputItem[]
|
|
123
|
-
}>()
|
|
124
|
-
|
|
125
|
-
const { $formattedDatetime }: any = useNuxtApp()
|
|
126
|
-
|
|
127
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
128
|
-
|
|
129
|
-
const isDisabledMonthlyDayField = computed<boolean>(
|
|
130
|
-
() => scheduledTaskFormLocal.value.frg_monthly_mode === 'week'
|
|
131
|
-
)
|
|
132
|
-
|
|
133
|
-
const isInitTimeIntervalValidation = ref<boolean>(false)
|
|
134
|
-
const onInitTimeIntervalValidation = (): void => {
|
|
135
|
-
isInitTimeIntervalValidation.value = true
|
|
136
|
-
}
|
|
137
|
-
const schedulerOnDayErrorText = computed<string>(() => {
|
|
138
|
-
if (!isInitTimeIntervalValidation.value || isDisabledMonthlyDayField.value)
|
|
139
|
-
return ''
|
|
140
|
-
|
|
141
|
-
return validateField(
|
|
142
|
-
localization.value,
|
|
143
|
-
scheduledTaskFormLocal.value.frg_monthly_day,
|
|
144
|
-
true,
|
|
145
|
-
true
|
|
146
|
-
)
|
|
147
|
-
})
|
|
148
|
-
watch(
|
|
149
|
-
schedulerOnDayErrorText,
|
|
150
|
-
(newValue: string) => {
|
|
151
|
-
scheduledTaskFormLocal.value.isValid = !!newValue
|
|
152
|
-
},
|
|
153
|
-
{ immediate: true }
|
|
154
|
-
)
|
|
155
|
-
|
|
156
|
-
const schedulerAtOnceErrorText = computed<string>(() => {
|
|
157
|
-
return !scheduledTaskFormLocal.value.frg_on_time
|
|
158
|
-
? localization.value.common.fieldRequired
|
|
159
|
-
: validateDate(localization.value, scheduledTaskFormLocal.value.frg_on_time)
|
|
160
|
-
})
|
|
161
|
-
watch(
|
|
162
|
-
schedulerAtOnceErrorText,
|
|
163
|
-
(newValue: string) => {
|
|
164
|
-
scheduledTaskFormLocal.value.isValid = !!newValue
|
|
165
|
-
},
|
|
166
|
-
{ immediate: true }
|
|
167
|
-
)
|
|
168
|
-
|
|
169
|
-
onMounted(() => {
|
|
170
|
-
props.type === 'once' && setDefaultDateTime()
|
|
171
|
-
})
|
|
172
|
-
const setDefaultDateTime = () => {
|
|
173
|
-
scheduledTaskFormLocal.value.frg_on_time = $formattedDatetime(new Date(), {
|
|
174
|
-
formatDate: 'yyyy-MM-dd',
|
|
175
|
-
separator: ' ',
|
|
176
|
-
formatTime: 'HH:mm',
|
|
177
|
-
})
|
|
178
|
-
}
|
|
179
|
-
</script>
|
|
180
|
-
|
|
181
|
-
<style lang="scss" scoped>
|
|
182
|
-
@import 'bfg-common/assets/scss/common/mixins.scss';
|
|
183
|
-
.on-time {
|
|
184
|
-
display: flex;
|
|
185
|
-
margin-top: 25px;
|
|
186
|
-
&__label {
|
|
187
|
-
font-weight: 400;
|
|
188
|
-
padding-left: 0;
|
|
189
|
-
margin-right: 15px;
|
|
190
|
-
}
|
|
191
|
-
&__radio {
|
|
192
|
-
@include flex($align: center);
|
|
193
|
-
.monthly-day-field {
|
|
194
|
-
width: 110px;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
.radio {
|
|
199
|
-
&__select {
|
|
200
|
-
width: 100%;
|
|
201
|
-
margin-top: 10px;
|
|
202
|
-
:deep(.select-input__inner) {
|
|
203
|
-
max-width: 100% !important;
|
|
204
|
-
min-width: max-content;
|
|
205
|
-
}
|
|
206
|
-
&.ordinary-day :deep(select) {
|
|
207
|
-
min-width: 80px;
|
|
208
|
-
}
|
|
209
|
-
&.week-days {
|
|
210
|
-
margin-left: 15px;
|
|
211
|
-
:deep(select) {
|
|
212
|
-
min-width: 110px;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
select {
|
|
216
|
-
width: 80px;
|
|
217
|
-
}
|
|
218
|
-
&.disabled {
|
|
219
|
-
opacity: 0.6;
|
|
220
|
-
pointer-events: none;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
.tooltip {
|
|
226
|
-
& > .tooltip-content {
|
|
227
|
-
width: 200px;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
input[type='radio']:focus:checked + label::before,
|
|
231
|
-
input[type='radio']:focus + label::before {
|
|
232
|
-
box-shadow: inset 0 0 0 0.25rem #0094d2;
|
|
233
|
-
}
|
|
234
|
-
</style>
|
package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/New.vue
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flex items-center column-gap-3 frequency-week-days">
|
|
3
|
-
<ui-block
|
|
4
|
-
v-for="item in props.tabs"
|
|
5
|
-
:key="item.value"
|
|
6
|
-
:class="{ selected: item.isActive }"
|
|
7
|
-
@click="onSelectDay(item.value)"
|
|
8
|
-
>
|
|
9
|
-
<div class="main-info">
|
|
10
|
-
<span class="main-info-label">{{ item.name }}</span>
|
|
11
|
-
</div>
|
|
12
|
-
</ui-block>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script lang="ts" setup>
|
|
17
|
-
import type { UI_I_SelectWeekDayTab } from '~/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/lib/models/interfaces'
|
|
18
|
-
|
|
19
|
-
const props = defineProps<{
|
|
20
|
-
tabs: UI_I_SelectWeekDayTab[]
|
|
21
|
-
}>()
|
|
22
|
-
const emits = defineEmits<{
|
|
23
|
-
(event: 'select-day', value: number): void
|
|
24
|
-
}>()
|
|
25
|
-
|
|
26
|
-
const onSelectDay = (value: number): void => {
|
|
27
|
-
emits('select-day', value)
|
|
28
|
-
}
|
|
29
|
-
</script>
|
|
30
|
-
|
|
31
|
-
<style lang="scss" scoped>
|
|
32
|
-
.frequency-week-days {
|
|
33
|
-
:deep(.block) {
|
|
34
|
-
width: max-content;
|
|
35
|
-
padding: 10px 12px;
|
|
36
|
-
color: var(--feedback-text-color);
|
|
37
|
-
background: var(--feedback-tab-bg-color);
|
|
38
|
-
box-shadow: inset 0 0 0 1px var(--feedback-tab-border-color);
|
|
39
|
-
cursor: pointer;
|
|
40
|
-
|
|
41
|
-
&.selected {
|
|
42
|
-
box-shadow: inset 0 0 0 1.5px var(--feedback-tab-active-text-color);
|
|
43
|
-
color: var(--feedback-tab-active-text-color);
|
|
44
|
-
cursor: default;
|
|
45
|
-
}
|
|
46
|
-
&:not(.selected):hover {
|
|
47
|
-
background: var(--feedback-tab-hover-bg-color);
|
|
48
|
-
}
|
|
49
|
-
&.selected:hover {
|
|
50
|
-
background: #f0f8fd;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.main-info {
|
|
55
|
-
display: flex;
|
|
56
|
-
align-items: center;
|
|
57
|
-
gap: 8px;
|
|
58
|
-
|
|
59
|
-
&-label {
|
|
60
|
-
font-size: 13px;
|
|
61
|
-
font-weight: 500;
|
|
62
|
-
line-height: 15.73px;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
</style>
|
package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/Old.vue
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- TODO это компонент уже есть надо сделат одну но не ламать функционалность -->
|
|
3
|
-
<div class="flex-align-center">
|
|
4
|
-
<div class="btn-group">
|
|
5
|
-
<button
|
|
6
|
-
v-for="item in props.tabs"
|
|
7
|
-
:key="item"
|
|
8
|
-
:data-id="item.testId"
|
|
9
|
-
:class="['btn btn-sm btn-secondary', { 'btn-primary': item.isActive }]"
|
|
10
|
-
@click="onSelectDay(item.value)"
|
|
11
|
-
>
|
|
12
|
-
{{ item.name }}
|
|
13
|
-
</button>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script lang="ts" setup>
|
|
19
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
20
|
-
import type { UI_I_SelectWeekDayTab } from '~/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/lib/models/interfaces'
|
|
21
|
-
|
|
22
|
-
const props = defineProps<{
|
|
23
|
-
tabs: UI_I_SelectWeekDayTab[]
|
|
24
|
-
}>()
|
|
25
|
-
const emits = defineEmits<{
|
|
26
|
-
(event: 'select-day', value: number): void
|
|
27
|
-
}>()
|
|
28
|
-
|
|
29
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
30
|
-
|
|
31
|
-
const onSelectDay = (value: number): void => {
|
|
32
|
-
emits('select-day', value)
|
|
33
|
-
}
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<style lang="scss" scoped>
|
|
37
|
-
.btn-group {
|
|
38
|
-
margin-right: 0;
|
|
39
|
-
button {
|
|
40
|
-
padding: 0 0.5rem;
|
|
41
|
-
min-width: 24px;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
</style>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="frequency-start-on">
|
|
3
|
-
<h2>{{ localization.common.start }}</h2>
|
|
4
|
-
<ui-input-with-datepicker
|
|
5
|
-
id="frequency-start-on-date"
|
|
6
|
-
v-model="modelFrequencyLocal.frg_start_on_time"
|
|
7
|
-
:format="datepickerFormat"
|
|
8
|
-
test-id="frequency-start-on-date-input"
|
|
9
|
-
time-format="12"
|
|
10
|
-
:error="''"
|
|
11
|
-
:error-timepicker="''"
|
|
12
|
-
/>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script lang="ts" setup>
|
|
17
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
18
|
-
import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
|
|
19
|
-
import { getUiDatepickerFormatByLanguage } from '~/lib/utils/date'
|
|
20
|
-
|
|
21
|
-
const modelFrequencyLocal = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
22
|
-
required: true,
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
26
|
-
|
|
27
|
-
const datepickerFormat = computed<string>(
|
|
28
|
-
() => getUiDatepickerFormatByLanguage('en_US') // TODO из пропс должен приходить язык
|
|
29
|
-
)
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
<style lang="scss" scoped>
|
|
33
|
-
.frequency-start-on {
|
|
34
|
-
grid-column: span 2;
|
|
35
|
-
border-top: 1px solid var(--horizontal-line);
|
|
36
|
-
padding-top: 16px;
|
|
37
|
-
h2 {
|
|
38
|
-
font-family: 'Inter', sans-serif;
|
|
39
|
-
color: var(--title-form-first-color);
|
|
40
|
-
font-size: 14px;
|
|
41
|
-
font-weight: 500;
|
|
42
|
-
line-height: 18px;
|
|
43
|
-
margin-bottom: 12px;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
</style>
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="start-on">
|
|
3
|
-
<label class="clr-control-label clr-col-2 pl-0 start-on__label">
|
|
4
|
-
{{ localization.scheduledTasks.startOn }}
|
|
5
|
-
</label>
|
|
6
|
-
|
|
7
|
-
<label
|
|
8
|
-
:class="[
|
|
9
|
-
'tooltip tooltip-validation tooltip-xs tooltip-top-left',
|
|
10
|
-
schedulerStartOnErrorText && 'invalid',
|
|
11
|
-
]"
|
|
12
|
-
for="frequency-start-on-date"
|
|
13
|
-
>
|
|
14
|
-
<input
|
|
15
|
-
id="frequency-start-on-date"
|
|
16
|
-
v-model.lazy="modelFrequencyLocal.frg_start_on_time"
|
|
17
|
-
data-id="frequency-start-on-date-input"
|
|
18
|
-
type="datetime-local"
|
|
19
|
-
/>
|
|
20
|
-
|
|
21
|
-
<span class="tooltip-content">
|
|
22
|
-
{{ schedulerStartOnErrorText }}
|
|
23
|
-
</span>
|
|
24
|
-
</label>
|
|
25
|
-
</div>
|
|
26
|
-
</template>
|
|
27
|
-
|
|
28
|
-
<script lang="ts" setup>
|
|
29
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
30
|
-
import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
|
|
31
|
-
import { validateDate } from '~/components/common/pages/scheduledTasks/modals/common/frequency/lib/utils'
|
|
32
|
-
|
|
33
|
-
const modelFrequencyLocal = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
34
|
-
required: true,
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
39
|
-
// const { $formattedDate, $isDate, $getUnixByDate }: any = useNuxtApp()
|
|
40
|
-
|
|
41
|
-
const schedulerStartOnErrorText = computed<string>(() => {
|
|
42
|
-
return !modelFrequencyLocal.value.frg_start_on_time
|
|
43
|
-
? localization.value.common.fieldRequired
|
|
44
|
-
: validateDate(
|
|
45
|
-
localization.value,
|
|
46
|
-
modelFrequencyLocal.value.frg_start_on_time
|
|
47
|
-
)
|
|
48
|
-
})
|
|
49
|
-
watch(
|
|
50
|
-
schedulerStartOnErrorText,
|
|
51
|
-
(newValue: string) => {
|
|
52
|
-
modelFrequencyLocal.value.isValid = !!newValue
|
|
53
|
-
},
|
|
54
|
-
{ immediate: true }
|
|
55
|
-
)
|
|
56
|
-
</script>
|
|
57
|
-
|
|
58
|
-
<style lang="scss" scoped>
|
|
59
|
-
@import 'bfg-common/assets/scss/common/mixins.scss';
|
|
60
|
-
.start-on {
|
|
61
|
-
@include flex($align: center);
|
|
62
|
-
margin-top: 10px;
|
|
63
|
-
&__select-input {
|
|
64
|
-
:deep(.select-input__label) {
|
|
65
|
-
font-weight: 400;
|
|
66
|
-
}
|
|
67
|
-
:deep(.select) {
|
|
68
|
-
max-width: 80px !important;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
.tooltip {
|
|
73
|
-
& > .tooltip-content {
|
|
74
|
-
width: 200px;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
</style>
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<form class="form" @submit.prevent>
|
|
3
|
-
<section class="flex flex-direction-column row-gap-6">
|
|
4
|
-
<div class="flex justify-between column-gap-4 form__target">
|
|
5
|
-
<div class="flex items-center column-gap-2 text-ellipsis">
|
|
6
|
-
<p class="text">{{ localization.common.target }}:</p>
|
|
7
|
-
<span class="icon vsphere-icon-vm"></span>
|
|
8
|
-
<span class="text">{{ props.target }}</span>
|
|
9
|
-
</div>
|
|
10
|
-
<div class="flex items-center column-gap-3">
|
|
11
|
-
<p class="text">{{ localization.common.active }}</p>
|
|
12
|
-
<ui-switch
|
|
13
|
-
v-model="model.toggle"
|
|
14
|
-
test-id="scheduled-task-active-switch-input"
|
|
15
|
-
/>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<ui-input
|
|
20
|
-
id="schedule-task-name-field"
|
|
21
|
-
v-model="model.task_name"
|
|
22
|
-
:label="localization.common.taskName"
|
|
23
|
-
:error="props.taskNameErrorText"
|
|
24
|
-
test-id="schedule-task-name-field"
|
|
25
|
-
class="form__user-name"
|
|
26
|
-
@input="onInitValidation(['taskName'])"
|
|
27
|
-
/>
|
|
28
|
-
|
|
29
|
-
<ui-textarea
|
|
30
|
-
id="description"
|
|
31
|
-
v-model="model.description"
|
|
32
|
-
:label="textareaLabel"
|
|
33
|
-
test-id="schedule-task-description-field"
|
|
34
|
-
height="84"
|
|
35
|
-
class="form__description"
|
|
36
|
-
/>
|
|
37
|
-
|
|
38
|
-
<div class="form__run">
|
|
39
|
-
<h2>{{ localization.common.run }}</h2>
|
|
40
|
-
|
|
41
|
-
<div
|
|
42
|
-
class="form__run-frequency"
|
|
43
|
-
:class="{
|
|
44
|
-
'grid-single-col': !model.frequency || model.frequency === 'once',
|
|
45
|
-
}"
|
|
46
|
-
>
|
|
47
|
-
<div>
|
|
48
|
-
<h2 class="frequency">
|
|
49
|
-
{{ localization.scheduledTasks.frequency }}
|
|
50
|
-
</h2>
|
|
51
|
-
<ui-select
|
|
52
|
-
v-model="model.frequency"
|
|
53
|
-
:items="frequencyMethodOptionsLocal"
|
|
54
|
-
test-id="schedule-task-frequency-select"
|
|
55
|
-
:placeholder="localization.scheduledTasks.selectFrequency"
|
|
56
|
-
size="md"
|
|
57
|
-
select-width="100%"
|
|
58
|
-
class="mt-3"
|
|
59
|
-
/>
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
<common-pages-scheduled-tasks-modals-common-frequency
|
|
63
|
-
v-if="model.frequency"
|
|
64
|
-
v-model="model"
|
|
65
|
-
:type="model.frequency"
|
|
66
|
-
:template-view-mode="props.templateViewMode"
|
|
67
|
-
/>
|
|
68
|
-
</div>
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
<div class="form__email">
|
|
72
|
-
<h2>{{ emailCompletionLabel }}</h2>
|
|
73
|
-
<ui-textarea
|
|
74
|
-
id="email-completion"
|
|
75
|
-
v-model="model.ntfn_target"
|
|
76
|
-
placeholder="example1@email.com,example2@email.com"
|
|
77
|
-
test-id="schedule-task-email-completion-field"
|
|
78
|
-
height="84"
|
|
79
|
-
class="form__description"
|
|
80
|
-
/>
|
|
81
|
-
</div>
|
|
82
|
-
</section>
|
|
83
|
-
</form>
|
|
84
|
-
</template>
|
|
85
|
-
|
|
86
|
-
<script lang="ts" setup>
|
|
87
|
-
import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
|
|
88
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
89
|
-
import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
|
|
90
|
-
import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
|
|
91
|
-
import type { UI_I_InitialValidationFields } from '~/components/common/pages/scheduledTasks/modals/common/taskForm/lib/models/interfaces'
|
|
92
|
-
|
|
93
|
-
const model = defineModel<UI_I_ScheduleNewTasksForm>({ required: true })
|
|
94
|
-
const props = defineProps<{
|
|
95
|
-
target: string
|
|
96
|
-
formValidationFields: UI_I_InitialValidationFields
|
|
97
|
-
taskNameErrorText: string
|
|
98
|
-
frequencyMethodOptions: UI_I_SelectInputItem[]
|
|
99
|
-
templateViewMode: 'horizontal' | 'vertical'
|
|
100
|
-
}>()
|
|
101
|
-
const emits = defineEmits<{
|
|
102
|
-
(event: 'init-validation', value: string[]): void
|
|
103
|
-
}>()
|
|
104
|
-
|
|
105
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
106
|
-
|
|
107
|
-
const onInitValidation = (types: string[]): void => {
|
|
108
|
-
emits('init-validation', types)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const textareaLabel = computed<string>(() => {
|
|
112
|
-
const { description, optional } = localization.value.common
|
|
113
|
-
return `${description} (${optional})`
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
const emailCompletionLabel = computed<string>(() => {
|
|
117
|
-
const { emailNotificationUponCompletion, optional } =
|
|
118
|
-
localization.value.common
|
|
119
|
-
return `${emailNotificationUponCompletion} (${optional})`
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
const frequencyMethodOptionsLocal = computed<UI_I_Dropdown[]>(() =>
|
|
123
|
-
props.frequencyMethodOptions
|
|
124
|
-
.filter((frequency: UI_I_SelectInputItem) => frequency.value !== '')
|
|
125
|
-
.map((item: UI_I_SelectInputItem) => ({
|
|
126
|
-
...item,
|
|
127
|
-
text: item.label,
|
|
128
|
-
}))
|
|
129
|
-
)
|
|
130
|
-
</script>
|
|
131
|
-
|
|
132
|
-
<style lang="scss" scoped>
|
|
133
|
-
.form {
|
|
134
|
-
&__target {
|
|
135
|
-
background-color: var(--info-block-bg);
|
|
136
|
-
border-radius: 8px;
|
|
137
|
-
padding: 12px;
|
|
138
|
-
.text {
|
|
139
|
-
font-family: 'Inter', sans-serif;
|
|
140
|
-
font-size: 13px;
|
|
141
|
-
font-weight: 400;
|
|
142
|
-
color: var(--title-form-first-color);
|
|
143
|
-
}
|
|
144
|
-
/* Target */
|
|
145
|
-
> div:first-child p.text {
|
|
146
|
-
color: #9da6ad; // for dark and light theme
|
|
147
|
-
}
|
|
148
|
-
/* Active */
|
|
149
|
-
> div:last-child p.text {
|
|
150
|
-
text-transform: Capitalize;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
span.text {
|
|
154
|
-
color: var(--title-color);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.icon {
|
|
158
|
-
min-width: 20px;
|
|
159
|
-
width: 20px;
|
|
160
|
-
height: 20px;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
&__run,
|
|
165
|
-
&__email {
|
|
166
|
-
border-top: 1px solid var(--horizontal-line);
|
|
167
|
-
padding-top: 16px;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
&__run {
|
|
171
|
-
&-frequency {
|
|
172
|
-
display: grid;
|
|
173
|
-
grid-template-columns: 1fr 1fr;
|
|
174
|
-
grid-gap: 16px;
|
|
175
|
-
&.grid-single-col {
|
|
176
|
-
grid-template-columns: 1fr;
|
|
177
|
-
column-gap: 0;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
h2 {
|
|
183
|
-
font-family: 'Inter', sans-serif;
|
|
184
|
-
color: var(--title-form-first-color);
|
|
185
|
-
font-size: 16px;
|
|
186
|
-
font-weight: 500;
|
|
187
|
-
margin-bottom: 16px;
|
|
188
|
-
&.frequency {
|
|
189
|
-
font-size: 14px;
|
|
190
|
-
margin-bottom: 12px;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
</style>
|