bfg-common 1.5.903 → 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.
@@ -3393,7 +3393,8 @@
3393
3393
  "fourth": "Па-чацвёртае",
3394
3394
  "once": "Адзін раз",
3395
3395
  "selectFrequency": "Выберыце частату",
3396
- "frequency": "Частата"
3396
+ "frequency": "Частата",
3397
+ "delayMinutes": "Затрымка (хвілін)"
3397
3398
  },
3398
3399
  "license": {
3399
3400
  "limits": "Мяжа",
@@ -3397,7 +3397,8 @@
3397
3397
  "fourth": "Fourth",
3398
3398
  "once": "Once",
3399
3399
  "selectFrequency": "Select Frequency",
3400
- "frequency": "Frequency"
3400
+ "frequency": "Frequency",
3401
+ "delayMinutes": "Delay (Minutes)",
3401
3402
  },
3402
3403
  "license": {
3403
3404
  "limits": "Limits",
@@ -3397,7 +3397,8 @@
3397
3397
  "fourth": "Չորրորդ",
3398
3398
  "once": "Մեկ անգամ",
3399
3399
  "selectFrequency": "Ընտրեք հաճախականությունը",
3400
- "frequency": "Հաճախականություն"
3400
+ "frequency": "Հաճախականություն",
3401
+ "delayMinutes": "Ժամանակաձգում (րոպե)"
3401
3402
  },
3402
3403
  "license": {
3403
3404
  "limits": "Սահմանները",
@@ -3396,7 +3396,8 @@
3396
3396
  "fourth": "Төртінші",
3397
3397
  "once": "Бір рет",
3398
3398
  "selectFrequency": "Жиілікті таңдаңыз",
3399
- "frequency": "Жиілік"
3399
+ "frequency": "Жиілік",
3400
+ "delayMinutes": "Кешігу (минут)"
3400
3401
  },
3401
3402
  "license": {
3402
3403
  "limits": "Шектеулер",
@@ -3396,7 +3396,8 @@
3396
3396
  "fourth": "Четвертый",
3397
3397
  "once": "Один раз",
3398
3398
  "selectFrequency": "Выберите частоту",
3399
- "frequency": "Частота"
3399
+ "frequency": "Частота",
3400
+ "delayMinutes": "Задержка (минут)"
3400
3401
  },
3401
3402
  "license": {
3402
3403
  "limits": "Пределы",
@@ -3394,7 +3394,8 @@
3394
3394
  "fourth": "第四",
3395
3395
  "once": "一次",
3396
3396
  "selectFrequency": "选择频率",
3397
- "frequency": "频率"
3397
+ "frequency": "频率",
3398
+ "delayMinutes": "延迟(分钟)"
3398
3399
  },
3399
3400
  "license": {
3400
3401
  "limits": "限制",
@@ -1,32 +1,10 @@
1
1
  <template>
2
- <div class="after-startup clr-col-6 pl-0">
3
- <span class="after-startup__prefix">
4
- {{ localization.scheduledTasks.with }}
5
- </span>
6
-
7
- <label
8
- :class="timeIntervalErrorText && 'invalid'"
9
- for="minute-delay-field"
10
- class="tooltip tooltip-validation tooltip-xs tooltip-top-left"
11
- >
12
- <input
13
- id="minute-delay-field"
14
- v-model="modelFrequencyLocal.frg_after_startup"
15
- data-id="edit-lockout-policy-time-interval-input"
16
- type="text"
17
- @input="onInitTimeIntervalValidation"
18
- @blur="onInitTimeIntervalValidation"
19
- />
20
-
21
- <span class="tooltip-content">
22
- {{ timeIntervalErrorText }}
23
- </span>
24
- </label>
25
-
26
- <span class="after-startup__suffix">
27
- {{ localization.scheduledTasks.minuteDelay }}
28
- </span>
29
- </div>
2
+ <component
3
+ :is="currentComponent"
4
+ v-model="modelFrequencyLocal.frg_after_startup"
5
+ :time-interval-error-text="timeIntervalErrorText"
6
+ @init-validation="onInitValidation"
7
+ />
30
8
  </template>
31
9
 
32
10
  <script lang="ts" setup>
@@ -39,9 +17,17 @@ const modelFrequencyLocal = defineModel<UI_I_ScheduleNewTasksForm>({
39
17
  })
40
18
 
41
19
  const localization = computed<UI_I_Localization>(() => useLocal())
20
+ const { $store }: any = useNuxtApp()
21
+
22
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
23
+ const currentComponent = computed(() =>
24
+ isNewView.value
25
+ ? defineAsyncComponent(() => import('./New.vue'))
26
+ : defineAsyncComponent(() => import('./Old.vue'))
27
+ )
42
28
 
43
29
  const isInitTimeIntervalValidation = ref<boolean>(false)
44
- const onInitTimeIntervalValidation = (): void => {
30
+ const onInitValidation = (): void => {
45
31
  isInitTimeIntervalValidation.value = true
46
32
  }
47
33
 
@@ -61,22 +47,3 @@ watch(
61
47
  { immediate: true }
62
48
  )
63
49
  </script>
64
-
65
- <style lang="scss" scoped>
66
- @import 'bfg-common/assets/scss/common/mixins.scss';
67
- .after-startup {
68
- @include flex($align: center);
69
- margin-top: 10px;
70
- &__suffix {
71
- white-space: nowrap;
72
- }
73
- .tooltip {
74
- & > .tooltip-content {
75
- width: 200px;
76
- }
77
- }
78
- input {
79
- width: 70px;
80
- }
81
- }
82
- </style>
@@ -0,0 +1,43 @@
1
+ <template>
2
+ <div class="frequency-after-startup">
3
+ <h2>{{ localization.scheduledTasks.delayMinutes }}</h2>
4
+ <ui-input
5
+ id="ip-address"
6
+ v-model="afterStartupModel"
7
+ :error="props.timeIntervalErrorText"
8
+ :placeholder="localization.scheduledTasks.delayMinutes"
9
+ test-id="scheduler-frequency-delay-minute-field"
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 afterStartupModel = defineModel<number>({ required: true })
21
+ const props = defineProps<{
22
+ timeIntervalErrorText: string
23
+ }>()
24
+ const emits = defineEmits<{
25
+ (event: 'init-validation'): void
26
+ }>()
27
+
28
+ const localization = computed<UI_I_Localization>(() => useLocal())
29
+
30
+ const onInitValidation = (): void => emits('init-validation')
31
+ </script>
32
+
33
+ <style lang="scss" scoped>
34
+ .frequency-after-startup {
35
+ h2 {
36
+ font-family: 'Inter', sans-serif;
37
+ color: var(--title-form-first-color);
38
+ font-size: 14px;
39
+ font-weight: 500;
40
+ margin-bottom: 12px;
41
+ }
42
+ }
43
+ </style>
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <div class="after-startup clr-col-6 pl-0">
3
+ <span class="after-startup__prefix">
4
+ {{ localization.scheduledTasks.with }}
5
+ </span>
6
+
7
+ <label
8
+ :class="props.timeIntervalErrorText && 'invalid'"
9
+ for="minute-delay-field"
10
+ class="tooltip tooltip-validation tooltip-xs tooltip-top-left"
11
+ >
12
+ <input
13
+ id="minute-delay-field"
14
+ v-model="afterStartupModel"
15
+ data-id="edit-lockout-policy-time-interval-input"
16
+ type="text"
17
+ @input="onInitValidation"
18
+ @blur="onInitValidation"
19
+ />
20
+
21
+ <span class="tooltip-content">
22
+ {{ props.timeIntervalErrorText }}
23
+ </span>
24
+ </label>
25
+
26
+ <span class="after-startup__suffix">
27
+ {{ localization.scheduledTasks.minuteDelay }}
28
+ </span>
29
+ </div>
30
+ </template>
31
+
32
+ <script lang="ts" setup>
33
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
34
+
35
+ const afterStartupModel = defineModel<number>({ required: true })
36
+ const props = defineProps<{
37
+ timeIntervalErrorText: string
38
+ }>()
39
+ const emits = defineEmits<{
40
+ (event: 'init-validation'): void
41
+ }>()
42
+
43
+ const localization = computed<UI_I_Localization>(() => useLocal())
44
+
45
+ const onInitValidation = (): void => emits('init-validation')
46
+ </script>
47
+
48
+ <style lang="scss" scoped>
49
+ @import 'bfg-common/assets/scss/common/mixins.scss';
50
+ .after-startup {
51
+ @include flex($align: center);
52
+ margin-top: 10px;
53
+ &__suffix {
54
+ white-space: nowrap;
55
+ }
56
+ .tooltip {
57
+ & > .tooltip-content {
58
+ width: 200px;
59
+ }
60
+ }
61
+ input {
62
+ width: 70px;
63
+ }
64
+ }
65
+ </style>
@@ -1,34 +1,11 @@
1
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
- 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 onInitTimeIntervalValidation = (): void => {
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>
@@ -74,7 +74,7 @@ export const validateField = (
74
74
  return localization.common.theValueTooSmall
75
75
  }
76
76
 
77
- if (value.length > 3) {
77
+ if (String(value).length > 3) {
78
78
  return localization.common.theValueTooLarge
79
79
  }
80
80
  // Если значение не является цифрой
@@ -8,8 +8,8 @@
8
8
  :format="datepickerFormat"
9
9
  test-id="frequency-on-date-input"
10
10
  time-format="12"
11
- :error="'dateToErrorText.date'"
12
- :error-timepicker="'dateToErrorText.time'"
11
+ :error="''"
12
+ :error-timepicker="''"
13
13
  />
14
14
  </div>
15
15
  </div>
@@ -5,6 +5,7 @@
5
5
  :frequency-on-weeks-days="frequencyOnWeeksDays"
6
6
  :frequency-on-ordinal-number="frequencyOnOrdinalNumber"
7
7
  :type="type"
8
+ @vue:mounted="onSetDefaultDateTime"
8
9
  />
9
10
  </template>
10
11
 
@@ -33,8 +34,8 @@ const { $store }: any = useNuxtApp()
33
34
  const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
34
35
  const currentComponent = computed(() =>
35
36
  isNewView.value
36
- ? defineAsyncComponent(() => import('./new/New.vue'))
37
- : defineAsyncComponent(() => import('./old/Old.vue'))
37
+ ? defineAsyncComponent(() => import('./New.vue'))
38
+ : defineAsyncComponent(() => import('./Old.vue'))
38
39
  )
39
40
 
40
41
  const frequencyOnWeeksDays = computed<UI_I_SelectInputItem[]>(() => {
@@ -84,10 +85,9 @@ watch(
84
85
  { immediate: true }
85
86
  )
86
87
 
87
- onMounted(() => {
88
- props.type === 'once' && setDefaultDateTime()
89
- })
90
- const setDefaultDateTime = () => {
88
+ const onSetDefaultDateTime = () => {
89
+ if (props.type !== 'once') return
90
+
91
91
  model.value.frg_on_time = $formattedDatetime(new Date(), {
92
92
  formatDate: 'yyyy-MM-dd',
93
93
  separator: ' ',
@@ -95,58 +95,3 @@ const setDefaultDateTime = () => {
95
95
  })
96
96
  }
97
97
  </script>
98
-
99
- <style lang="scss" scoped>
100
- @import 'bfg-common/assets/scss/common/mixins.scss';
101
- .on-time {
102
- display: flex;
103
- margin-top: 25px;
104
- &__label {
105
- font-weight: 400;
106
- padding-left: 0;
107
- margin-right: 15px;
108
- }
109
- &__radio {
110
- @include flex($align: center);
111
- .monthly-day-field {
112
- width: 110px;
113
- }
114
- }
115
- }
116
- .radio {
117
- &__select {
118
- width: 100%;
119
- margin-top: 10px;
120
- :deep(.select-input__inner) {
121
- max-width: 100% !important;
122
- min-width: max-content;
123
- }
124
- &.ordinary-day :deep(select) {
125
- min-width: 80px;
126
- }
127
- &.week-days {
128
- margin-left: 15px;
129
- :deep(select) {
130
- min-width: 110px;
131
- }
132
- }
133
- select {
134
- width: 80px;
135
- }
136
- &.disabled {
137
- opacity: 0.6;
138
- pointer-events: none;
139
- }
140
- }
141
- }
142
-
143
- .tooltip {
144
- & > .tooltip-content {
145
- width: 200px;
146
- }
147
- }
148
- input[type='radio']:focus:checked + label::before,
149
- input[type='radio']:focus + label::before {
150
- box-shadow: inset 0 0 0 0.25rem #0094d2;
151
- }
152
- </style>
@@ -38,20 +38,31 @@
38
38
  <div class="form__run">
39
39
  <h2>{{ localization.common.run }}</h2>
40
40
 
41
- <h2 class="frequency">{{ localization.scheduledTasks.frequency }}</h2>
42
- <ui-select
43
- v-model="model.frequency"
44
- :items="frequencyMethodOptionsLocal"
45
- test-id="schedule-task-frequency-select"
46
- :placeholder="localization.scheduledTasks.selectFrequency"
47
- size="md"
48
- select-width="100%"
49
- class="mt-3"
50
- />
51
- <common-pages-scheduled-tasks-modals-common-frequency
52
- v-model="model"
53
- :type="model.frequency"
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);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.903",
4
+ "version": "1.5.905",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",