bfg-common 1.4.833 → 1.4.835

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.
@@ -2962,7 +2962,6 @@
2962
2962
  "removeConfirmation": "Зніміце пацверджанне",
2963
2963
  "removeConfirmationDesc": "вы ўпэўненыя, што хочаце выдаліць вузел \"{node}\" з кластара? адзначце \"{node}\" у полі ніжэй для пацверджання",
2964
2964
  "nodeIPAddress": "IP -адрас вузла",
2965
- "nodeIPAddressInvalidText": "Няправільнае пацверджанне. Калі ласка, увядзіце \" {node}\", каб працягнуць.",
2966
2965
  "addNode": "Дадаць вузел",
2967
2966
  "hostHelp": "Хост дапамогі",
2968
2967
  "hostHelpTooltipContent": "Выберыце мэтавы вылічаны рэсурс для гэтай аперацыі. ",
@@ -2966,7 +2966,6 @@
2966
2966
  "removeConfirmation": "Remove Confirmation",
2967
2967
  "removeConfirmationDesc": "Are you sure you want to remove the node “{node}” from cluster? To confirm, type “{node}” in the field below.",
2968
2968
  "nodeIPAddress": "Node IP Address",
2969
- "nodeIPAddressInvalidText": "Incorrect confirmation. Please type “{node}” to proceed.",
2970
2969
  "addNode": "Add Node",
2971
2970
  "hostHelp": "Host Help",
2972
2971
  "hostHelpTooltipContent": "Select the target compute resource for this operation. Each node must have a unique host.",
@@ -2966,7 +2966,6 @@
2966
2966
  "removeConfirmation": "Հեռացրեք հաստատումը",
2967
2967
  "removeConfirmationDesc": "համոզված եք, որ ցանկանում եք հեռացնել , «{node}» հանգույցը կլաստերից: Հաստատելու համար ներքևի դաշտում մուտքագրեք «{node}»:",
2968
2968
  "nodeIPAddress": "NODE IP հասցե",
2969
- "nodeIPAddressInvalidText": "Սխալ հաստատում: Շարունակելու համար մուտքագրեք \"{node}\":",
2970
2969
  "addNode": "Ավելացնել հանգույց",
2971
2970
  "hostHelp": "Հյուրընկալող օգնություն",
2972
2971
  "hostHelpTooltipContent": "Ընտրեք թիրախային հաշվարկային ռեսուրսը այս գործողության համար: ",
@@ -2965,7 +2965,6 @@
2965
2965
  "removeConfirmation": "Растауды жойыңыз",
2966
2966
  "removeConfirmationDesc": "«{node}» түйінін кластерден шығарғыңыз келе ме? ",
2967
2967
  "nodeIPAddress": "IP мекенжайы",
2968
- "nodeIPAddressInvalidText": "Дұрыс емес растау. ",
2969
2968
  "addNode": "Түйінді қосыңыз",
2970
2969
  "hostHelp": "Хосттық көмек",
2971
2970
  "hostHelpTooltipContent": "Осы жұмыс үшін мақсатты есептеу қорын таңдаңыз. ",
@@ -2967,7 +2967,6 @@
2967
2967
  "removeConfirmation": "Удалить подтверждение",
2968
2968
  "removeConfirmationDesc": "Вы уверены, что хотите удалить узел “{node}” из кластера? Для подтверждения введите “{node}” в поле ниже.",
2969
2969
  "nodeIPAddress": "IP -адрес узла",
2970
- "nodeIPAddressInvalidText": "Неверное подтверждение. Пожалуйста, введите “{node}”, чтобы продолжить.",
2971
2970
  "addNode": "Добавить узел",
2972
2971
  "hostHelp": "Хозяева",
2973
2972
  "hostHelpTooltipContent": "Выберите целевой вычислительный ресурс для этой операции. ",
@@ -2964,7 +2964,6 @@
2964
2964
  "removeConfirmation": "删除确认",
2965
2965
  "removeConfirmationDesc": "您确定要从群集中删除节点“ {node}”?",
2966
2966
  "nodeIPAddress": "节点IP地址",
2967
- "nodeIPAddressInvalidText": "不正确的确认。 请输入\"{node}\"继续。",
2968
2967
  "addNode": "添加节点",
2969
2968
  "hostHelp": "主持人帮助",
2970
2969
  "hostHelpTooltipContent": "为此操作选择目标计算资源。",
@@ -2,24 +2,26 @@
2
2
  <common-modals-confirm-by-input-new
3
3
  v-if="isNewViewLocal"
4
4
  v-model="confirmationForm"
5
+ :is-valid="isValid"
5
6
  :title="props.title"
6
7
  :description="props.description"
7
8
  :sub-title="props.subTitle"
8
9
  :modal-texts="props.modalTexts"
9
10
  :test-id="props.testId"
10
11
  @hide="emits('hide')"
11
- @confirm="emits('confirm')"
12
+ @confirm="onConfirm"
12
13
  />
13
14
  <common-modals-confirm-by-input-old
14
15
  v-else
15
16
  v-model="confirmationForm"
17
+ :is-valid="isValid"
16
18
  :title="props.title"
17
19
  :sub-title="props.subTitle"
18
20
  :test-id="props.testId"
19
21
  :loading="props.loading"
20
22
  :width="props.width"
21
23
  @hide="emits('hide')"
22
- @confirm="emits('confirm')"
24
+ @confirm="onConfirm"
23
25
  >
24
26
  <template #content>
25
27
  <slot name="content" />
@@ -73,100 +75,12 @@ const isValid = computed<boolean>(() => {
73
75
  return confirmationForm.value === props.subTitle
74
76
  })
75
77
 
76
- // const confirmationText = localization.value.common.confirmDeletionInput.replace(
77
- // '{title}',
78
- // props.subTitle
79
- // )
80
- // const confirmDeletionInputError =
81
- // localization.value.common.confirmDeletionInputError.replace(
82
- // '{title}',
83
- // props.subTitle
84
- // )
78
+ const onConfirm = async (): Promise<void> => {
79
+ if (!isValid.value) return
85
80
 
86
- // const onConfirm = async (): Promise<void> => {
87
- // if (!isValid.value) return
88
- //
89
- // emits('confirm')
90
- // }
81
+ emits('confirm')
82
+ }
91
83
 
92
- // const onHide = (): void => {
93
- // emits('hide')
94
- // }
95
84
  </script>
96
85
 
97
- <style lang="scss" scoped>
98
- @import 'assets/scss/common/mixins.scss';
99
- .confirm-by-input {
100
- :deep(.modal-header) {
101
- display: flex;
102
- justify-content: space-between;
103
- align-items: flex-start;
104
-
105
- .modal-title {
106
- color: var(--main-color-mode);
107
- font-size: 24px;
108
- max-width: 65%;
109
- }
110
- .secondary-title {
111
- color: var(--modal-secondary-title);
112
- font-size: 0.75rem;
113
- font-weight: lighter;
114
- user-select: none;
115
- }
116
- .separator {
117
- content: '';
118
- border-left: 1px solid #ccc;
119
- margin: 0 18px;
120
- height: 22px;
121
- }
122
-
123
- .close-icon {
124
- fill: var(--close-icon);
125
- width: 24px;
126
- height: 24px;
127
- }
128
- }
129
-
130
- &__body {
131
- @include flex($align: flex-start);
132
-
133
- .form-group {
134
- margin-top: 20px;
135
-
136
- label {
137
- font-weight: bold;
138
- font-size: 0.6rem;
139
- user-select: none;
140
- }
141
-
142
- &:not(:first-child) input {
143
- width: 100%;
144
- }
145
- &__input {
146
- display: flex;
147
- width: 100%;
148
- min-height: 30px;
149
- }
150
- }
151
- }
152
-
153
- &__icon {
154
- min-width: 48px;
155
- height: 48px;
156
- margin-right: 20px;
157
- fill: #c27b00;
158
- }
159
-
160
- .button {
161
- &__loading {
162
- :deep(.spinner) {
163
- width: 25px;
164
- height: 25px;
165
- min-width: 25px;
166
- min-height: 25px;
167
- margin-top: 5px;
168
- }
169
- }
170
- }
171
- }
172
- </style>
86
+ <style lang="scss" scoped></style>
@@ -35,6 +35,7 @@ const props = defineProps<{
35
35
  title: string
36
36
  description: string
37
37
  subTitle: string
38
+ isValid: boolean
38
39
  modalTexts: UI_I_ModalTexts
39
40
  }>()
40
41
  const confirmationFormLocal = defineModel<string>({ required: true })
@@ -47,11 +48,29 @@ const localization = computed<UI_I_Localization>(() => useLocal())
47
48
 
48
49
  const modalTextsLocal = computed<UI_I_ModalTexts>(() => props.modalTexts)
49
50
 
50
- const confirmInputErrorText = computed(() => '')
51
+ const isShowConfirmError = ref<boolean>(false)
52
+
53
+ const confirmInputErrorText = computed(() => {
54
+ if (!isShowConfirmError.value) return ''
55
+
56
+ const { fieldRequired, incorrectConfirmation } = localization.value.common
57
+
58
+ return !confirmationFormLocal.value
59
+ ? fieldRequired
60
+ : !props.isValid
61
+ ? incorrectConfirmation.replace('{0}', props.subTitle)
62
+ : ''
63
+ })
51
64
  const onHide = (): void => {
52
65
  emits('hide-modal')
53
66
  }
54
67
  const onSubmit = (): void => {
68
+ isShowConfirmError.value = true
69
+
70
+ if (!confirmationFormLocal.value) {
71
+ return
72
+ }
73
+
55
74
  emits('confirm')
56
75
  }
57
76
  </script>
@@ -34,7 +34,7 @@
34
34
  @keyup.enter="onConfirm"
35
35
  />
36
36
  <div
37
- v-show="!isValid && confirmationFormLocal"
37
+ v-show="!props.isValid && confirmationFormLocal"
38
38
  class="form-validate"
39
39
  >
40
40
  <atoms-tooltip :test-id="`${props.testId}-tooltip`">
@@ -70,7 +70,7 @@
70
70
  :data-id="`${props.testId}-modal-apply-button`"
71
71
  class="btn btn-primary"
72
72
  :class="props.loading && 'modal-dialog__loader'"
73
- :disabled="!isValid || props.loading"
73
+ :disabled="!props.isValid || props.loading"
74
74
  @click="onConfirm"
75
75
  >
76
76
  <atoms-loader-pre-loader
@@ -94,6 +94,7 @@ import type { UI_I_Localization } from '~/lib/models/interfaces'
94
94
  const props = defineProps<{
95
95
  title: string
96
96
  subTitle: string
97
+ isValid: boolean
97
98
  testId: string
98
99
  width: string
99
100
  loading?: boolean
@@ -106,10 +107,6 @@ const emits = defineEmits<{
106
107
 
107
108
  const localization = computed<UI_I_Localization>(() => useLocal())
108
109
 
109
- const isValid = computed<boolean>(() => {
110
- return confirmationFormLocal.value === props.subTitle
111
- })
112
-
113
110
  const confirmationText = localization.value.common.confirmDeletionInput.replace(
114
111
  '{title}',
115
112
  props.subTitle
@@ -120,9 +117,7 @@ const confirmDeletionInputError =
120
117
  props.subTitle
121
118
  )
122
119
 
123
- const onConfirm = async (): Promise<void> => {
124
- if (!isValid.value) return
125
-
120
+ const onConfirm = (): void => {
126
121
  emits('confirm')
127
122
  }
128
123
 
@@ -8,6 +8,7 @@ export interface UI_I_ErrorValidationField<T = string> {
8
8
  export interface API_UI_I_Response<T> {
9
9
  response: {
10
10
  _data: T
11
+ status: number
11
12
  }
12
13
  }
13
14
  export interface API_UI_I_Error {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.833",
4
+ "version": "1.4.835",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",