@kong-ui-public/entities-consumer-groups 3.5.3 → 3.5.4
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.
|
@@ -2,7 +2,7 @@ import { defineComponent as _e, ref as C, computed as I, watch as $e, resolveCom
|
|
|
2
2
|
import { useRouter as Fe } from "vue-router";
|
|
3
3
|
import { AddIcon as Qe } from "@kong/icons";
|
|
4
4
|
import { createI18n as Je, i18nTComponent as He } from "@kong-ui-public/i18n";
|
|
5
|
-
import { useAxios as we, useDebouncedFilter as De, useFetcher as
|
|
5
|
+
import { useAxios as we, useDebouncedFilter as De, useFetcher as ze, useDeleteUrlBuilder as We, FetcherStatus as Xe, EntityBaseTable as Ye, EntityFilter as Ze, PermissionsWrapper as he, EntityDeleteModal as eo, EntityTypes as oo, useErrors as ro, useValidators as to, EntityBaseFormType as Ie, EntityBaseForm as so, SupportedEntityType as Be, EntityFormSection as Se, EntityBaseConfigCard as no } from "@kong-ui-public/entities-shared";
|
|
6
6
|
const ao = {
|
|
7
7
|
list: {
|
|
8
8
|
table_headers: {
|
|
@@ -95,7 +95,7 @@ const ao = {
|
|
|
95
95
|
}, uo = {
|
|
96
96
|
consumer_groups: ao
|
|
97
97
|
};
|
|
98
|
-
function
|
|
98
|
+
function lo() {
|
|
99
99
|
const e = Je("en-us", uo);
|
|
100
100
|
return {
|
|
101
101
|
i18n: e,
|
|
@@ -104,8 +104,8 @@ function io() {
|
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
const be = {
|
|
107
|
-
useI18n:
|
|
108
|
-
}, q = "/v2/control-planes/{controlPlaneId}/core-entities", N = "/{workspace}",
|
|
107
|
+
useI18n: lo
|
|
108
|
+
}, q = "/v2/control-planes/{controlPlaneId}/core-entities", N = "/{workspace}", W = {
|
|
109
109
|
list: {
|
|
110
110
|
konnect: {
|
|
111
111
|
all: `${q}/consumer_groups`,
|
|
@@ -139,7 +139,7 @@ const be = {
|
|
|
139
139
|
getConsumers: `${N}/consumer_groups/{id}/consumers`
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
},
|
|
142
|
+
}, io = { class: "add-to-group-form-container" }, co = { class: "add-to-group-cta-text" }, mo = {
|
|
143
143
|
key: 0,
|
|
144
144
|
class: "kong-ui-entity-add-to-groups-error"
|
|
145
145
|
}, po = { key: 0 }, go = /* @__PURE__ */ _e({
|
|
@@ -160,22 +160,22 @@ const be = {
|
|
|
160
160
|
emits: ["cancel", "add:success", "add:partial-success", "error"],
|
|
161
161
|
setup(e, { emit: L }) {
|
|
162
162
|
var J;
|
|
163
|
-
const { i18n: { t: u } } = be.useI18n(),
|
|
163
|
+
const { i18n: { t: u } } = be.useI18n(), r = e, g = L, { axiosInstance: i } = we((J = r.config) == null ? void 0 : J.axiosRequestConfig), n = C([]), {
|
|
164
164
|
debouncedQueryChange: E,
|
|
165
165
|
loading: Q,
|
|
166
166
|
allRecords: G,
|
|
167
167
|
error: ue,
|
|
168
|
-
loadItems:
|
|
168
|
+
loadItems: le,
|
|
169
169
|
results: D
|
|
170
170
|
} = De(
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
r.config,
|
|
172
|
+
W.list[r.config.app].forModal,
|
|
173
173
|
"",
|
|
174
174
|
{
|
|
175
175
|
fetchedItemsKey: "data",
|
|
176
176
|
searchKeys: ["name", "id"]
|
|
177
177
|
}
|
|
178
|
-
), P = I(() => ue.value ? u("consumer_groups.errors.general") : ""),
|
|
178
|
+
), P = I(() => ue.value ? u("consumer_groups.errors.general") : ""), ie = C(0), X = I(() => G.value === void 0), B = I(() => D.value.map((p) => ({
|
|
179
179
|
label: p.name,
|
|
180
180
|
value: p.id,
|
|
181
181
|
selected: n.value.includes(p.id),
|
|
@@ -204,16 +204,16 @@ const be = {
|
|
|
204
204
|
} finally {
|
|
205
205
|
H.value = !1;
|
|
206
206
|
}
|
|
207
|
-
},
|
|
207
|
+
}, z = I(() => {
|
|
208
208
|
var y, d, _, K;
|
|
209
|
-
let p = `${
|
|
210
|
-
return
|
|
209
|
+
let p = `${r.config.apiBaseUrl}${W.list[r.config.app].forConsumer}`;
|
|
210
|
+
return r.config.app === "konnect" ? p = p.replace(/{controlPlaneId}/gi, ((y = r.config) == null ? void 0 : y.controlPlaneId) || "").replace(/{consumerId}/gi, ((d = r.config) == null ? void 0 : d.consumerId) || "") : r.config.app === "kongManager" && (p = p.replace(/\/{workspace}/gi, (_ = r.config) != null && _.workspace ? `/${r.config.workspace}` : "").replace(/{consumerId}/gi, ((K = r.config) == null ? void 0 : K.consumerId) || "")), p;
|
|
211
211
|
}), me = async (p) => {
|
|
212
212
|
const y = {
|
|
213
213
|
group: p
|
|
214
214
|
};
|
|
215
215
|
try {
|
|
216
|
-
const d = await
|
|
216
|
+
const d = await i.post(z.value, y);
|
|
217
217
|
return U.value.push(p), d;
|
|
218
218
|
} catch (d) {
|
|
219
219
|
let _ = `${ee(p)} - ${d.message}`;
|
|
@@ -226,9 +226,9 @@ const be = {
|
|
|
226
226
|
}).filter(Boolean);
|
|
227
227
|
};
|
|
228
228
|
return $e(B, () => {
|
|
229
|
-
|
|
230
|
-
}, { immediate: !0, deep: !0 }), $e(() =>
|
|
231
|
-
|
|
229
|
+
ie.value++;
|
|
230
|
+
}, { immediate: !0, deep: !0 }), $e(() => r.visible, () => {
|
|
231
|
+
r.visible && le();
|
|
232
232
|
}, { immediate: !0 }), (p, y) => {
|
|
233
233
|
const d = F("KMultiselect"), _ = F("KAlert"), K = F("KPrompt");
|
|
234
234
|
return w(), Z(K, {
|
|
@@ -241,7 +241,7 @@ const be = {
|
|
|
241
241
|
onProceed: de
|
|
242
242
|
}, {
|
|
243
243
|
default: f(() => [
|
|
244
|
-
O("div",
|
|
244
|
+
O("div", io, [
|
|
245
245
|
O("p", co, M(s(u)("consumer_groups.consumers.add.ctaText")), 1),
|
|
246
246
|
h(d, {
|
|
247
247
|
modelValue: n.value,
|
|
@@ -278,8 +278,8 @@ const be = {
|
|
|
278
278
|
}
|
|
279
279
|
}), Ee = (e, L) => {
|
|
280
280
|
const u = e.__vccOpts || e;
|
|
281
|
-
for (const [
|
|
282
|
-
u[
|
|
281
|
+
for (const [r, g] of L)
|
|
282
|
+
u[r] = g;
|
|
283
283
|
return u;
|
|
284
284
|
}, fo = /* @__PURE__ */ Ee(go, [["__scopeId", "data-v-4260ce03"]]), vo = { class: "kong-ui-entities-consumer-groups-list" }, yo = { key: 1 }, ho = /* @__PURE__ */ _e({
|
|
285
285
|
__name: "ConsumerGroupList",
|
|
@@ -328,158 +328,157 @@ const be = {
|
|
|
328
328
|
emits: ["error", "copy:success", "copy:error", "delete:success", "add:success", "remove:success"],
|
|
329
329
|
setup(e, { emit: L }) {
|
|
330
330
|
var Me;
|
|
331
|
-
const u = L,
|
|
331
|
+
const u = L, r = e, { i18nT: g, i18n: { t: i } } = be.useI18n(), n = Fe(), { axiosInstance: E } = we((Me = r.config) == null ? void 0 : Me.axiosRequestConfig), Q = C(1), G = I(() => !!r.config.consumerId), ue = I(
|
|
332
332
|
() => G.value ? "kong-ui-entities-consumer-groups-list-in-consumer-page" : "kong-ui-entities-consumer-groups-list"
|
|
333
|
-
),
|
|
333
|
+
), le = I(() => r.config.app !== "kongManager" || !!r.config.disableSorting), D = {
|
|
334
334
|
// the Name column is non-hidable
|
|
335
|
-
name: { label:
|
|
335
|
+
name: { label: i("consumer_groups.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 }
|
|
336
336
|
};
|
|
337
|
-
|
|
338
|
-
const P = D,
|
|
339
|
-
"data-testid":
|
|
337
|
+
r.config.app === "kongManager" && (D.consumers_count = { label: i("consumer_groups.list.table_headers.consumers_count"), searchable: !1, sortable: !1 }), D.tags = { label: i("consumer_groups.list.table_headers.tags"), sortable: !1 };
|
|
338
|
+
const P = D, ie = (t) => ({
|
|
339
|
+
"data-testid": t.username ?? t.custom_id ?? t.id
|
|
340
340
|
}), X = I(() => {
|
|
341
341
|
var m, b, S, R;
|
|
342
|
-
let
|
|
343
|
-
return
|
|
342
|
+
let t = `${r.config.apiBaseUrl}${W.list[r.config.app][G.value ? "forConsumer" : "all"]}`;
|
|
343
|
+
return r.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((m = r.config) == null ? void 0 : m.controlPlaneId) || "").replace(/{consumerId}/gi, ((b = r.config) == null ? void 0 : b.consumerId) || "") : r.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (S = r.config) != null && S.workspace ? `/${r.config.workspace}` : "").replace(/{consumerId}/gi, ((R = r.config) == null ? void 0 : R.consumerId) || "")), t;
|
|
344
344
|
}), B = C(""), ee = I(() => {
|
|
345
|
-
const
|
|
346
|
-
return
|
|
347
|
-
isExactMatch:
|
|
345
|
+
const t = r.config.app === "konnect" || r.config.isExactMatch;
|
|
346
|
+
return t ? {
|
|
347
|
+
isExactMatch: t,
|
|
348
348
|
fields: {
|
|
349
349
|
username: D.name,
|
|
350
|
-
id: { label:
|
|
350
|
+
id: { label: i("consumer_groups.list.table_headers.id") }
|
|
351
351
|
},
|
|
352
|
-
placeholder:
|
|
352
|
+
placeholder: i("consumer_groups.search.placeholder")
|
|
353
353
|
} : {
|
|
354
|
-
isExactMatch:
|
|
354
|
+
isExactMatch: t,
|
|
355
355
|
fields: {
|
|
356
356
|
name: D.name
|
|
357
357
|
},
|
|
358
|
-
schema:
|
|
358
|
+
schema: r.config.filterSchema
|
|
359
359
|
};
|
|
360
|
-
}), ce = I(() =>
|
|
360
|
+
}), ce = I(() => r.config.app === "konnect" && B.value ? "consumer_group" : G.value && !r.config.paginatedEndpoint ? "consumer_groups" : void 0), { fetcher: U, fetcherState: H } = ze(r.config, X.value, ce), x = () => {
|
|
361
361
|
B.value = "";
|
|
362
362
|
}, de = () => {
|
|
363
363
|
Q.value++;
|
|
364
|
-
},
|
|
365
|
-
const b =
|
|
364
|
+
}, z = C(null), me = (t, m) => {
|
|
365
|
+
const b = t.id;
|
|
366
366
|
if (!m(b)) {
|
|
367
367
|
u("copy:error", {
|
|
368
|
-
entity:
|
|
368
|
+
entity: t,
|
|
369
369
|
field: "id",
|
|
370
|
-
message:
|
|
370
|
+
message: i("consumer_groups.errors.copy")
|
|
371
371
|
});
|
|
372
372
|
return;
|
|
373
373
|
}
|
|
374
374
|
u("copy:success", {
|
|
375
|
-
entity:
|
|
375
|
+
entity: t,
|
|
376
376
|
field: "id",
|
|
377
|
-
message:
|
|
377
|
+
message: i("consumer_groups.copy.success", { val: b })
|
|
378
378
|
});
|
|
379
|
-
}, T = (
|
|
380
|
-
const b = JSON.stringify(
|
|
379
|
+
}, T = (t, m) => {
|
|
380
|
+
const b = JSON.stringify(t);
|
|
381
381
|
if (!m(b)) {
|
|
382
382
|
u("copy:error", {
|
|
383
|
-
entity:
|
|
384
|
-
message:
|
|
383
|
+
entity: t,
|
|
384
|
+
message: i("consumer_groups.errors.copy")
|
|
385
385
|
});
|
|
386
386
|
return;
|
|
387
387
|
}
|
|
388
388
|
u("copy:success", {
|
|
389
|
-
entity:
|
|
390
|
-
message:
|
|
389
|
+
entity: t,
|
|
390
|
+
message: i("consumer_groups.copy.success_brief")
|
|
391
391
|
});
|
|
392
|
-
}, oe = async (
|
|
392
|
+
}, oe = async (t) => {
|
|
393
393
|
var b;
|
|
394
|
-
await ((b =
|
|
395
|
-
}, J = (
|
|
396
|
-
label:
|
|
397
|
-
to:
|
|
398
|
-
}), p = (
|
|
399
|
-
label:
|
|
400
|
-
to:
|
|
401
|
-
}), y = C(void 0), d = C(!1), _ = C(!1), K = C(""), Y =
|
|
402
|
-
y.value =
|
|
394
|
+
await ((b = r.canRetrieve) == null ? void 0 : b.call(r, t)) && n.push(r.config.getViewRoute(t.id));
|
|
395
|
+
}, J = (t) => ({
|
|
396
|
+
label: i("consumer_groups.actions.view"),
|
|
397
|
+
to: r.config.getViewRoute(t)
|
|
398
|
+
}), p = (t) => ({
|
|
399
|
+
label: i("consumer_groups.actions.edit"),
|
|
400
|
+
to: r.config.getEditRoute(t)
|
|
401
|
+
}), y = C(void 0), d = C(!1), _ = C(!1), K = C(""), Y = We(r.config, X.value), pe = (t) => {
|
|
402
|
+
y.value = t, d.value = !0;
|
|
403
403
|
}, Ce = () => {
|
|
404
404
|
d.value = !1;
|
|
405
405
|
}, ye = async () => {
|
|
406
|
-
var
|
|
407
|
-
if ((
|
|
406
|
+
var t, m, b;
|
|
407
|
+
if ((t = y.value) != null && t.id) {
|
|
408
408
|
_.value = !0;
|
|
409
409
|
try {
|
|
410
410
|
await E.delete(Y(y.value.id)), _.value = !1, d.value = !1, Q.value++, u("delete:success", y.value);
|
|
411
411
|
} catch (S) {
|
|
412
|
-
K.value = ((b = (m = S.response) == null ? void 0 : m.data) == null ? void 0 : b.message) || S.message ||
|
|
412
|
+
K.value = ((b = (m = S.response) == null ? void 0 : m.data) == null ? void 0 : b.message) || S.message || i("consumer_groups.errors.delete"), u("error", S);
|
|
413
413
|
} finally {
|
|
414
414
|
_.value = !1;
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
},
|
|
418
|
-
|
|
417
|
+
}, re = C(!1), ge = () => {
|
|
418
|
+
re.value = !0;
|
|
419
419
|
}, o = () => {
|
|
420
|
-
|
|
421
|
-
}, a = (
|
|
422
|
-
m || o(), Q.value++, u("add:success",
|
|
420
|
+
re.value = !1;
|
|
421
|
+
}, a = (t, m) => {
|
|
422
|
+
m || o(), Q.value++, u("add:success", t);
|
|
423
423
|
}, k = () => {
|
|
424
424
|
G.value && ge();
|
|
425
|
-
},
|
|
426
|
-
|
|
425
|
+
}, l = C(void 0), c = C(!1), A = C(""), V = (t) => {
|
|
426
|
+
l.value = t, c.value = !0;
|
|
427
427
|
}, $ = () => {
|
|
428
|
-
c.value = !1,
|
|
429
|
-
},
|
|
428
|
+
c.value = !1, l.value = void 0;
|
|
429
|
+
}, te = I(() => {
|
|
430
430
|
var m, b, S, R;
|
|
431
|
-
let
|
|
432
|
-
return
|
|
431
|
+
let t = `${r.config.apiBaseUrl}${W.list[r.config.app].oneForConsumer}`;
|
|
432
|
+
return r.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((m = r.config) == null ? void 0 : m.controlPlaneId) || "").replace(/{consumerId}/gi, ((b = r.config) == null ? void 0 : b.consumerId) || "") : r.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (S = r.config) != null && S.workspace ? `/${r.config.workspace}` : "").replace(/{consumerId}/gi, ((R = r.config) == null ? void 0 : R.consumerId) || "")), t;
|
|
433
433
|
}), fe = C(!1), Ue = async () => {
|
|
434
|
-
if (
|
|
434
|
+
if (l.value) {
|
|
435
435
|
fe.value = !0;
|
|
436
436
|
try {
|
|
437
|
-
const
|
|
438
|
-
await E.delete(
|
|
439
|
-
} catch (
|
|
440
|
-
A.value =
|
|
437
|
+
const t = te.value.replace(/{consumerGroupId}/gi, l.value.id);
|
|
438
|
+
await E.delete(t), u("remove:success", l.value), $(), Q.value++;
|
|
439
|
+
} catch (t) {
|
|
440
|
+
A.value = t.message || i("consumer_groups.errors.delete"), u("error", t);
|
|
441
441
|
} finally {
|
|
442
442
|
fe.value = !1;
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
}, xe = C(!1);
|
|
446
|
-
$e(H, (
|
|
446
|
+
$e(H, (t) => {
|
|
447
447
|
var m, b, S, R;
|
|
448
|
-
if (Array.isArray((m =
|
|
449
|
-
|
|
450
|
-
title:
|
|
451
|
-
}, (R = (S = (b =
|
|
448
|
+
if (Array.isArray((m = t == null ? void 0 : t.response) == null ? void 0 : m.data) && (xe.value = t.response.data.length > 0), t.status === Xe.Error) {
|
|
449
|
+
z.value = {
|
|
450
|
+
title: i("consumer_groups.errors.general")
|
|
451
|
+
}, (R = (S = (b = t.error) == null ? void 0 : b.response) == null ? void 0 : S.data) != null && R.message && (z.value.message = t.error.response.data.message), u("error", t.error);
|
|
452
452
|
return;
|
|
453
453
|
}
|
|
454
|
-
|
|
454
|
+
z.value = null;
|
|
455
455
|
});
|
|
456
456
|
const ke = C({
|
|
457
|
-
ctaPath: G.value ? void 0 :
|
|
457
|
+
ctaPath: G.value ? void 0 : r.config.createRoute,
|
|
458
458
|
ctaText: void 0,
|
|
459
|
-
message: `${
|
|
460
|
-
title:
|
|
459
|
+
message: `${i("consumer_groups.list.empty_state.description")}${r.config.additionMessageForEmptyState ? ` ${r.config.additionMessageForEmptyState}` : ""}`,
|
|
460
|
+
title: i("consumer_groups.title")
|
|
461
461
|
});
|
|
462
462
|
return Ke(async () => {
|
|
463
|
-
await
|
|
464
|
-
}), (
|
|
463
|
+
await r.canCreate() && (ke.value.title = G.value ? i("consumer_groups.list.empty_state.title_for_consumer") : i("consumer_groups.list.empty_state.title"), ke.value.ctaText = G.value ? i("consumer_groups.actions.add_to_group") : i("consumer_groups.actions.create"));
|
|
464
|
+
}), (t, m) => {
|
|
465
465
|
const b = F("KButton"), S = F("KBadge"), R = F("KTruncate"), ve = F("KDropdownItem"), Ge = F("KClipboardProvider"), Ve = F("KPrompt");
|
|
466
466
|
return w(), j("div", vo, [
|
|
467
467
|
h(s(Ye), {
|
|
468
468
|
"cache-identifier": e.cacheIdentifier,
|
|
469
469
|
"disable-pagination": G.value && !e.config.paginatedEndpoint,
|
|
470
470
|
"disable-pagination-page-jump": "",
|
|
471
|
-
"disable-sorting":
|
|
471
|
+
"disable-sorting": le.value,
|
|
472
472
|
"empty-state-options": ke.value,
|
|
473
473
|
"enable-entity-actions": "",
|
|
474
|
-
"error-message":
|
|
474
|
+
"error-message": z.value,
|
|
475
475
|
fetcher: s(U),
|
|
476
476
|
"fetcher-cache-key": Q.value,
|
|
477
477
|
"pagination-type": "offset",
|
|
478
478
|
"preferences-storage-key": ue.value,
|
|
479
479
|
query: B.value,
|
|
480
|
-
"row-attributes":
|
|
480
|
+
"row-attributes": ie,
|
|
481
481
|
"table-headers": s(P),
|
|
482
|
-
"use-action-outside": e.useActionOutside,
|
|
483
482
|
onClearSearchInput: x,
|
|
484
483
|
"onClick:row": m[3] || (m[3] = (v) => oe(v)),
|
|
485
484
|
onEmptyStateCtaClicked: k,
|
|
@@ -505,16 +504,16 @@ const be = {
|
|
|
505
504
|
Ne(h(b, {
|
|
506
505
|
appearance: "primary",
|
|
507
506
|
"data-testid": "toolbar-add-consumer-group",
|
|
508
|
-
size: "large",
|
|
507
|
+
size: e.useActionOutside ? "medium" : "large",
|
|
509
508
|
to: e.config.consumerId ? void 0 : e.config.createRoute,
|
|
510
509
|
onClick: m[1] || (m[1] = () => e.config.consumerId ? ge() : void 0)
|
|
511
510
|
}, {
|
|
512
511
|
default: f(() => [
|
|
513
512
|
h(s(Qe)),
|
|
514
|
-
ne(" " + M(e.config.consumerId ? s(
|
|
513
|
+
ne(" " + M(e.config.consumerId ? s(i)("consumer_groups.actions.add_to_group") : s(i)("consumer_groups.list.toolbar_actions.new_consumer_group")), 1)
|
|
515
514
|
]),
|
|
516
515
|
_: 1
|
|
517
|
-
}, 8, ["to"]), [
|
|
516
|
+
}, 8, ["size", "to"]), [
|
|
518
517
|
[Oe, xe.value]
|
|
519
518
|
])
|
|
520
519
|
]),
|
|
@@ -553,7 +552,7 @@ const be = {
|
|
|
553
552
|
onClick: (Re) => me(v, se)
|
|
554
553
|
}, {
|
|
555
554
|
default: f(() => [
|
|
556
|
-
ne(M(s(
|
|
555
|
+
ne(M(s(i)("consumer_groups.actions.copy_id")), 1)
|
|
557
556
|
]),
|
|
558
557
|
_: 2
|
|
559
558
|
}, 1032, ["onClick"])
|
|
@@ -567,7 +566,7 @@ const be = {
|
|
|
567
566
|
onClick: (Re) => T(v, se)
|
|
568
567
|
}, {
|
|
569
568
|
default: f(() => [
|
|
570
|
-
ne(M(s(
|
|
569
|
+
ne(M(s(i)("consumer_groups.actions.copy_json")), 1)
|
|
571
570
|
]),
|
|
572
571
|
_: 2
|
|
573
572
|
}, 1032, ["onClick"])
|
|
@@ -608,7 +607,7 @@ const be = {
|
|
|
608
607
|
onClick: () => e.config.consumerId ? V(v) : pe(v)
|
|
609
608
|
}, {
|
|
610
609
|
default: f(() => [
|
|
611
|
-
ne(M(e.config.consumerId ? s(
|
|
610
|
+
ne(M(e.config.consumerId ? s(i)("consumer_groups.actions.exit") : s(i)("consumer_groups.actions.delete")), 1)
|
|
612
611
|
]),
|
|
613
612
|
_: 2
|
|
614
613
|
}, 1032, ["onClick"])
|
|
@@ -617,15 +616,15 @@ const be = {
|
|
|
617
616
|
}, 1032, ["auth-function"])
|
|
618
617
|
]),
|
|
619
618
|
_: 1
|
|
620
|
-
}, 8, ["cache-identifier", "disable-pagination", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "preferences-storage-key", "query", "table-headers"
|
|
619
|
+
}, 8, ["cache-identifier", "disable-pagination", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "preferences-storage-key", "query", "table-headers"]),
|
|
621
620
|
h(s(eo), {
|
|
622
621
|
"action-pending": _.value,
|
|
623
622
|
"data-testid": "delete-consumer-group-modal",
|
|
624
|
-
description: s(
|
|
623
|
+
description: s(i)("consumer_groups.delete.description"),
|
|
625
624
|
"entity-name": y.value && (y.value.name || y.value.id),
|
|
626
625
|
"entity-type": s(oo).ConsumerGroup,
|
|
627
626
|
error: K.value,
|
|
628
|
-
title: s(
|
|
627
|
+
title: s(i)("consumer_groups.delete.title"),
|
|
629
628
|
visible: d.value,
|
|
630
629
|
onCancel: Ce,
|
|
631
630
|
onProceed: ye
|
|
@@ -634,16 +633,16 @@ const be = {
|
|
|
634
633
|
key: 0,
|
|
635
634
|
config: e.config,
|
|
636
635
|
"data-testid": "add-to-group-modal",
|
|
637
|
-
visible:
|
|
636
|
+
visible: re.value,
|
|
638
637
|
"onAdd:partialSuccess": m[4] || (m[4] = (v) => a(v, !0)),
|
|
639
638
|
"onAdd:success": m[5] || (m[5] = (v) => a(v)),
|
|
640
639
|
onCancel: o
|
|
641
640
|
}, null, 8, ["config", "visible"])) : ae("", !0),
|
|
642
|
-
e.config.consumerId &&
|
|
641
|
+
e.config.consumerId && l.value ? (w(), Z(Ve, {
|
|
643
642
|
key: 1,
|
|
644
643
|
"action-button-appearance": "danger",
|
|
645
644
|
"data-testid": "exit-group-modal",
|
|
646
|
-
title: s(
|
|
645
|
+
title: s(i)("consumer_groups.consumers.exit.title"),
|
|
647
646
|
visible: c.value,
|
|
648
647
|
onCancel: $,
|
|
649
648
|
onProceed: Ue
|
|
@@ -655,7 +654,7 @@ const be = {
|
|
|
655
654
|
tag: "p"
|
|
656
655
|
}, Le({
|
|
657
656
|
consumerGroup: f(() => [
|
|
658
|
-
O("strong", null, M(
|
|
657
|
+
O("strong", null, M(l.value.name || l.value.id), 1)
|
|
659
658
|
]),
|
|
660
659
|
_: 2
|
|
661
660
|
}, [
|
|
@@ -667,14 +666,14 @@ const be = {
|
|
|
667
666
|
key: "0"
|
|
668
667
|
} : void 0
|
|
669
668
|
]), 1032, ["keypath"]),
|
|
670
|
-
O("p", null, M(s(
|
|
669
|
+
O("p", null, M(s(i)("consumer_groups.consumers.exit.description")), 1)
|
|
671
670
|
]),
|
|
672
671
|
_: 1
|
|
673
672
|
}, 8, ["title", "visible"])) : ae("", !0)
|
|
674
673
|
]);
|
|
675
674
|
};
|
|
676
675
|
}
|
|
677
|
-
}), Ao = /* @__PURE__ */ Ee(ho, [["__scopeId", "data-v-
|
|
676
|
+
}), Ao = /* @__PURE__ */ Ee(ho, [["__scopeId", "data-v-8e388f7f"]]), _o = { class: "kong-ui-entities-consumer-group-form" }, bo = { class: "select-item-container" }, Co = { class: "select-item-label" }, ko = {
|
|
678
677
|
key: 0,
|
|
679
678
|
class: "select-item-description"
|
|
680
679
|
}, Io = /* @__PURE__ */ _e({
|
|
@@ -703,8 +702,8 @@ const be = {
|
|
|
703
702
|
},
|
|
704
703
|
emits: ["update", "error", "loading"],
|
|
705
704
|
setup(e, { emit: L }) {
|
|
706
|
-
var ye,
|
|
707
|
-
const u = e,
|
|
705
|
+
var ye, re, ge;
|
|
706
|
+
const u = e, r = L, { i18n: { t: g } } = be.useI18n(), i = Fe(), n = Ae({
|
|
708
707
|
fields: {
|
|
709
708
|
name: "",
|
|
710
709
|
tags: "",
|
|
@@ -720,12 +719,12 @@ const be = {
|
|
|
720
719
|
debouncedQueryChange: Q,
|
|
721
720
|
loading: G,
|
|
722
721
|
error: ue,
|
|
723
|
-
loadItems:
|
|
722
|
+
loadItems: le,
|
|
724
723
|
results: D
|
|
725
|
-
} = De(u.config, (
|
|
724
|
+
} = De(u.config, (re = W.form[(ye = u.config) == null ? void 0 : ye.app]) == null ? void 0 : re.consumersList, "", {
|
|
726
725
|
fetchedItemsKey: "data",
|
|
727
726
|
searchKeys: ["username", "custom_id", "id"]
|
|
728
|
-
}), { axiosInstance: P } = we((ge = u.config) == null ? void 0 : ge.axiosRequestConfig), { getMessageFromError:
|
|
727
|
+
}), { axiosInstance: P } = we((ge = u.config) == null ? void 0 : ge.axiosRequestConfig), { getMessageFromError: ie } = ro(), X = to(), B = I(() => D.value.map((o) => ({
|
|
729
728
|
label: o.username || o.custom_id,
|
|
730
729
|
value: o.id,
|
|
731
730
|
selected: n.fields.consumers.includes(o.id),
|
|
@@ -733,28 +732,28 @@ const be = {
|
|
|
733
732
|
// we need this to determine whether or not to show the description text
|
|
734
733
|
}))), ee = I(() => {
|
|
735
734
|
var o, a;
|
|
736
|
-
return (a =
|
|
735
|
+
return (a = W.form[(o = u.config) == null ? void 0 : o.app]) == null ? void 0 : a.edit;
|
|
737
736
|
}), ce = I(() => u.consumerGroupId ? Ie.Edit : Ie.Create), U = I(() => !!n.fields.name && !oe.value), H = I(() => JSON.stringify(n.fields) !== JSON.stringify(E)), x = (o, a = "", k = "") => {
|
|
738
|
-
var c, A, V, $,
|
|
739
|
-
let
|
|
740
|
-
return ((V = u.config) == null ? void 0 : V.app) === "konnect" ?
|
|
737
|
+
var c, A, V, $, te, fe;
|
|
738
|
+
let l = `${(c = u.config) == null ? void 0 : c.apiBaseUrl}${W.form[(A = u.config) == null ? void 0 : A.app][o]}`;
|
|
739
|
+
return ((V = u.config) == null ? void 0 : V.app) === "konnect" ? l = l.replace(/{controlPlaneId}/gi, (($ = u.config) == null ? void 0 : $.controlPlaneId) || "") : ((te = u.config) == null ? void 0 : te.app) === "kongManager" && (l = l.replace(/\/{workspace}/gi, (fe = u.config) != null && fe.workspace ? `/${u.config.workspace}` : "")), l = l.replace(/{id}/gi, a || u.consumerGroupId), (o === "addConsumer" || o === "removeConsumer") && (l = l.replace(/{consumerId}/gi, k)), l;
|
|
741
740
|
}, de = () => {
|
|
742
741
|
var o;
|
|
743
|
-
|
|
744
|
-
},
|
|
745
|
-
|
|
742
|
+
i.push(((o = u.config) == null ? void 0 : o.cancelRoute) || { name: "consumer-group-list" });
|
|
743
|
+
}, z = (o) => {
|
|
744
|
+
r("error", o);
|
|
746
745
|
}, me = (o) => {
|
|
747
|
-
|
|
746
|
+
r("loading", o);
|
|
748
747
|
}, T = async (o) => {
|
|
749
|
-
var k,
|
|
750
|
-
n.fields.name = ((k = o == null ? void 0 : o.item) == null ? void 0 : k.name) || ((
|
|
748
|
+
var k, l, c, A, V;
|
|
749
|
+
n.fields.name = ((k = o == null ? void 0 : o.item) == null ? void 0 : k.name) || ((l = o == null ? void 0 : o.consumer_group) == null ? void 0 : l.name) || (o == null ? void 0 : o.name) || "";
|
|
751
750
|
const a = ((c = o == null ? void 0 : o.item) == null ? void 0 : c.tags) || (o == null ? void 0 : o.consumer_group.tags) || (o == null ? void 0 : o.tags) || [];
|
|
752
751
|
if (n.fields.tags = (a == null ? void 0 : a.join(", ")) || "", "consumers" in o)
|
|
753
752
|
n.fields.consumers = ((A = o == null ? void 0 : o.consumers) == null ? void 0 : A.map(($) => $.id)) || [];
|
|
754
753
|
else
|
|
755
754
|
try {
|
|
756
755
|
const { data: $ } = await P.get(x("getConsumers"));
|
|
757
|
-
n.fields.consumers = "consumers" in $ ? (V = $ == null ? void 0 : $.consumers) == null ? void 0 : V.map((
|
|
756
|
+
n.fields.consumers = "consumers" in $ ? (V = $ == null ? void 0 : $.consumers) == null ? void 0 : V.map((te) => te.id) : [];
|
|
758
757
|
} catch ($) {
|
|
759
758
|
d($);
|
|
760
759
|
}
|
|
@@ -766,13 +765,13 @@ const be = {
|
|
|
766
765
|
tags: (a = (o = n.fields.tags.split(",")) == null ? void 0 : o.map((k) => String(k || "").trim())) == null ? void 0 : a.filter((k) => k !== "")
|
|
767
766
|
};
|
|
768
767
|
}), p = async (o, a = "") => await P.post(x("addConsumer", a, o), { consumer: o }), y = async (o, a = "") => await P.delete(x("removeConsumer", a, o)), d = (o) => {
|
|
769
|
-
n.errorMessage =
|
|
768
|
+
n.errorMessage = ie(o), r("error", o);
|
|
770
769
|
}, _ = (o = u.consumerGroupId) => {
|
|
771
|
-
Object.assign(E, n.fields),
|
|
770
|
+
Object.assign(E, n.fields), r("update", { ...n.fields, id: o });
|
|
772
771
|
}, K = (o, a, k = u.consumerGroupId) => {
|
|
773
|
-
const
|
|
774
|
-
|
|
775
|
-
code:
|
|
772
|
+
const l = o == null ? void 0 : o.find((c) => c.status !== "fulfilled");
|
|
773
|
+
l ? d({
|
|
774
|
+
code: l.status,
|
|
776
775
|
message: a
|
|
777
776
|
}) : _(k);
|
|
778
777
|
}, Y = async () => {
|
|
@@ -785,7 +784,7 @@ const be = {
|
|
|
785
784
|
}
|
|
786
785
|
if (n.fields.consumers.length > 0 && o)
|
|
787
786
|
try {
|
|
788
|
-
const a = n.fields.consumers.map((
|
|
787
|
+
const a = n.fields.consumers.map((l) => p(l, o)), k = await Promise.allSettled(a);
|
|
789
788
|
K(k, g("consumer_groups.errors.add_consumer"), o);
|
|
790
789
|
} catch (a) {
|
|
791
790
|
d(a);
|
|
@@ -795,26 +794,26 @@ const be = {
|
|
|
795
794
|
var k;
|
|
796
795
|
try {
|
|
797
796
|
((k = u.config) == null ? void 0 : k.app) === "konnect" ? await P.put(x("edit"), J.value) : await P.patch(x("edit"), J.value);
|
|
798
|
-
} catch (
|
|
799
|
-
d(
|
|
797
|
+
} catch (l) {
|
|
798
|
+
d(l);
|
|
800
799
|
}
|
|
801
|
-
const o = n.fields.consumers.filter((
|
|
800
|
+
const o = n.fields.consumers.filter((l) => !E.consumers.includes(l)), a = E.consumers.filter((l) => !n.fields.consumers.includes(l));
|
|
802
801
|
if (a.length === 0 && o.length === 0)
|
|
803
802
|
_();
|
|
804
803
|
else {
|
|
805
804
|
if (a.length > 0)
|
|
806
805
|
try {
|
|
807
|
-
const
|
|
806
|
+
const l = a.map((A) => y(A)), c = await Promise.allSettled(l);
|
|
808
807
|
K(c, g("consumer_groups.errors.remove_consumer"));
|
|
809
|
-
} catch (
|
|
810
|
-
d(
|
|
808
|
+
} catch (l) {
|
|
809
|
+
d(l);
|
|
811
810
|
}
|
|
812
811
|
if (o.length > 0)
|
|
813
812
|
try {
|
|
814
|
-
const
|
|
813
|
+
const l = o.map((A) => p(A)), c = await Promise.allSettled(l);
|
|
815
814
|
K(c, g("consumer_groups.errors.add_consumer"));
|
|
816
|
-
} catch (
|
|
817
|
-
d(
|
|
815
|
+
} catch (l) {
|
|
816
|
+
d(l);
|
|
818
817
|
}
|
|
819
818
|
}
|
|
820
819
|
}, Ce = async () => {
|
|
@@ -825,9 +824,9 @@ const be = {
|
|
|
825
824
|
}
|
|
826
825
|
};
|
|
827
826
|
return Ke(async () => {
|
|
828
|
-
await
|
|
827
|
+
await le();
|
|
829
828
|
}), (o, a) => {
|
|
830
|
-
const k = F("KInput"),
|
|
829
|
+
const k = F("KInput"), l = F("KMultiselect");
|
|
831
830
|
return w(), j("div", _o, [
|
|
832
831
|
h(s(so), {
|
|
833
832
|
"can-submit": U.value && H.value,
|
|
@@ -840,7 +839,7 @@ const be = {
|
|
|
840
839
|
"form-fields": J.value,
|
|
841
840
|
"is-readonly": n.readonly,
|
|
842
841
|
onCancel: de,
|
|
843
|
-
"onFetch:error": a[3] || (a[3] = (c) =>
|
|
842
|
+
"onFetch:error": a[3] || (a[3] = (c) => z(c)),
|
|
844
843
|
"onFetch:success": T,
|
|
845
844
|
onLoading: a[4] || (a[4] = (c) => me(c)),
|
|
846
845
|
onSubmit: Ce
|
|
@@ -886,7 +885,7 @@ const be = {
|
|
|
886
885
|
title: s(g)("consumer_groups.form.consumers.title")
|
|
887
886
|
}, {
|
|
888
887
|
default: f(() => [
|
|
889
|
-
h(
|
|
888
|
+
h(l, {
|
|
890
889
|
modelValue: n.fields.consumers,
|
|
891
890
|
"onUpdate:modelValue": a[2] || (a[2] = (c) => n.fields.consumers = c),
|
|
892
891
|
appearance: "select",
|
|
@@ -953,7 +952,7 @@ const be = {
|
|
|
953
952
|
},
|
|
954
953
|
emits: ["loading", "fetch:error", "fetch:success"],
|
|
955
954
|
setup(e) {
|
|
956
|
-
const L = e, { i18n: { t: u } } = be.useI18n(),
|
|
955
|
+
const L = e, { i18n: { t: u } } = be.useI18n(), r = I(() => W.form[L.config.app].edit), g = C({
|
|
957
956
|
id: {},
|
|
958
957
|
name: {},
|
|
959
958
|
created_at: {},
|
|
@@ -962,7 +961,7 @@ const be = {
|
|
|
962
961
|
tooltip: u("consumer_groups.form.fields.tags.tooltip")
|
|
963
962
|
}
|
|
964
963
|
});
|
|
965
|
-
return (
|
|
964
|
+
return (i, n) => (w(), j("div", $o, [
|
|
966
965
|
h(s(no), {
|
|
967
966
|
config: e.config,
|
|
968
967
|
"config-card-doc": e.configCardDoc,
|
|
@@ -970,11 +969,11 @@ const be = {
|
|
|
970
969
|
"data-key": "consumer_group",
|
|
971
970
|
"enable-terraform": e.enableTerraform,
|
|
972
971
|
"entity-type": s(Be).ConsumerGroup,
|
|
973
|
-
"fetch-url":
|
|
972
|
+
"fetch-url": r.value,
|
|
974
973
|
"hide-title": e.hideTitle,
|
|
975
|
-
"onFetch:error": n[0] || (n[0] = (E) =>
|
|
976
|
-
"onFetch:success": n[1] || (n[1] = (E) =>
|
|
977
|
-
onLoading: n[2] || (n[2] = (E) =>
|
|
974
|
+
"onFetch:error": n[0] || (n[0] = (E) => i.$emit("fetch:error", E)),
|
|
975
|
+
"onFetch:success": n[1] || (n[1] = (E) => i.$emit("fetch:success", E)),
|
|
976
|
+
onLoading: n[2] || (n[2] = (E) => i.$emit("loading", E))
|
|
978
977
|
}, null, 8, ["config", "config-card-doc", "config-schema", "enable-terraform", "entity-type", "fetch-url", "hide-title"])
|
|
979
978
|
]));
|
|
980
979
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(B,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/entities-shared"],e):(B=typeof globalThis<"u"?globalThis:B||self,e(B["kong-ui-public-entities-consumer-groups"]={},B.Vue,B.VueRouter,B.KongIcons,B["kong-ui-public-i18n"],B["kong-ui-public-entities-shared"]))})(this,function(B,e,me,he,pe,f){"use strict";const Ce={consumer_groups:{list:{table_headers:{name:"Name",consumers_count:"Consumers",tags:"Tags",id:"ID"},empty_state:{title:"Configure a New Consumer Group",description:"Use consumer groups to manage custom rate limiting configuration for subsets of consumers.",title_for_consumer:"Add to a Consumer Group"},toolbar_actions:{new_consumer_group:"New Consumer Group"}},title:"Consumer Groups",search:{placeholder:"Filter by exact name or ID"},actions:{add_to_group:"Add to Consumer Group",create:"New Consumer Group",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",exit:"Exit",view:"View Details"},delete:{title:"Delete a Consumer Group",description:"Deleting this group will remove this group from all plugins and its rate limit configuration. This action cannot be reversed."},consumers:{add:{title:"Add To Consumer Groups",ctaText:"Add this consumer to consumer groups",consumer_groups_label:"Consumer Groups",consumer_group_placeholder:"Add to consumer groups",footer:"Search by exact name or ID to find consumer groups not included in the list"},exit:{title:"Exit from a Consumer Group",confirmation:"Are you sure you want to remove consumer {consumer} from consumer group {consumerGroup}?",confirmationNoUsername:"Are you sure you want this consumer to exit from consumer group {consumerGroup}?",description:"Exiting from the group could change the rate limit policy applied to this consumer."}},errors:{general:"Consumer Groups could not be retrieved",delete:"The consumer group could not be deleted at this time.",copy:"Failed to copy to clipboard",add:"The consumer could not be added to some groups at this time.",already_added:"The consumer is already in this consumer group",add_consumer:"An unexpected error occurred while adding consumers. Please try again.",remove_consumer:"An unexpected error occurred while removing consumers. Please try again."},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{general_info:{title:"General Information",description:"General information will help identify and manage this consumer group."},consumers:{title:"Consumers",description:"Add or remove consumers from this group"},fields:{name:{label:"Name",placeholder:"Enter a unique name for this consumer group "},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."},consumers:{label:"Consumers",placeholder:"Select one or more consumers"}}}}};function _e(){const o=pe.createI18n("en-us",Ce);return{i18n:o,i18nT:pe.i18nTComponent(o)}}const ce={useI18n:_e},T="/v2/control-planes/{controlPlaneId}/core-entities",G="/{workspace}",q={list:{konnect:{all:`${T}/consumer_groups`,forModal:`${T}/consumer_groups`,forConsumer:`${T}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${T}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`},kongManager:{all:`${G}/consumer_groups?counter=true`,forModal:`${G}/consumer_groups`,forConsumer:`${G}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${G}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`}},form:{konnect:{consumersList:`${T}/consumers`,create:`${T}/consumer_groups`,edit:`${T}/consumer_groups/{id}`,addConsumer:`${T}/consumer_groups/{id}/consumers`,removeConsumer:`${T}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${T}/consumer_groups/{id}/consumers`},kongManager:{consumersList:`${G}/consumers`,create:`${G}/consumer_groups`,edit:`${G}/consumer_groups/{id}`,addConsumer:`${G}/consumer_groups/{id}/consumers`,removeConsumer:`${G}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${G}/consumer_groups/{id}/consumers`}}},be={class:"add-to-group-form-container"},ke={class:"add-to-group-cta-text"},we={key:0,class:"kong-ui-entity-add-to-groups-error"},xe={key:0},Ie=e.defineComponent({__name:"AddToGroupModal",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||!o.consumerId)},visible:{type:Boolean,required:!0,default:!1}},emits:["cancel","add:success","add:partial-success","error"],setup(o,{emit:S}){var R;const{i18n:{t:c}}=ce.useI18n(),r=o,g=S,{axiosInstance:i}=f.useAxios((R=r.config)==null?void 0:R.axiosRequestConfig),s=e.ref([]),{debouncedQueryChange:w,loading:U,allRecords:I,error:Y,loadItems:Z,results:D}=f.useDebouncedFilter(r.config,q.list[r.config.app].forModal,"",{fetchedItemsKey:"data",searchKeys:["name","id"]}),$=e.computed(()=>Y.value?c("consumer_groups.errors.general"):""),v=e.ref(0),L=e.computed(()=>I.value===void 0),A=e.computed(()=>D.value.map(p=>({label:p.name,value:p.id,selected:s.value.includes(p.id),data:p}))),J=p=>{var d;const h=L.value?D.value.find(C=>C.id===p):(d=I.value)==null?void 0:d.find(C=>C.id===p);return h?h.name:p},ee=()=>{x.value="",P.value=[],N.value=[],g("cancel")},P=e.ref([]),O=e.ref(!1),x=e.ref(""),oe=async()=>{if(!s.value.length){x.value="",N.value=[],g("cancel");return}O.value=!0,x.value="",P.value=[],N.value=[];try{const p=s.value.map(C=>te(C)),h=await Promise.allSettled(p);let d=!0;h.forEach(C=>{C.status!=="fulfilled"&&(d=!1)}),d?(P.value=[],N.value=[],g("add:success",s.value),s.value=[]):(P.value.length&&g("add:partial-success",P.value),s.value=[],W(h))}catch{x.value=c("consumer_groups.errors.add"),g("error",x.value)}finally{O.value=!1}},j=e.computed(()=>{var h,d,C,M;let p=`${r.config.apiBaseUrl}${q.list[r.config.app].forConsumer}`;return r.config.app==="konnect"?p=p.replace(/{controlPlaneId}/gi,((h=r.config)==null?void 0:h.controlPlaneId)||"").replace(/{consumerId}/gi,((d=r.config)==null?void 0:d.consumerId)||""):r.config.app==="kongManager"&&(p=p.replace(/\/{workspace}/gi,(C=r.config)!=null&&C.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((M=r.config)==null?void 0:M.consumerId)||"")),p}),te=async p=>{const h={group:p};try{const d=await i.post(j.value,h);return P.value.push(p),d}catch(d){let C=`${J(p)} - ${d.message}`;return d.response.status===409&&(C=`${J(p)} - ${c("consumer_groups.errors.already_added")}`),Promise.reject(Error(C))}},N=e.ref([]),W=p=>{N.value=p.map(h=>{var d;return(d=h.reason)==null?void 0:d.message}).filter(Boolean)};return e.watch(A,()=>{v.value++},{immediate:!0,deep:!0}),e.watch(()=>r.visible,()=>{r.visible&&Z()},{immediate:!0}),(p,h)=>{const d=e.resolveComponent("KMultiselect"),C=e.resolveComponent("KAlert"),M=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(M,{"action-button-disabled":O.value,class:"kong-ui-entities-add-to-groups-modal","data-testid":"add-to-group-modal",title:e.unref(c)("consumer_groups.consumers.add.title"),visible:o.visible,onCancel:ee,onProceed:oe},{default:e.withCtx(()=>[e.createElementVNode("div",be,[e.createElementVNode("p",ke,e.toDisplayString(e.unref(c)("consumer_groups.consumers.add.ctaText")),1),e.createVNode(d,{modelValue:s.value,"onUpdate:modelValue":h[0]||(h[0]=Q=>s.value=Q),autosuggest:"","data-testid":"add-to-groups-multiselect","dropdown-footer-text":L.value?e.unref(c)("consumer_groups.consumers.add.footer"):void 0,items:A.value,label:e.unref(c)("consumer_groups.consumers.add.consumer_groups_label"),loading:e.unref(U),placeholder:e.unref(c)("consumer_groups.consumers.add.consumer_group_placeholder"),readonly:O.value,required:"",width:"100%",onQueryChange:e.unref(w)},null,8,["modelValue","dropdown-footer-text","items","label","loading","placeholder","readonly","onQueryChange"]),x.value||$.value||N.value.length?(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(C,{appearance:"danger"},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(e.unref(c)("consumer_groups.errors.add")),1),N.value.length?(e.openBlock(),e.createElementBlock("ul",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(Q,re)=>(e.openBlock(),e.createElementBlock("li",{key:re},e.toDisplayString(Q),1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(x.value||$.value),1)]),_:1})])):e.createCommentVNode("",!0)])]),_:1},8,["action-button-disabled","title","visible"])}}}),ie=(o,S)=>{const c=o.__vccOpts||o;for(const[r,g]of S)c[r]=g;return c},Ee=ie(Ie,[["__scopeId","data-v-4260ce03"]]),Ve={class:"kong-ui-entities-consumer-groups-list"},Be={key:1},Ne=ie(e.defineComponent({__name:"ConsumerGroupList",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||!o.createRoute||!o.getViewRoute||!o.getEditRoute||o.app==="kongManager"&&!o.isExactMatch&&!o.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","add:success","remove:success"],setup(o,{emit:S}){var ge;const c=S,r=o,{i18nT:g,i18n:{t:i}}=ce.useI18n(),s=me.useRouter(),{axiosInstance:w}=f.useAxios((ge=r.config)==null?void 0:ge.axiosRequestConfig),U=e.ref(1),I=e.computed(()=>!!r.config.consumerId),Y=e.computed(()=>I.value?"kong-ui-entities-consumer-groups-list-in-consumer-page":"kong-ui-entities-consumer-groups-list"),Z=e.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),D={name:{label:i("consumer_groups.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1}};r.config.app==="kongManager"&&(D.consumers_count={label:i("consumer_groups.list.table_headers.consumers_count"),searchable:!1,sortable:!1}),D.tags={label:i("consumer_groups.list.table_headers.tags"),sortable:!1};const $=D,v=n=>({"data-testid":n.username??n.custom_id??n.id}),L=e.computed(()=>{var m,_,V,K;let n=`${r.config.apiBaseUrl}${q.list[r.config.app][I.value?"forConsumer":"all"]}`;return r.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||"").replace(/{consumerId}/gi,((_=r.config)==null?void 0:_.consumerId)||""):r.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(V=r.config)!=null&&V.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((K=r.config)==null?void 0:K.consumerId)||"")),n}),A=e.ref(""),J=e.computed(()=>{const n=r.config.app==="konnect"||r.config.isExactMatch;return n?{isExactMatch:n,fields:{username:D.name,id:{label:i("consumer_groups.list.table_headers.id")}},placeholder:i("consumer_groups.search.placeholder")}:{isExactMatch:n,fields:{name:D.name},schema:r.config.filterSchema}}),ee=e.computed(()=>r.config.app==="konnect"&&A.value?"consumer_group":I.value&&!r.config.paginatedEndpoint?"consumer_groups":void 0),{fetcher:P,fetcherState:O}=f.useFetcher(r.config,L.value,ee),x=()=>{A.value=""},oe=()=>{U.value++},j=e.ref(null),te=(n,m)=>{const _=n.id;if(!m(_)){c("copy:error",{entity:n,field:"id",message:i("consumer_groups.errors.copy")});return}c("copy:success",{entity:n,field:"id",message:i("consumer_groups.copy.success",{val:_})})},N=(n,m)=>{const _=JSON.stringify(n);if(!m(_)){c("copy:error",{entity:n,message:i("consumer_groups.errors.copy")});return}c("copy:success",{entity:n,message:i("consumer_groups.copy.success_brief")})},W=async n=>{var _;await((_=r.canRetrieve)==null?void 0:_.call(r,n))&&s.push(r.config.getViewRoute(n.id))},R=n=>({label:i("consumer_groups.actions.view"),to:r.config.getViewRoute(n)}),p=n=>({label:i("consumer_groups.actions.edit"),to:r.config.getEditRoute(n)}),h=e.ref(void 0),d=e.ref(!1),C=e.ref(!1),M=e.ref(""),Q=f.useDeleteUrlBuilder(r.config,L.value),re=n=>{h.value=n,d.value=!0},ue=()=>{d.value=!1},le=async()=>{var n,m,_;if((n=h.value)!=null&&n.id){C.value=!0;try{await w.delete(Q(h.value.id)),C.value=!1,d.value=!1,U.value++,c("delete:success",h.value)}catch(V){M.value=((_=(m=V.response)==null?void 0:m.data)==null?void 0:_.message)||V.message||i("consumer_groups.errors.delete"),c("error",V)}finally{C.value=!1}}},H=e.ref(!1),ne=()=>{H.value=!0},t=()=>{H.value=!1},a=(n,m)=>{m||t(),U.value++,c("add:success",n)},b=()=>{I.value&&ne()},l=e.ref(void 0),u=e.ref(!1),E=e.ref(""),F=n=>{l.value=n,u.value=!0},k=()=>{u.value=!1,l.value=void 0},z=e.computed(()=>{var m,_,V,K;let n=`${r.config.apiBaseUrl}${q.list[r.config.app].oneForConsumer}`;return r.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||"").replace(/{consumerId}/gi,((_=r.config)==null?void 0:_.consumerId)||""):r.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(V=r.config)!=null&&V.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((K=r.config)==null?void 0:K.consumerId)||"")),n}),se=e.ref(!1),Fe=async()=>{if(l.value){se.value=!0;try{const n=z.value.replace(/{consumerGroupId}/gi,l.value.id);await w.delete(n),c("remove:success",l.value),k(),U.value++}catch(n){E.value=n.message||i("consumer_groups.errors.delete"),c("error",n)}finally{se.value=!1}}},fe=e.ref(!1);e.watch(O,n=>{var m,_,V,K;if(Array.isArray((m=n==null?void 0:n.response)==null?void 0:m.data)&&(fe.value=n.response.data.length>0),n.status===f.FetcherStatus.Error){j.value={title:i("consumer_groups.errors.general")},(K=(V=(_=n.error)==null?void 0:_.response)==null?void 0:V.data)!=null&&K.message&&(j.value.message=n.error.response.data.message),c("error",n.error);return}j.value=null});const de=e.ref({ctaPath:I.value?void 0:r.config.createRoute,ctaText:void 0,message:`${i("consumer_groups.list.empty_state.description")}${r.config.additionMessageForEmptyState?` ${r.config.additionMessageForEmptyState}`:""}`,title:i("consumer_groups.title")});return e.onBeforeMount(async()=>{await r.canCreate()&&(de.value.title=I.value?i("consumer_groups.list.empty_state.title_for_consumer"):i("consumer_groups.list.empty_state.title"),de.value.ctaText=I.value?i("consumer_groups.actions.add_to_group"):i("consumer_groups.actions.create"))}),(n,m)=>{const _=e.resolveComponent("KButton"),V=e.resolveComponent("KBadge"),K=e.resolveComponent("KTruncate"),ae=e.resolveComponent("KDropdownItem"),ye=e.resolveComponent("KClipboardProvider"),Ke=e.resolveComponent("KPrompt");return e.openBlock(),e.createElementBlock("div",Ve,[e.createVNode(e.unref(f.EntityBaseTable),{"cache-identifier":o.cacheIdentifier,"disable-pagination":I.value&&!o.config.paginatedEndpoint,"disable-pagination-page-jump":"","disable-sorting":Z.value,"empty-state-options":de.value,"enable-entity-actions":"","error-message":j.value,fetcher:e.unref(P),"fetcher-cache-key":U.value,"pagination-type":"offset","preferences-storage-key":Y.value,query:A.value,"row-attributes":v,"table-headers":e.unref($),"use-action-outside":o.useActionOutside,onClearSearchInput:x,"onClick:row":m[3]||(m[3]=y=>W(y)),onEmptyStateCtaClicked:b,onSort:oe},{"toolbar-filter":e.withCtx(()=>[I.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(f.EntityFilter),{key:0,modelValue:A.value,"onUpdate:modelValue":m[0]||(m[0]=y=>A.value=y),config:J.value},null,8,["modelValue","config"]))]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!o.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>o.canCreate()},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(_,{appearance:"primary","data-testid":"toolbar-add-consumer-group",size:"large",to:o.config.consumerId?void 0:o.config.createRoute,onClick:m[1]||(m[1]=()=>o.config.consumerId?ne():void 0)},{default:e.withCtx(()=>[e.createVNode(e.unref(he.AddIcon)),e.createTextVNode(" "+e.toDisplayString(o.config.consumerId?e.unref(i)("consumer_groups.actions.add_to_group"):e.unref(i)("consumer_groups.list.toolbar_actions.new_consumer_group")),1)]),_:1},8,["to"]),[[e.vShow,fe.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:e.withCtx(({rowValue:y})=>[e.createElementVNode("b",null,e.toDisplayString(y??"-"),1)]),consumers_count:e.withCtx(({rowValue:y})=>[e.createTextVNode(e.toDisplayString(y??"-"),1)]),tags:e.withCtx(({rowValue:y})=>[(y==null?void 0:y.length)>0?(e.openBlock(),e.createBlock(K,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y,X=>(e.openBlock(),e.createBlock(V,{key:X,onClick:m[2]||(m[2]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(X),1)]),_:2},1024))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",Be,"-"))]),actions:e.withCtx(({row:y})=>[e.createVNode(ye,null,{default:e.withCtx(({copyToClipboard:X})=>[e.createVNode(ae,{"data-testid":"action-entity-copy-id",onClick:Se=>te(y,X)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("consumer_groups.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(ye,null,{default:e.withCtx(({copyToClipboard:X})=>[e.createVNode(ae,{"data-testid":"action-entity-copy-json",onClick:Se=>N(y,X)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("consumer_groups.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>o.canRetrieve(y)},{default:e.withCtx(()=>[e.createVNode(ae,{"data-testid":"action-entity-view","has-divider":"",item:R(y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>o.canEdit(y)},{default:e.withCtx(()=>[e.createVNode(ae,{"data-testid":"action-entity-edit",item:p(y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>o.canDelete(y)},{default:e.withCtx(()=>[e.createVNode(ae,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:()=>o.config.consumerId?F(y):re(y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.config.consumerId?e.unref(i)("consumer_groups.actions.exit"):e.unref(i)("consumer_groups.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-pagination","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","preferences-storage-key","query","table-headers","use-action-outside"]),e.createVNode(e.unref(f.EntityDeleteModal),{"action-pending":C.value,"data-testid":"delete-consumer-group-modal",description:e.unref(i)("consumer_groups.delete.description"),"entity-name":h.value&&(h.value.name||h.value.id),"entity-type":e.unref(f.EntityTypes).ConsumerGroup,error:M.value,title:e.unref(i)("consumer_groups.delete.title"),visible:d.value,onCancel:ue,onProceed:le},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"]),o.config.consumerId?(e.openBlock(),e.createBlock(Ee,{key:0,config:o.config,"data-testid":"add-to-group-modal",visible:H.value,"onAdd:partialSuccess":m[4]||(m[4]=y=>a(y,!0)),"onAdd:success":m[5]||(m[5]=y=>a(y)),onCancel:t},null,8,["config","visible"])):e.createCommentVNode("",!0),o.config.consumerId&&l.value?(e.openBlock(),e.createBlock(Ke,{key:1,"action-button-appearance":"danger","data-testid":"exit-group-modal",title:e.unref(i)("consumer_groups.consumers.exit.title"),visible:u.value,onCancel:k,onProceed:Fe},{default:e.withCtx(()=>[e.createVNode(e.unref(g),{class:"exit-modal-message",keypath:o.config.consumerUsername?"consumer_groups.consumers.exit.confirmation":"consumer_groups.consumers.exit.confirmationNoUsername",tag:"p"},e.createSlots({consumerGroup:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(l.value.name||l.value.id),1)]),_:2},[o.config.consumerUsername?{name:"consumer",fn:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(o.config.consumerUsername),1)]),key:"0"}:void 0]),1032,["keypath"]),e.createElementVNode("p",null,e.toDisplayString(e.unref(i)("consumer_groups.consumers.exit.description")),1)]),_:1},8,["title","visible"])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-b6301615"]]),$e={class:"kong-ui-entities-consumer-group-form"},Me={class:"select-item-container"},Te={class:"select-item-label"},Ge={key:0,class:"select-item-description"},De=ie(e.defineComponent({__name:"ConsumerGroupForm",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||(o==null?void 0:o.app)==="konnect"&&!(o!=null&&o.controlPlaneId)||(o==null?void 0:o.app)==="kongManager"&&typeof(o==null?void 0:o.workspace)!="string"||!(o!=null&&o.cancelRoute))},consumerGroupId:{type:String,required:!1,default:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(o,{emit:S}){var le,H,ne;const c=o,r=S,{i18n:{t:g}}=ce.useI18n(),i=me.useRouter(),s=e.reactive({fields:{name:"",tags:"",consumers:[]},errorMessage:"",readonly:!1}),w=e.reactive({name:"",tags:"",consumers:[]}),{debouncedQueryChange:U,loading:I,error:Y,loadItems:Z,results:D}=f.useDebouncedFilter(c.config,(H=q.form[(le=c.config)==null?void 0:le.app])==null?void 0:H.consumersList,"",{fetchedItemsKey:"data",searchKeys:["username","custom_id","id"]}),{axiosInstance:$}=f.useAxios((ne=c.config)==null?void 0:ne.axiosRequestConfig),{getMessageFromError:v}=f.useErrors(),L=f.useValidators(),A=e.computed(()=>D.value.map(t=>({label:t.username||t.custom_id,value:t.id,selected:s.fields.consumers.includes(t.id),data:t}))),J=e.computed(()=>{var t,a;return(a=q.form[(t=c.config)==null?void 0:t.app])==null?void 0:a.edit}),ee=e.computed(()=>c.consumerGroupId?f.EntityBaseFormType.Edit:f.EntityBaseFormType.Create),P=e.computed(()=>!!s.fields.name&&!W.value),O=e.computed(()=>JSON.stringify(s.fields)!==JSON.stringify(w)),x=(t,a="",b="")=>{var u,E,F,k,z,se;let l=`${(u=c.config)==null?void 0:u.apiBaseUrl}${q.form[(E=c.config)==null?void 0:E.app][t]}`;return((F=c.config)==null?void 0:F.app)==="konnect"?l=l.replace(/{controlPlaneId}/gi,((k=c.config)==null?void 0:k.controlPlaneId)||""):((z=c.config)==null?void 0:z.app)==="kongManager"&&(l=l.replace(/\/{workspace}/gi,(se=c.config)!=null&&se.workspace?`/${c.config.workspace}`:"")),l=l.replace(/{id}/gi,a||c.consumerGroupId),(t==="addConsumer"||t==="removeConsumer")&&(l=l.replace(/{consumerId}/gi,b)),l},oe=()=>{var t;i.push(((t=c.config)==null?void 0:t.cancelRoute)||{name:"consumer-group-list"})},j=t=>{r("error",t)},te=t=>{r("loading",t)},N=async t=>{var b,l,u,E,F;s.fields.name=((b=t==null?void 0:t.item)==null?void 0:b.name)||((l=t==null?void 0:t.consumer_group)==null?void 0:l.name)||(t==null?void 0:t.name)||"";const a=((u=t==null?void 0:t.item)==null?void 0:u.tags)||(t==null?void 0:t.consumer_group.tags)||(t==null?void 0:t.tags)||[];if(s.fields.tags=(a==null?void 0:a.join(", "))||"","consumers"in t)s.fields.consumers=((E=t==null?void 0:t.consumers)==null?void 0:E.map(k=>k.id))||[];else try{const{data:k}=await $.get(x("getConsumers"));s.fields.consumers="consumers"in k?(F=k==null?void 0:k.consumers)==null?void 0:F.map(z=>z.id):[]}catch(k){d(k)}Object.assign(w,s.fields)},W=e.computed(()=>L.utf8Name(s.fields.name)),R=e.computed(()=>{var t,a;return{name:s.fields.name,tags:(a=(t=s.fields.tags.split(","))==null?void 0:t.map(b=>String(b||"").trim()))==null?void 0:a.filter(b=>b!=="")}}),p=async(t,a="")=>await $.post(x("addConsumer",a,t),{consumer:t}),h=async(t,a="")=>await $.delete(x("removeConsumer",a,t)),d=t=>{s.errorMessage=v(t),r("error",t)},C=(t=c.consumerGroupId)=>{Object.assign(w,s.fields),r("update",{...s.fields,id:t})},M=(t,a,b=c.consumerGroupId)=>{const l=t==null?void 0:t.find(u=>u.status!=="fulfilled");l?d({code:l.status,message:a}):C(b)},Q=async()=>{let t="";try{const{data:a}=await $.post(x("create"),R.value);t="item"in a?a.item.id:a.id}catch(a){d(a)}if(s.fields.consumers.length>0&&t)try{const a=s.fields.consumers.map(l=>p(l,t)),b=await Promise.allSettled(a);M(b,g("consumer_groups.errors.add_consumer"),t)}catch(a){d(a)}else s.fields.consumers.length===0&&t&&C(t)},re=async()=>{var b;try{((b=c.config)==null?void 0:b.app)==="konnect"?await $.put(x("edit"),R.value):await $.patch(x("edit"),R.value)}catch(l){d(l)}const t=s.fields.consumers.filter(l=>!w.consumers.includes(l)),a=w.consumers.filter(l=>!s.fields.consumers.includes(l));if(a.length===0&&t.length===0)C();else{if(a.length>0)try{const l=a.map(E=>h(E)),u=await Promise.allSettled(l);M(u,g("consumer_groups.errors.remove_consumer"))}catch(l){d(l)}if(t.length>0)try{const l=t.map(E=>p(E)),u=await Promise.allSettled(l);M(u,g("consumer_groups.errors.add_consumer"))}catch(l){d(l)}}},ue=async()=>{try{s.readonly=!0,ee.value===f.EntityBaseFormType.Create?await Q():await re()}finally{s.readonly=!1}};return e.onBeforeMount(async()=>{await Z()}),(t,a)=>{const b=e.resolveComponent("KInput"),l=e.resolveComponent("KMultiselect");return e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(e.unref(f.EntityBaseForm),{"can-submit":P.value&&O.value,config:o.config,"edit-id":o.consumerGroupId,"enable-terraform":o.enableTerraform,"entity-type":e.unref(f.SupportedEntityType).ConsumerGroup,"error-message":s.errorMessage||e.unref(Y)||W.value,"fetch-url":J.value,"form-fields":R.value,"is-readonly":s.readonly,onCancel:oe,"onFetch:error":a[3]||(a[3]=u=>j(u)),"onFetch:success":N,onLoading:a[4]||(a[4]=u=>te(u)),onSubmit:ue},{default:e.withCtx(()=>[e.createVNode(e.unref(f.EntityFormSection),{description:e.unref(g)("consumer_groups.form.general_info.description"),title:e.unref(g)("consumer_groups.form.general_info.title")},{default:e.withCtx(()=>[e.createVNode(b,{modelValue:s.fields.name,"onUpdate:modelValue":a[0]||(a[0]=u=>s.fields.name=u),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-group-form-name",label:e.unref(g)("consumer_groups.form.fields.name.label"),placeholder:e.unref(g)("consumer_groups.form.fields.name.placeholder"),required:"",type:"text"},null,8,["modelValue","label","placeholder"]),e.createVNode(b,{modelValue:s.fields.tags,"onUpdate:modelValue":a[1]||(a[1]=u=>s.fields.tags=u),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-group-form-tags",help:e.unref(g)("consumer_groups.form.fields.tags.help"),label:e.unref(g)("consumer_groups.form.fields.tags.label"),"label-attributes":{info:e.unref(g)("consumer_groups.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(g)("consumer_groups.form.fields.tags.placeholder"),type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder"])]),_:1},8,["description","title"]),e.createVNode(e.unref(f.EntityFormSection),{description:e.unref(g)("consumer_groups.form.consumers.description"),"has-divider":"",title:e.unref(g)("consumer_groups.form.consumers.title")},{default:e.withCtx(()=>[e.createVNode(l,{modelValue:s.fields.consumers,"onUpdate:modelValue":a[2]||(a[2]=u=>s.fields.consumers=u),appearance:"select",autosuggest:"",items:A.value,label:e.unref(g)("consumer_groups.form.fields.consumers.label"),loading:e.unref(I),placeholder:e.unref(g)("consumer_groups.form.fields.consumers.placeholder"),width:"auto",onQueryChange:e.unref(U)},{"item-template":e.withCtx(({item:u})=>{var E,F,k;return[e.createElementVNode("div",Me,[e.createElementVNode("div",Te,e.toDisplayString(u.label),1),(E=u==null?void 0:u.data)!=null&&E.username&&((F=u==null?void 0:u.data)!=null&&F.custom_id)?(e.openBlock(),e.createElementBlock("div",Ge,e.toDisplayString((k=u==null?void 0:u.data)==null?void 0:k.custom_id),1)):e.createCommentVNode("",!0)])]}),_:1},8,["modelValue","items","label","loading","placeholder","onQueryChange"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-6b48d0fc"]]),Ae={class:"kong-ui-consumer-group-entity-config-card"},Pe=e.defineComponent({__name:"ConsumerGroupConfigCard",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||o.app==="konnect"&&!o.controlPlaneId||o.app==="kongManager"&&typeof o.workspace!="string"||!o.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(o){const S=o,{i18n:{t:c}}=ce.useI18n(),r=e.computed(()=>q.form[S.config.app].edit),g=e.ref({id:{},name:{},created_at:{},updated_at:{},tags:{tooltip:c("consumer_groups.form.fields.tags.tooltip")}});return(i,s)=>(e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(e.unref(f.EntityBaseConfigCard),{config:o.config,"config-card-doc":o.configCardDoc,"config-schema":g.value,"data-key":"consumer_group","enable-terraform":o.enableTerraform,"entity-type":e.unref(f.SupportedEntityType).ConsumerGroup,"fetch-url":r.value,"hide-title":o.hideTitle,"onFetch:error":s[0]||(s[0]=w=>i.$emit("fetch:error",w)),"onFetch:success":s[1]||(s[1]=w=>i.$emit("fetch:success",w)),onLoading:s[2]||(s[2]=w=>i.$emit("loading",w))},null,8,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])]))}});B.ConsumerGroupConfigCard=Pe,B.ConsumerGroupForm=De,B.ConsumerGroupList=Ne,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(B,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/entities-shared"],e):(B=typeof globalThis<"u"?globalThis:B||self,e(B["kong-ui-public-entities-consumer-groups"]={},B.Vue,B.VueRouter,B.KongIcons,B["kong-ui-public-i18n"],B["kong-ui-public-entities-shared"]))})(this,function(B,e,me,he,pe,f){"use strict";const Ce={consumer_groups:{list:{table_headers:{name:"Name",consumers_count:"Consumers",tags:"Tags",id:"ID"},empty_state:{title:"Configure a New Consumer Group",description:"Use consumer groups to manage custom rate limiting configuration for subsets of consumers.",title_for_consumer:"Add to a Consumer Group"},toolbar_actions:{new_consumer_group:"New Consumer Group"}},title:"Consumer Groups",search:{placeholder:"Filter by exact name or ID"},actions:{add_to_group:"Add to Consumer Group",create:"New Consumer Group",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",exit:"Exit",view:"View Details"},delete:{title:"Delete a Consumer Group",description:"Deleting this group will remove this group from all plugins and its rate limit configuration. This action cannot be reversed."},consumers:{add:{title:"Add To Consumer Groups",ctaText:"Add this consumer to consumer groups",consumer_groups_label:"Consumer Groups",consumer_group_placeholder:"Add to consumer groups",footer:"Search by exact name or ID to find consumer groups not included in the list"},exit:{title:"Exit from a Consumer Group",confirmation:"Are you sure you want to remove consumer {consumer} from consumer group {consumerGroup}?",confirmationNoUsername:"Are you sure you want this consumer to exit from consumer group {consumerGroup}?",description:"Exiting from the group could change the rate limit policy applied to this consumer."}},errors:{general:"Consumer Groups could not be retrieved",delete:"The consumer group could not be deleted at this time.",copy:"Failed to copy to clipboard",add:"The consumer could not be added to some groups at this time.",already_added:"The consumer is already in this consumer group",add_consumer:"An unexpected error occurred while adding consumers. Please try again.",remove_consumer:"An unexpected error occurred while removing consumers. Please try again."},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{general_info:{title:"General Information",description:"General information will help identify and manage this consumer group."},consumers:{title:"Consumers",description:"Add or remove consumers from this group"},fields:{name:{label:"Name",placeholder:"Enter a unique name for this consumer group "},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."},consumers:{label:"Consumers",placeholder:"Select one or more consumers"}}}}};function _e(){const o=pe.createI18n("en-us",Ce);return{i18n:o,i18nT:pe.i18nTComponent(o)}}const ce={useI18n:_e},T="/v2/control-planes/{controlPlaneId}/core-entities",G="/{workspace}",q={list:{konnect:{all:`${T}/consumer_groups`,forModal:`${T}/consumer_groups`,forConsumer:`${T}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${T}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`},kongManager:{all:`${G}/consumer_groups?counter=true`,forModal:`${G}/consumer_groups`,forConsumer:`${G}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${G}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`}},form:{konnect:{consumersList:`${T}/consumers`,create:`${T}/consumer_groups`,edit:`${T}/consumer_groups/{id}`,addConsumer:`${T}/consumer_groups/{id}/consumers`,removeConsumer:`${T}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${T}/consumer_groups/{id}/consumers`},kongManager:{consumersList:`${G}/consumers`,create:`${G}/consumer_groups`,edit:`${G}/consumer_groups/{id}`,addConsumer:`${G}/consumer_groups/{id}/consumers`,removeConsumer:`${G}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${G}/consumer_groups/{id}/consumers`}}},be={class:"add-to-group-form-container"},ke={class:"add-to-group-cta-text"},we={key:0,class:"kong-ui-entity-add-to-groups-error"},xe={key:0},Ie=e.defineComponent({__name:"AddToGroupModal",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||!o.consumerId)},visible:{type:Boolean,required:!0,default:!1}},emits:["cancel","add:success","add:partial-success","error"],setup(o,{emit:S}){var R;const{i18n:{t:c}}=ce.useI18n(),r=o,g=S,{axiosInstance:i}=f.useAxios((R=r.config)==null?void 0:R.axiosRequestConfig),s=e.ref([]),{debouncedQueryChange:w,loading:U,allRecords:I,error:Y,loadItems:Z,results:D}=f.useDebouncedFilter(r.config,q.list[r.config.app].forModal,"",{fetchedItemsKey:"data",searchKeys:["name","id"]}),$=e.computed(()=>Y.value?c("consumer_groups.errors.general"):""),v=e.ref(0),L=e.computed(()=>I.value===void 0),A=e.computed(()=>D.value.map(p=>({label:p.name,value:p.id,selected:s.value.includes(p.id),data:p}))),J=p=>{var d;const h=L.value?D.value.find(C=>C.id===p):(d=I.value)==null?void 0:d.find(C=>C.id===p);return h?h.name:p},ee=()=>{x.value="",P.value=[],N.value=[],g("cancel")},P=e.ref([]),O=e.ref(!1),x=e.ref(""),oe=async()=>{if(!s.value.length){x.value="",N.value=[],g("cancel");return}O.value=!0,x.value="",P.value=[],N.value=[];try{const p=s.value.map(C=>te(C)),h=await Promise.allSettled(p);let d=!0;h.forEach(C=>{C.status!=="fulfilled"&&(d=!1)}),d?(P.value=[],N.value=[],g("add:success",s.value),s.value=[]):(P.value.length&&g("add:partial-success",P.value),s.value=[],W(h))}catch{x.value=c("consumer_groups.errors.add"),g("error",x.value)}finally{O.value=!1}},j=e.computed(()=>{var h,d,C,M;let p=`${r.config.apiBaseUrl}${q.list[r.config.app].forConsumer}`;return r.config.app==="konnect"?p=p.replace(/{controlPlaneId}/gi,((h=r.config)==null?void 0:h.controlPlaneId)||"").replace(/{consumerId}/gi,((d=r.config)==null?void 0:d.consumerId)||""):r.config.app==="kongManager"&&(p=p.replace(/\/{workspace}/gi,(C=r.config)!=null&&C.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((M=r.config)==null?void 0:M.consumerId)||"")),p}),te=async p=>{const h={group:p};try{const d=await i.post(j.value,h);return P.value.push(p),d}catch(d){let C=`${J(p)} - ${d.message}`;return d.response.status===409&&(C=`${J(p)} - ${c("consumer_groups.errors.already_added")}`),Promise.reject(Error(C))}},N=e.ref([]),W=p=>{N.value=p.map(h=>{var d;return(d=h.reason)==null?void 0:d.message}).filter(Boolean)};return e.watch(A,()=>{v.value++},{immediate:!0,deep:!0}),e.watch(()=>r.visible,()=>{r.visible&&Z()},{immediate:!0}),(p,h)=>{const d=e.resolveComponent("KMultiselect"),C=e.resolveComponent("KAlert"),M=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(M,{"action-button-disabled":O.value,class:"kong-ui-entities-add-to-groups-modal","data-testid":"add-to-group-modal",title:e.unref(c)("consumer_groups.consumers.add.title"),visible:o.visible,onCancel:ee,onProceed:oe},{default:e.withCtx(()=>[e.createElementVNode("div",be,[e.createElementVNode("p",ke,e.toDisplayString(e.unref(c)("consumer_groups.consumers.add.ctaText")),1),e.createVNode(d,{modelValue:s.value,"onUpdate:modelValue":h[0]||(h[0]=Q=>s.value=Q),autosuggest:"","data-testid":"add-to-groups-multiselect","dropdown-footer-text":L.value?e.unref(c)("consumer_groups.consumers.add.footer"):void 0,items:A.value,label:e.unref(c)("consumer_groups.consumers.add.consumer_groups_label"),loading:e.unref(U),placeholder:e.unref(c)("consumer_groups.consumers.add.consumer_group_placeholder"),readonly:O.value,required:"",width:"100%",onQueryChange:e.unref(w)},null,8,["modelValue","dropdown-footer-text","items","label","loading","placeholder","readonly","onQueryChange"]),x.value||$.value||N.value.length?(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(C,{appearance:"danger"},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(e.unref(c)("consumer_groups.errors.add")),1),N.value.length?(e.openBlock(),e.createElementBlock("ul",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(Q,re)=>(e.openBlock(),e.createElementBlock("li",{key:re},e.toDisplayString(Q),1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(x.value||$.value),1)]),_:1})])):e.createCommentVNode("",!0)])]),_:1},8,["action-button-disabled","title","visible"])}}}),ie=(o,S)=>{const c=o.__vccOpts||o;for(const[r,g]of S)c[r]=g;return c},Ee=ie(Ie,[["__scopeId","data-v-4260ce03"]]),Ve={class:"kong-ui-entities-consumer-groups-list"},Be={key:1},Ne=ie(e.defineComponent({__name:"ConsumerGroupList",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||!o.createRoute||!o.getViewRoute||!o.getEditRoute||o.app==="kongManager"&&!o.isExactMatch&&!o.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","add:success","remove:success"],setup(o,{emit:S}){var ge;const c=S,r=o,{i18nT:g,i18n:{t:i}}=ce.useI18n(),s=me.useRouter(),{axiosInstance:w}=f.useAxios((ge=r.config)==null?void 0:ge.axiosRequestConfig),U=e.ref(1),I=e.computed(()=>!!r.config.consumerId),Y=e.computed(()=>I.value?"kong-ui-entities-consumer-groups-list-in-consumer-page":"kong-ui-entities-consumer-groups-list"),Z=e.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),D={name:{label:i("consumer_groups.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1}};r.config.app==="kongManager"&&(D.consumers_count={label:i("consumer_groups.list.table_headers.consumers_count"),searchable:!1,sortable:!1}),D.tags={label:i("consumer_groups.list.table_headers.tags"),sortable:!1};const $=D,v=n=>({"data-testid":n.username??n.custom_id??n.id}),L=e.computed(()=>{var m,_,V,K;let n=`${r.config.apiBaseUrl}${q.list[r.config.app][I.value?"forConsumer":"all"]}`;return r.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||"").replace(/{consumerId}/gi,((_=r.config)==null?void 0:_.consumerId)||""):r.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(V=r.config)!=null&&V.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((K=r.config)==null?void 0:K.consumerId)||"")),n}),A=e.ref(""),J=e.computed(()=>{const n=r.config.app==="konnect"||r.config.isExactMatch;return n?{isExactMatch:n,fields:{username:D.name,id:{label:i("consumer_groups.list.table_headers.id")}},placeholder:i("consumer_groups.search.placeholder")}:{isExactMatch:n,fields:{name:D.name},schema:r.config.filterSchema}}),ee=e.computed(()=>r.config.app==="konnect"&&A.value?"consumer_group":I.value&&!r.config.paginatedEndpoint?"consumer_groups":void 0),{fetcher:P,fetcherState:O}=f.useFetcher(r.config,L.value,ee),x=()=>{A.value=""},oe=()=>{U.value++},j=e.ref(null),te=(n,m)=>{const _=n.id;if(!m(_)){c("copy:error",{entity:n,field:"id",message:i("consumer_groups.errors.copy")});return}c("copy:success",{entity:n,field:"id",message:i("consumer_groups.copy.success",{val:_})})},N=(n,m)=>{const _=JSON.stringify(n);if(!m(_)){c("copy:error",{entity:n,message:i("consumer_groups.errors.copy")});return}c("copy:success",{entity:n,message:i("consumer_groups.copy.success_brief")})},W=async n=>{var _;await((_=r.canRetrieve)==null?void 0:_.call(r,n))&&s.push(r.config.getViewRoute(n.id))},R=n=>({label:i("consumer_groups.actions.view"),to:r.config.getViewRoute(n)}),p=n=>({label:i("consumer_groups.actions.edit"),to:r.config.getEditRoute(n)}),h=e.ref(void 0),d=e.ref(!1),C=e.ref(!1),M=e.ref(""),Q=f.useDeleteUrlBuilder(r.config,L.value),re=n=>{h.value=n,d.value=!0},ue=()=>{d.value=!1},le=async()=>{var n,m,_;if((n=h.value)!=null&&n.id){C.value=!0;try{await w.delete(Q(h.value.id)),C.value=!1,d.value=!1,U.value++,c("delete:success",h.value)}catch(V){M.value=((_=(m=V.response)==null?void 0:m.data)==null?void 0:_.message)||V.message||i("consumer_groups.errors.delete"),c("error",V)}finally{C.value=!1}}},H=e.ref(!1),ne=()=>{H.value=!0},t=()=>{H.value=!1},a=(n,m)=>{m||t(),U.value++,c("add:success",n)},b=()=>{I.value&&ne()},l=e.ref(void 0),u=e.ref(!1),E=e.ref(""),F=n=>{l.value=n,u.value=!0},k=()=>{u.value=!1,l.value=void 0},z=e.computed(()=>{var m,_,V,K;let n=`${r.config.apiBaseUrl}${q.list[r.config.app].oneForConsumer}`;return r.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||"").replace(/{consumerId}/gi,((_=r.config)==null?void 0:_.consumerId)||""):r.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(V=r.config)!=null&&V.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((K=r.config)==null?void 0:K.consumerId)||"")),n}),se=e.ref(!1),Fe=async()=>{if(l.value){se.value=!0;try{const n=z.value.replace(/{consumerGroupId}/gi,l.value.id);await w.delete(n),c("remove:success",l.value),k(),U.value++}catch(n){E.value=n.message||i("consumer_groups.errors.delete"),c("error",n)}finally{se.value=!1}}},fe=e.ref(!1);e.watch(O,n=>{var m,_,V,K;if(Array.isArray((m=n==null?void 0:n.response)==null?void 0:m.data)&&(fe.value=n.response.data.length>0),n.status===f.FetcherStatus.Error){j.value={title:i("consumer_groups.errors.general")},(K=(V=(_=n.error)==null?void 0:_.response)==null?void 0:V.data)!=null&&K.message&&(j.value.message=n.error.response.data.message),c("error",n.error);return}j.value=null});const de=e.ref({ctaPath:I.value?void 0:r.config.createRoute,ctaText:void 0,message:`${i("consumer_groups.list.empty_state.description")}${r.config.additionMessageForEmptyState?` ${r.config.additionMessageForEmptyState}`:""}`,title:i("consumer_groups.title")});return e.onBeforeMount(async()=>{await r.canCreate()&&(de.value.title=I.value?i("consumer_groups.list.empty_state.title_for_consumer"):i("consumer_groups.list.empty_state.title"),de.value.ctaText=I.value?i("consumer_groups.actions.add_to_group"):i("consumer_groups.actions.create"))}),(n,m)=>{const _=e.resolveComponent("KButton"),V=e.resolveComponent("KBadge"),K=e.resolveComponent("KTruncate"),ae=e.resolveComponent("KDropdownItem"),ye=e.resolveComponent("KClipboardProvider"),Ke=e.resolveComponent("KPrompt");return e.openBlock(),e.createElementBlock("div",Ve,[e.createVNode(e.unref(f.EntityBaseTable),{"cache-identifier":o.cacheIdentifier,"disable-pagination":I.value&&!o.config.paginatedEndpoint,"disable-pagination-page-jump":"","disable-sorting":Z.value,"empty-state-options":de.value,"enable-entity-actions":"","error-message":j.value,fetcher:e.unref(P),"fetcher-cache-key":U.value,"pagination-type":"offset","preferences-storage-key":Y.value,query:A.value,"row-attributes":v,"table-headers":e.unref($),onClearSearchInput:x,"onClick:row":m[3]||(m[3]=y=>W(y)),onEmptyStateCtaClicked:b,onSort:oe},{"toolbar-filter":e.withCtx(()=>[I.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(f.EntityFilter),{key:0,modelValue:A.value,"onUpdate:modelValue":m[0]||(m[0]=y=>A.value=y),config:J.value},null,8,["modelValue","config"]))]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!o.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>o.canCreate()},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(_,{appearance:"primary","data-testid":"toolbar-add-consumer-group",size:o.useActionOutside?"medium":"large",to:o.config.consumerId?void 0:o.config.createRoute,onClick:m[1]||(m[1]=()=>o.config.consumerId?ne():void 0)},{default:e.withCtx(()=>[e.createVNode(e.unref(he.AddIcon)),e.createTextVNode(" "+e.toDisplayString(o.config.consumerId?e.unref(i)("consumer_groups.actions.add_to_group"):e.unref(i)("consumer_groups.list.toolbar_actions.new_consumer_group")),1)]),_:1},8,["size","to"]),[[e.vShow,fe.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:e.withCtx(({rowValue:y})=>[e.createElementVNode("b",null,e.toDisplayString(y??"-"),1)]),consumers_count:e.withCtx(({rowValue:y})=>[e.createTextVNode(e.toDisplayString(y??"-"),1)]),tags:e.withCtx(({rowValue:y})=>[(y==null?void 0:y.length)>0?(e.openBlock(),e.createBlock(K,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y,X=>(e.openBlock(),e.createBlock(V,{key:X,onClick:m[2]||(m[2]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(X),1)]),_:2},1024))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",Be,"-"))]),actions:e.withCtx(({row:y})=>[e.createVNode(ye,null,{default:e.withCtx(({copyToClipboard:X})=>[e.createVNode(ae,{"data-testid":"action-entity-copy-id",onClick:Se=>te(y,X)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("consumer_groups.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(ye,null,{default:e.withCtx(({copyToClipboard:X})=>[e.createVNode(ae,{"data-testid":"action-entity-copy-json",onClick:Se=>N(y,X)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("consumer_groups.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>o.canRetrieve(y)},{default:e.withCtx(()=>[e.createVNode(ae,{"data-testid":"action-entity-view","has-divider":"",item:R(y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>o.canEdit(y)},{default:e.withCtx(()=>[e.createVNode(ae,{"data-testid":"action-entity-edit",item:p(y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>o.canDelete(y)},{default:e.withCtx(()=>[e.createVNode(ae,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:()=>o.config.consumerId?F(y):re(y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.config.consumerId?e.unref(i)("consumer_groups.actions.exit"):e.unref(i)("consumer_groups.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-pagination","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","preferences-storage-key","query","table-headers"]),e.createVNode(e.unref(f.EntityDeleteModal),{"action-pending":C.value,"data-testid":"delete-consumer-group-modal",description:e.unref(i)("consumer_groups.delete.description"),"entity-name":h.value&&(h.value.name||h.value.id),"entity-type":e.unref(f.EntityTypes).ConsumerGroup,error:M.value,title:e.unref(i)("consumer_groups.delete.title"),visible:d.value,onCancel:ue,onProceed:le},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"]),o.config.consumerId?(e.openBlock(),e.createBlock(Ee,{key:0,config:o.config,"data-testid":"add-to-group-modal",visible:H.value,"onAdd:partialSuccess":m[4]||(m[4]=y=>a(y,!0)),"onAdd:success":m[5]||(m[5]=y=>a(y)),onCancel:t},null,8,["config","visible"])):e.createCommentVNode("",!0),o.config.consumerId&&l.value?(e.openBlock(),e.createBlock(Ke,{key:1,"action-button-appearance":"danger","data-testid":"exit-group-modal",title:e.unref(i)("consumer_groups.consumers.exit.title"),visible:u.value,onCancel:k,onProceed:Fe},{default:e.withCtx(()=>[e.createVNode(e.unref(g),{class:"exit-modal-message",keypath:o.config.consumerUsername?"consumer_groups.consumers.exit.confirmation":"consumer_groups.consumers.exit.confirmationNoUsername",tag:"p"},e.createSlots({consumerGroup:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(l.value.name||l.value.id),1)]),_:2},[o.config.consumerUsername?{name:"consumer",fn:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(o.config.consumerUsername),1)]),key:"0"}:void 0]),1032,["keypath"]),e.createElementVNode("p",null,e.toDisplayString(e.unref(i)("consumer_groups.consumers.exit.description")),1)]),_:1},8,["title","visible"])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-8e388f7f"]]),$e={class:"kong-ui-entities-consumer-group-form"},Me={class:"select-item-container"},Te={class:"select-item-label"},Ge={key:0,class:"select-item-description"},De=ie(e.defineComponent({__name:"ConsumerGroupForm",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||(o==null?void 0:o.app)==="konnect"&&!(o!=null&&o.controlPlaneId)||(o==null?void 0:o.app)==="kongManager"&&typeof(o==null?void 0:o.workspace)!="string"||!(o!=null&&o.cancelRoute))},consumerGroupId:{type:String,required:!1,default:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(o,{emit:S}){var le,H,ne;const c=o,r=S,{i18n:{t:g}}=ce.useI18n(),i=me.useRouter(),s=e.reactive({fields:{name:"",tags:"",consumers:[]},errorMessage:"",readonly:!1}),w=e.reactive({name:"",tags:"",consumers:[]}),{debouncedQueryChange:U,loading:I,error:Y,loadItems:Z,results:D}=f.useDebouncedFilter(c.config,(H=q.form[(le=c.config)==null?void 0:le.app])==null?void 0:H.consumersList,"",{fetchedItemsKey:"data",searchKeys:["username","custom_id","id"]}),{axiosInstance:$}=f.useAxios((ne=c.config)==null?void 0:ne.axiosRequestConfig),{getMessageFromError:v}=f.useErrors(),L=f.useValidators(),A=e.computed(()=>D.value.map(t=>({label:t.username||t.custom_id,value:t.id,selected:s.fields.consumers.includes(t.id),data:t}))),J=e.computed(()=>{var t,a;return(a=q.form[(t=c.config)==null?void 0:t.app])==null?void 0:a.edit}),ee=e.computed(()=>c.consumerGroupId?f.EntityBaseFormType.Edit:f.EntityBaseFormType.Create),P=e.computed(()=>!!s.fields.name&&!W.value),O=e.computed(()=>JSON.stringify(s.fields)!==JSON.stringify(w)),x=(t,a="",b="")=>{var u,E,F,k,z,se;let l=`${(u=c.config)==null?void 0:u.apiBaseUrl}${q.form[(E=c.config)==null?void 0:E.app][t]}`;return((F=c.config)==null?void 0:F.app)==="konnect"?l=l.replace(/{controlPlaneId}/gi,((k=c.config)==null?void 0:k.controlPlaneId)||""):((z=c.config)==null?void 0:z.app)==="kongManager"&&(l=l.replace(/\/{workspace}/gi,(se=c.config)!=null&&se.workspace?`/${c.config.workspace}`:"")),l=l.replace(/{id}/gi,a||c.consumerGroupId),(t==="addConsumer"||t==="removeConsumer")&&(l=l.replace(/{consumerId}/gi,b)),l},oe=()=>{var t;i.push(((t=c.config)==null?void 0:t.cancelRoute)||{name:"consumer-group-list"})},j=t=>{r("error",t)},te=t=>{r("loading",t)},N=async t=>{var b,l,u,E,F;s.fields.name=((b=t==null?void 0:t.item)==null?void 0:b.name)||((l=t==null?void 0:t.consumer_group)==null?void 0:l.name)||(t==null?void 0:t.name)||"";const a=((u=t==null?void 0:t.item)==null?void 0:u.tags)||(t==null?void 0:t.consumer_group.tags)||(t==null?void 0:t.tags)||[];if(s.fields.tags=(a==null?void 0:a.join(", "))||"","consumers"in t)s.fields.consumers=((E=t==null?void 0:t.consumers)==null?void 0:E.map(k=>k.id))||[];else try{const{data:k}=await $.get(x("getConsumers"));s.fields.consumers="consumers"in k?(F=k==null?void 0:k.consumers)==null?void 0:F.map(z=>z.id):[]}catch(k){d(k)}Object.assign(w,s.fields)},W=e.computed(()=>L.utf8Name(s.fields.name)),R=e.computed(()=>{var t,a;return{name:s.fields.name,tags:(a=(t=s.fields.tags.split(","))==null?void 0:t.map(b=>String(b||"").trim()))==null?void 0:a.filter(b=>b!=="")}}),p=async(t,a="")=>await $.post(x("addConsumer",a,t),{consumer:t}),h=async(t,a="")=>await $.delete(x("removeConsumer",a,t)),d=t=>{s.errorMessage=v(t),r("error",t)},C=(t=c.consumerGroupId)=>{Object.assign(w,s.fields),r("update",{...s.fields,id:t})},M=(t,a,b=c.consumerGroupId)=>{const l=t==null?void 0:t.find(u=>u.status!=="fulfilled");l?d({code:l.status,message:a}):C(b)},Q=async()=>{let t="";try{const{data:a}=await $.post(x("create"),R.value);t="item"in a?a.item.id:a.id}catch(a){d(a)}if(s.fields.consumers.length>0&&t)try{const a=s.fields.consumers.map(l=>p(l,t)),b=await Promise.allSettled(a);M(b,g("consumer_groups.errors.add_consumer"),t)}catch(a){d(a)}else s.fields.consumers.length===0&&t&&C(t)},re=async()=>{var b;try{((b=c.config)==null?void 0:b.app)==="konnect"?await $.put(x("edit"),R.value):await $.patch(x("edit"),R.value)}catch(l){d(l)}const t=s.fields.consumers.filter(l=>!w.consumers.includes(l)),a=w.consumers.filter(l=>!s.fields.consumers.includes(l));if(a.length===0&&t.length===0)C();else{if(a.length>0)try{const l=a.map(E=>h(E)),u=await Promise.allSettled(l);M(u,g("consumer_groups.errors.remove_consumer"))}catch(l){d(l)}if(t.length>0)try{const l=t.map(E=>p(E)),u=await Promise.allSettled(l);M(u,g("consumer_groups.errors.add_consumer"))}catch(l){d(l)}}},ue=async()=>{try{s.readonly=!0,ee.value===f.EntityBaseFormType.Create?await Q():await re()}finally{s.readonly=!1}};return e.onBeforeMount(async()=>{await Z()}),(t,a)=>{const b=e.resolveComponent("KInput"),l=e.resolveComponent("KMultiselect");return e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(e.unref(f.EntityBaseForm),{"can-submit":P.value&&O.value,config:o.config,"edit-id":o.consumerGroupId,"enable-terraform":o.enableTerraform,"entity-type":e.unref(f.SupportedEntityType).ConsumerGroup,"error-message":s.errorMessage||e.unref(Y)||W.value,"fetch-url":J.value,"form-fields":R.value,"is-readonly":s.readonly,onCancel:oe,"onFetch:error":a[3]||(a[3]=u=>j(u)),"onFetch:success":N,onLoading:a[4]||(a[4]=u=>te(u)),onSubmit:ue},{default:e.withCtx(()=>[e.createVNode(e.unref(f.EntityFormSection),{description:e.unref(g)("consumer_groups.form.general_info.description"),title:e.unref(g)("consumer_groups.form.general_info.title")},{default:e.withCtx(()=>[e.createVNode(b,{modelValue:s.fields.name,"onUpdate:modelValue":a[0]||(a[0]=u=>s.fields.name=u),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-group-form-name",label:e.unref(g)("consumer_groups.form.fields.name.label"),placeholder:e.unref(g)("consumer_groups.form.fields.name.placeholder"),required:"",type:"text"},null,8,["modelValue","label","placeholder"]),e.createVNode(b,{modelValue:s.fields.tags,"onUpdate:modelValue":a[1]||(a[1]=u=>s.fields.tags=u),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-group-form-tags",help:e.unref(g)("consumer_groups.form.fields.tags.help"),label:e.unref(g)("consumer_groups.form.fields.tags.label"),"label-attributes":{info:e.unref(g)("consumer_groups.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(g)("consumer_groups.form.fields.tags.placeholder"),type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder"])]),_:1},8,["description","title"]),e.createVNode(e.unref(f.EntityFormSection),{description:e.unref(g)("consumer_groups.form.consumers.description"),"has-divider":"",title:e.unref(g)("consumer_groups.form.consumers.title")},{default:e.withCtx(()=>[e.createVNode(l,{modelValue:s.fields.consumers,"onUpdate:modelValue":a[2]||(a[2]=u=>s.fields.consumers=u),appearance:"select",autosuggest:"",items:A.value,label:e.unref(g)("consumer_groups.form.fields.consumers.label"),loading:e.unref(I),placeholder:e.unref(g)("consumer_groups.form.fields.consumers.placeholder"),width:"auto",onQueryChange:e.unref(U)},{"item-template":e.withCtx(({item:u})=>{var E,F,k;return[e.createElementVNode("div",Me,[e.createElementVNode("div",Te,e.toDisplayString(u.label),1),(E=u==null?void 0:u.data)!=null&&E.username&&((F=u==null?void 0:u.data)!=null&&F.custom_id)?(e.openBlock(),e.createElementBlock("div",Ge,e.toDisplayString((k=u==null?void 0:u.data)==null?void 0:k.custom_id),1)):e.createCommentVNode("",!0)])]}),_:1},8,["modelValue","items","label","loading","placeholder","onQueryChange"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-6b48d0fc"]]),Ae={class:"kong-ui-consumer-group-entity-config-card"},Pe=e.defineComponent({__name:"ConsumerGroupConfigCard",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||o.app==="konnect"&&!o.controlPlaneId||o.app==="kongManager"&&typeof o.workspace!="string"||!o.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(o){const S=o,{i18n:{t:c}}=ce.useI18n(),r=e.computed(()=>q.form[S.config.app].edit),g=e.ref({id:{},name:{},created_at:{},updated_at:{},tags:{tooltip:c("consumer_groups.form.fields.tags.tooltip")}});return(i,s)=>(e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(e.unref(f.EntityBaseConfigCard),{config:o.config,"config-card-doc":o.configCardDoc,"config-schema":g.value,"data-key":"consumer_group","enable-terraform":o.enableTerraform,"entity-type":e.unref(f.SupportedEntityType).ConsumerGroup,"fetch-url":r.value,"hide-title":o.hideTitle,"onFetch:error":s[0]||(s[0]=w=>i.$emit("fetch:error",w)),"onFetch:success":s[1]||(s[1]=w=>i.$emit("fetch:success",w)),onLoading:s[2]||(s[2]=w=>i.$emit("loading",w))},null,8,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])]))}});B.ConsumerGroupConfigCard=Pe,B.ConsumerGroupForm=De,B.ConsumerGroupList=Ne,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.config-card-fieldset[data-v-68ca83ec]{border:solid 1px #e0e4ea;border-radius:4px;margin-bottom:8px;margin-top:4px}.config-card-fieldset-title[data-v-68ca83ec]{font-size:14px;padding:0 8px;width:auto}fieldset.config-card-fieldset .config-card-details-row{width:unset}.config-card-json-item .config-card-details-row,fieldset.config-card-fieldset .config-card-details-row{margin:0 16px}.config-card-json-item .config-card-details-row:last-of-type,fieldset.config-card-fieldset .config-card-details-row:last-of-type{border-bottom:none}[data-v-c96811e5] .k-button.navigation-button{font-size:14px;font-weight:400}.config-card-details-row[data-v-711ebcf2]{align-items:center;border-bottom:var(--2f5b0492);display:var(--5d59c22c);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-711ebcf2]{width:var(--aa41a894)}.config-card-details-row .config-card-details-label label[data-v-711ebcf2]{color:#3a3f51}.config-card-details-row .config-card-details-value[data-v-711ebcf2]{width:var(--aa3d1cde)}.config-card-details-row .config-card-details-value .truncated[data-v-711ebcf2]{display:inline-block;line-height:initial;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-value span.attrs-data-text[data-v-711ebcf2]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-711ebcf2] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-711ebcf2]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-711ebcf2]{margin-right:4px}.config-card-details-row[data-v-711ebcf2] .k-label{margin-bottom:0}.config-card-details-row[data-v-711ebcf2] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-711ebcf2] .config-card-details-row{width:auto}.json-content.k-code-block{border-top-left-radius:0;border-top-right-radius:0}.json-endpoint{align-items:baseline;background-color:#000933;border-bottom:1px solid rgba(255,255,255,.2);border-top-left-radius:8px;border-top-right-radius:8px;display:flex;padding:8px 0 8px 12px}.json-endpoint .k-code-block{flex:auto;z-index:2}.json-endpoint .k-code-block .code-block-content{padding-bottom:0;padding-top:0}.json-endpoint .k-code-block .code-block-secondary-actions{margin-top:0!important}.json-endpoint code{direction:rtl;max-width:var(--454fa8c4);overflow:hidden!important;text-align:left;text-overflow:ellipsis;white-space:nowrap}.config-card-prop-section-title[data-v-d15be7fe]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card .config-card-actions[data-v-85381f68]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-85381f68]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-85381f68]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-85381f68] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-85381f68]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-94d27e50]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form .form-actions[data-v-94d27e50]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.kong-ui-entity-base-form .form-actions[data-v-94d27e50] .k-button:last-of-type,.kong-ui-entity-base-form .form-actions[data-v-94d27e50] .k-button:nth-last-of-type(2){margin-left:16px}.kong-ui-entity-base-form[data-v-94d27e50] .k-slideout-title{color:#000933!important;font-size:24px!important;font-weight:700!important;line-height:32px!important;margin-bottom:16px!important}.kong-ui-entity-base-form[data-v-94d27e50] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-94d27e50] .tab-item>div.tab-link.has-panels{color:#6c7489!important;font-size:14px!important;font-weight:700!important;line-height:24px!important}.kong-ui-entity-base-form[data-v-94d27e50] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.content-wrapper[data-v-b252463e] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-71b4425a]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-71b4425a]{margin-left:auto}.kong-ui-entity-base-table .actions-container[data-v-71b4425a]{float:right}.kong-ui-entity-base-table .actions-container[data-v-71b4425a] .k-dropdown-item-trigger{margin-bottom:0;margin-top:0}.kong-ui-entity-base-table :deep(.k-table){table-layout:fixed}.kong-ui-entity-delete-modal .message[data-v-4361d622],.kong-ui-entity-delete-modal .description[data-v-4361d622]{line-height:24px;margin:0}.kong-ui-entity-delete-modal .message strong[data-v-4361d622]{font-weight:600}.kong-ui-entity-delete-modal .description[data-v-4361d622]{margin-top:32px}.kong-ui-entity-delete-error[data-v-4361d622]{margin-bottom:16px}.kong-ui-entity-filter-input[data-v-94990087]{width:100%}.kong-ui-entity-filter-clear[data-v-94990087]{cursor:pointer}.kong-ui-entity-filter[data-v-94990087]{display:flex;position:relative}.kong-ui-entity-filter[data-v-94990087] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-94990087] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-94990087]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-94990087]{background-color:#fff;border:1px solid #afb7c5;border-radius:4px;box-shadow:0 4px 20px #e0e4ea;left:0;margin-top:16px;padding:8px 0 12px;position:absolute;top:100%;width:300px;z-index:1060}.kong-ui-entity-filter-menu-item[data-v-94990087]{border-bottom:1px solid #e0e4ea;color:#6c7489;font-size:12px;font-weight:400;line-height:16px;list-style:none;margin:0 20px;padding:16px 0;position:relative;white-space:nowrap}.menu-item-title[data-v-94990087]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-94990087]{color:#232633}.menu-item-expand-icon[data-v-94990087]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-94990087]{transform:rotate(180deg)}.menu-item-indicator[data-v-94990087]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-94990087]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-94990087] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-94990087] .k-input{width:100%}.menu-item-body[data-v-94990087] .k-select-input .input{font-size:12px}.menu-item-body[data-v-94990087] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-94990087]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-94990087]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-94990087]{padding:12px 20px 0}fieldset[data-v-b1f74200]{margin:0;min-width:0;padding:0}.kong-ui-entity-form-section[data-v-b1f74200]{border:0}.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{column-gap:16px;display:flex;flex-direction:column;padding-bottom:64px;row-gap:12px;width:100%}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{flex-direction:row}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{flex:1}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{max-width:350px}.kong-ui-entity-form-section .form-section-wrapper .form-section-info.sticky[data-v-b1f74200]{height:fit-content;margin-bottom:16px;position:sticky;top:16px}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-title[data-v-b1f74200]{color:#000933;font-size:16px;font-weight:700;line-height:20px;margin-bottom:8px;margin-top:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description p[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200] p{color:#000933;font-size:14px;font-weight:400;line-height:20px;margin:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-footer[data-v-b1f74200]{margin-top:32px}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]{flex:1}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]>*:not(:first-child){margin-top:24px}.kong-ui-entity-form-section.has-divider .form-section-wrapper[data-v-b1f74200]{border-bottom:1px solid #e0e4ea}.kong-ui-public-entity-link[data-v-60e3ef7c]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-60e3ef7c]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c]{display:flex}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-60e3ef7c]{display:inline-block;font-weight:400;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kong-ui-public-entity-link .copy-uuid-tooltip[data-v-60e3ef7c]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-60e3ef7c]{margin-left:2px}.kong-ui-entities-add-to-groups-modal .add-to-group-cta-text[data-v-4260ce03]{margin-top:0}.kong-ui-entities-add-to-groups-modal .add-to-group-form-container[data-v-4260ce03]{margin-bottom:20px}.kong-ui-entities-add-to-groups-modal .add-to-group-form-container .kong-ui-entity-add-to-groups-error[data-v-4260ce03]{margin-top:16px}.kong-ui-entities-consumer-groups-list[data-v-b6301615]{width:100%}.kong-ui-entities-consumer-groups-list .kong-ui-entity-filter-input[data-v-b6301615]{margin-right:12px}.kong-ui-entities-consumer-groups-list .exit-modal-message[data-v-b6301615]{margin-top:0}.kong-ui-entities-consumer-group-form[data-v-6b48d0fc]{width:100%}@media screen and (min-width: 1280px){.kong-ui-entities-consumer-group-form[data-v-6b48d0fc] .form-section-wrapper{column-gap:64px}}.kong-ui-entities-consumer-group-form .select-item-container .select-item-label[data-v-6b48d0fc]{font-weight:600}.kong-ui-entities-consumer-group-form .select-item-container .select-item-description[data-v-6b48d0fc]{color:#6c7489;font-size:12px}
|
|
1
|
+
.config-card-fieldset[data-v-68ca83ec]{border:solid 1px #e0e4ea;border-radius:4px;margin-bottom:8px;margin-top:4px}.config-card-fieldset-title[data-v-68ca83ec]{font-size:14px;padding:0 8px;width:auto}fieldset.config-card-fieldset .config-card-details-row{width:unset}.config-card-json-item .config-card-details-row,fieldset.config-card-fieldset .config-card-details-row{margin:0 16px}.config-card-json-item .config-card-details-row:last-of-type,fieldset.config-card-fieldset .config-card-details-row:last-of-type{border-bottom:none}[data-v-c96811e5] .k-button.navigation-button{font-size:14px;font-weight:400}.config-card-details-row[data-v-711ebcf2]{align-items:center;border-bottom:var(--2f5b0492);display:var(--5d59c22c);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-711ebcf2]{width:var(--aa41a894)}.config-card-details-row .config-card-details-label label[data-v-711ebcf2]{color:#3a3f51}.config-card-details-row .config-card-details-value[data-v-711ebcf2]{width:var(--aa3d1cde)}.config-card-details-row .config-card-details-value .truncated[data-v-711ebcf2]{display:inline-block;line-height:initial;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-value span.attrs-data-text[data-v-711ebcf2]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-711ebcf2] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-711ebcf2]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-711ebcf2]{margin-right:4px}.config-card-details-row[data-v-711ebcf2] .k-label{margin-bottom:0}.config-card-details-row[data-v-711ebcf2] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-711ebcf2] .config-card-details-row{width:auto}.json-content.k-code-block{border-top-left-radius:0;border-top-right-radius:0}.json-endpoint{align-items:baseline;background-color:#000933;border-bottom:1px solid rgba(255,255,255,.2);border-top-left-radius:8px;border-top-right-radius:8px;display:flex;padding:8px 0 8px 12px}.json-endpoint .k-code-block{flex:auto;z-index:2}.json-endpoint .k-code-block .code-block-content{padding-bottom:0;padding-top:0}.json-endpoint .k-code-block .code-block-secondary-actions{margin-top:0!important}.json-endpoint code{direction:rtl;max-width:var(--454fa8c4);overflow:hidden!important;text-align:left;text-overflow:ellipsis;white-space:nowrap}.config-card-prop-section-title[data-v-d15be7fe]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card .config-card-actions[data-v-85381f68]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-85381f68]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-85381f68]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-85381f68] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-85381f68]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-94d27e50]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form .form-actions[data-v-94d27e50]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.kong-ui-entity-base-form .form-actions[data-v-94d27e50] .k-button:last-of-type,.kong-ui-entity-base-form .form-actions[data-v-94d27e50] .k-button:nth-last-of-type(2){margin-left:16px}.kong-ui-entity-base-form[data-v-94d27e50] .k-slideout-title{color:#000933!important;font-size:24px!important;font-weight:700!important;line-height:32px!important;margin-bottom:16px!important}.kong-ui-entity-base-form[data-v-94d27e50] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-94d27e50] .tab-item>div.tab-link.has-panels{color:#6c7489!important;font-size:14px!important;font-weight:700!important;line-height:24px!important}.kong-ui-entity-base-form[data-v-94d27e50] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.content-wrapper[data-v-b252463e] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-71b4425a]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-71b4425a]{margin-left:auto}.kong-ui-entity-base-table .actions-container[data-v-71b4425a]{float:right}.kong-ui-entity-base-table .actions-container[data-v-71b4425a] .k-dropdown-item-trigger{margin-bottom:0;margin-top:0}.kong-ui-entity-base-table :deep(.k-table){table-layout:fixed}.kong-ui-entity-delete-modal .message[data-v-4361d622],.kong-ui-entity-delete-modal .description[data-v-4361d622]{line-height:24px;margin:0}.kong-ui-entity-delete-modal .message strong[data-v-4361d622]{font-weight:600}.kong-ui-entity-delete-modal .description[data-v-4361d622]{margin-top:32px}.kong-ui-entity-delete-error[data-v-4361d622]{margin-bottom:16px}.kong-ui-entity-filter-input[data-v-94990087]{width:100%}.kong-ui-entity-filter-clear[data-v-94990087]{cursor:pointer}.kong-ui-entity-filter[data-v-94990087]{display:flex;position:relative}.kong-ui-entity-filter[data-v-94990087] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-94990087] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-94990087]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-94990087]{background-color:#fff;border:1px solid #afb7c5;border-radius:4px;box-shadow:0 4px 20px #e0e4ea;left:0;margin-top:16px;padding:8px 0 12px;position:absolute;top:100%;width:300px;z-index:1060}.kong-ui-entity-filter-menu-item[data-v-94990087]{border-bottom:1px solid #e0e4ea;color:#6c7489;font-size:12px;font-weight:400;line-height:16px;list-style:none;margin:0 20px;padding:16px 0;position:relative;white-space:nowrap}.menu-item-title[data-v-94990087]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-94990087]{color:#232633}.menu-item-expand-icon[data-v-94990087]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-94990087]{transform:rotate(180deg)}.menu-item-indicator[data-v-94990087]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-94990087]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-94990087] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-94990087] .k-input{width:100%}.menu-item-body[data-v-94990087] .k-select-input .input{font-size:12px}.menu-item-body[data-v-94990087] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-94990087]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-94990087]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-94990087]{padding:12px 20px 0}fieldset[data-v-b1f74200]{margin:0;min-width:0;padding:0}.kong-ui-entity-form-section[data-v-b1f74200]{border:0}.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{column-gap:16px;display:flex;flex-direction:column;padding-bottom:64px;row-gap:12px;width:100%}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{flex-direction:row}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{flex:1}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{max-width:350px}.kong-ui-entity-form-section .form-section-wrapper .form-section-info.sticky[data-v-b1f74200]{height:fit-content;margin-bottom:16px;position:sticky;top:16px}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-title[data-v-b1f74200]{color:#000933;font-size:16px;font-weight:700;line-height:20px;margin-bottom:8px;margin-top:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description p[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200] p{color:#000933;font-size:14px;font-weight:400;line-height:20px;margin:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-footer[data-v-b1f74200]{margin-top:32px}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]{flex:1}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]>*:not(:first-child){margin-top:24px}.kong-ui-entity-form-section.has-divider .form-section-wrapper[data-v-b1f74200]{border-bottom:1px solid #e0e4ea}.kong-ui-public-entity-link[data-v-60e3ef7c]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-60e3ef7c]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c]{display:flex}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-60e3ef7c]{display:inline-block;font-weight:400;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kong-ui-public-entity-link .copy-uuid-tooltip[data-v-60e3ef7c]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-60e3ef7c]{margin-left:2px}.kong-ui-entities-add-to-groups-modal .add-to-group-cta-text[data-v-4260ce03]{margin-top:0}.kong-ui-entities-add-to-groups-modal .add-to-group-form-container[data-v-4260ce03]{margin-bottom:20px}.kong-ui-entities-add-to-groups-modal .add-to-group-form-container .kong-ui-entity-add-to-groups-error[data-v-4260ce03]{margin-top:16px}.kong-ui-entities-consumer-groups-list[data-v-8e388f7f]{width:100%}.kong-ui-entities-consumer-groups-list .kong-ui-entity-filter-input[data-v-8e388f7f]{margin-right:12px}.kong-ui-entities-consumer-groups-list .exit-modal-message[data-v-8e388f7f]{margin-top:0}.kong-ui-entities-consumer-group-form[data-v-6b48d0fc]{width:100%}@media screen and (min-width: 1280px){.kong-ui-entities-consumer-group-form[data-v-6b48d0fc] .form-section-wrapper{column-gap:64px}}.kong-ui-entities-consumer-group-form .select-item-container .select-item-label[data-v-6b48d0fc]{font-weight:600}.kong-ui-entities-consumer-group-form .select-item-container .select-item-description[data-v-6b48d0fc]{color:#6c7489;font-size:12px}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-consumer-groups",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-consumer-groups.umd.js",
|
|
6
6
|
"module": "./dist/entities-consumer-groups.es.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"axios": "^1.6.8",
|
|
37
37
|
"vue": "^3.4.31",
|
|
38
38
|
"vue-router": "^4.4.0",
|
|
39
|
-
"@kong-ui-public/
|
|
40
|
-
"@kong-ui-public/
|
|
39
|
+
"@kong-ui-public/i18n": "^2.2.2",
|
|
40
|
+
"@kong-ui-public/entities-shared": "^3.8.2"
|
|
41
41
|
},
|
|
42
42
|
"repository": {
|
|
43
43
|
"type": "git",
|