@webitel/ui-datalist 26.8.20 → 26.8.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-datalist",
3
- "version": "26.8.20",
3
+ "version": "26.8.21",
4
4
  "description": "Toolkit for building data lists in webitel ui system",
5
5
  "scripts": {
6
6
  "build:types": "vue-tsc -b tsconfig.build.json",
@@ -51,6 +51,34 @@ describe('card validation of a root-level required rule', () => {
51
51
  expect(calendarErrors).toHaveLength(1);
52
52
  });
53
53
 
54
+ it.each([
55
+ QueueType.OUTBOUND_IVR_QUEUE,
56
+ QueueType.OUTBOUND_JOB_QUEUE,
57
+ ])('reports a cleared calendar and schema of queue type %s on the fields', async (type) => {
58
+ const state = ref({
59
+ ...getQueueDefaults(type),
60
+ name: 'a queue',
61
+ calendar: {},
62
+ schema: {},
63
+ });
64
+ const scope = effectScope(true);
65
+ // biome-ignore lint/suspicious/noExplicitAny: regle's inferred state type
66
+ let r$: any;
67
+
68
+ scope.run(() => {
69
+ ({ r$ } = useRegleSchema(state, queueSchema as never));
70
+ });
71
+
72
+ const result = await r$.$validate();
73
+
74
+ expect(result.valid).toBe(false);
75
+ expect(r$.$error).toBe(true);
76
+ expect(r$.$fields.calendar.$error).toBe(true);
77
+ expect(r$.$fields.calendar.$errors.id).toHaveLength(1);
78
+ expect(r$.$fields.schema.$error).toBe(true);
79
+ expect(r$.$fields.schema.$errors.id).toHaveLength(1);
80
+ });
81
+
54
82
  it('accepts the same draft once the calendar is filled', async () => {
55
83
  const { valid, rootError } = await validateDraft({
56
84
  ...getQueueDefaults(QueueType.PREVIEW_DIALER),
@@ -168,10 +168,35 @@ describe('StaticFilterField', () => {
168
168
 
169
169
  /* static mode used to force hideLabel on every value field, which left
170
170
  select-based filters (has-option-filter-value-field) with no visible
171
- label at all — the value field itself now decides whether to show one */
172
- it('does not force hideLabel on its value field', () => {
173
- const wrapper = mountField(deletableConfig, filtersManager);
171
+ label at all — with showFilterName the value field itself decides whether to show one */
172
+ it('does not force hideLabel on its value field when showFilterName is set', () => {
173
+ const filterConfig = createFilterConfig({
174
+ name: FilterOption.Tag,
175
+ showFilterName: true,
176
+ valueInputComponent: StubInput,
177
+ });
178
+ filterConfig.label = 'Tags';
179
+
180
+ const wrapper = mountField(filterConfig, filtersManager);
181
+
182
+ expect(wrapper.findComponent(StubInput).props('hideLabel')).toBe(false);
183
+ expect(wrapper.findComponent(StubInput).attributes('placeholder')).not.toBe(
184
+ 'Tags',
185
+ );
186
+ });
187
+
188
+ it('hides the label and shows the filter name as placeholder without showFilterName', () => {
189
+ const filterConfig = createFilterConfig({
190
+ name: FilterOption.Tag,
191
+ valueInputComponent: StubInput,
192
+ });
193
+ filterConfig.label = 'Tags';
194
+
195
+ const wrapper = mountField(filterConfig, filtersManager);
174
196
 
175
- expect(wrapper.findComponent(StubInput).props('hideLabel')).toBeUndefined();
197
+ expect(wrapper.findComponent(StubInput).props('hideLabel')).toBe(true);
198
+ expect(wrapper.findComponent(StubInput).attributes('placeholder')).toBe(
199
+ 'Tags',
200
+ );
176
201
  });
177
202
  });
@@ -10,6 +10,8 @@
10
10
  :disable-default-value="true"
11
11
  :disable-validation="true /*for static filters validation is not needed (different presentation with dynamic filters)*/"
12
12
  :filter-config="filterConfig"
13
+ :hide-label="!filterConfig.showFilterName"
14
+ :placeholder="!filterConfig.showFilterName && filterConfig.label"
13
15
  :static-view="true"
14
16
  :model-value="filterValue"
15
17
  @update:model-value="onValueChange"