@kong-ui-public/entities-consumer-groups 3.7.6 → 3.7.7
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,8 +2,8 @@ import { defineComponent as _e, ref as I, computed as b, watch as we, resolveCom
|
|
|
2
2
|
import { useRouter as Fe } from "vue-router";
|
|
3
3
|
import { BookIcon as Te, AddIcon as Qe, TeamIcon as He } from "@kong/icons";
|
|
4
4
|
import { createI18n as ze, i18nTComponent as Je } from "@kong-ui-public/i18n";
|
|
5
|
-
import { useAxios as Ee, useDebouncedFilter as Ke, useTableState as We, useFetcher as Xe, useDeleteUrlBuilder as Ze, FetcherStatus as Ye, EntityBaseTable as eo, EntityFilter as oo, PermissionsWrapper as he, TableTags as to, EntityEmptyState as so, EntityDeleteModal as ro, EntityTypes as no, useErrors as ao, useValidators as uo, EntityBaseFormType as Ie, EntityBaseForm as io, SupportedEntityType as Ue, EntityFormSection as Pe, EntityBaseConfigCard as
|
|
6
|
-
const
|
|
5
|
+
import { useAxios as Ee, useDebouncedFilter as Ke, useTableState as We, useFetcher as Xe, useDeleteUrlBuilder as Ze, FetcherStatus as Ye, EntityBaseTable as eo, EntityFilter as oo, PermissionsWrapper as he, TableTags as to, EntityEmptyState as so, EntityDeleteModal as ro, EntityTypes as no, useErrors as ao, useValidators as uo, EntityBaseFormType as Ie, EntityBaseForm as io, SupportedEntityType as Ue, EntityFormSection as Pe, EntityBaseConfigCard as lo } from "@kong-ui-public/entities-shared";
|
|
6
|
+
const co = "#00abd2", mo = "24px", po = {
|
|
7
7
|
list: {
|
|
8
8
|
table_headers: {
|
|
9
9
|
name: "Name",
|
|
@@ -168,9 +168,9 @@ const be = {
|
|
|
168
168
|
const { i18n: { t: u } } = be.useI18n(), t = e, y = L, { axiosInstance: i } = Ee((j = t.config) == null ? void 0 : j.axiosRequestConfig), n = I([]), {
|
|
169
169
|
debouncedQueryChange: E,
|
|
170
170
|
loading: ie,
|
|
171
|
-
allRecords:
|
|
172
|
-
error:
|
|
173
|
-
loadItems:
|
|
171
|
+
allRecords: D,
|
|
172
|
+
error: le,
|
|
173
|
+
loadItems: ce,
|
|
174
174
|
results: W
|
|
175
175
|
} = Ke(
|
|
176
176
|
t.config,
|
|
@@ -180,7 +180,7 @@ const be = {
|
|
|
180
180
|
fetchedItemsKey: "data",
|
|
181
181
|
searchKeys: ["name", "id"]
|
|
182
182
|
}
|
|
183
|
-
), V = b(() =>
|
|
183
|
+
), V = b(() => le.value ? u("consumer_groups.errors.general") : ""), K = I(0), te = b(() => D.value === void 0), X = b(() => W.value.map((d) => ({
|
|
184
184
|
label: d.name,
|
|
185
185
|
value: d.id,
|
|
186
186
|
selected: n.value.includes(d.id),
|
|
@@ -188,7 +188,7 @@ const be = {
|
|
|
188
188
|
// we need this to determine whether or not to show the description text
|
|
189
189
|
}))), se = (d) => {
|
|
190
190
|
var f;
|
|
191
|
-
const k = te.value ? W.value.find((_) => _.id === d) : (f =
|
|
191
|
+
const k = te.value ? W.value.find((_) => _.id === d) : (f = D.value) == null ? void 0 : f.find((_) => _.id === d);
|
|
192
192
|
return k ? k.name : d;
|
|
193
193
|
}, de = () => {
|
|
194
194
|
x.value = "", R.value = [], M.value = [], y("cancel");
|
|
@@ -231,9 +231,9 @@ const be = {
|
|
|
231
231
|
}).filter(Boolean);
|
|
232
232
|
};
|
|
233
233
|
return we(X, () => {
|
|
234
|
-
|
|
234
|
+
K.value++;
|
|
235
235
|
}, { immediate: !0, deep: !0 }), we(() => t.visible, () => {
|
|
236
|
-
t.visible &&
|
|
236
|
+
t.visible && ce();
|
|
237
237
|
}, { immediate: !0 }), (d, k) => {
|
|
238
238
|
const f = Q("KMultiselect"), _ = Q("KAlert"), O = Q("KPrompt");
|
|
239
239
|
return T(), ee(O, {
|
|
@@ -268,7 +268,7 @@ const be = {
|
|
|
268
268
|
default: p(() => [
|
|
269
269
|
F("p", null, G(s(u)("consumer_groups.errors.add")), 1),
|
|
270
270
|
M.value.length ? (T(), z("ul", _o, [
|
|
271
|
-
(T(!0), z(Le, null, je(M.value, (Z,
|
|
271
|
+
(T(!0), z(Le, null, je(M.value, (Z, U) => (T(), z("li", { key: U }, G(Z), 1))), 128))
|
|
272
272
|
])) : oe("", !0),
|
|
273
273
|
F("div", null, G(x.value || V.value), 1)
|
|
274
274
|
]),
|
|
@@ -341,43 +341,43 @@ const be = {
|
|
|
341
341
|
emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success", "add:success", "remove:success"],
|
|
342
342
|
setup(e, { emit: L }) {
|
|
343
343
|
var Se;
|
|
344
|
-
const u = L, t = e, { i18nT: y, i18n: { t: i } } = be.useI18n(), n = Fe(), { axiosInstance: E } = Ee((Se = t.config) == null ? void 0 : Se.axiosRequestConfig), ie = b(() => t.config.app !== "kongManager" || !!t.config.disableSorting),
|
|
344
|
+
const u = L, t = e, { i18nT: y, i18n: { t: i } } = be.useI18n(), n = Fe(), { axiosInstance: E } = Ee((Se = t.config) == null ? void 0 : Se.axiosRequestConfig), ie = b(() => t.config.app !== "kongManager" || !!t.config.disableSorting), D = {
|
|
345
345
|
// the Name column is non-hidable
|
|
346
346
|
name: { label: i("consumer_groups.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 }
|
|
347
347
|
};
|
|
348
|
-
t.config.app === "kongManager" && (
|
|
349
|
-
const
|
|
348
|
+
t.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 };
|
|
349
|
+
const le = D, ce = (r) => ({
|
|
350
350
|
"data-testid": r.username ?? r.custom_id ?? r.id
|
|
351
351
|
}), W = () => {
|
|
352
|
-
t.config.consumerId ?
|
|
352
|
+
t.config.consumerId ? c() : n.push(t.config.createRoute);
|
|
353
353
|
}, V = b(() => {
|
|
354
354
|
var m, h, w, H;
|
|
355
355
|
let r = `${t.config.apiBaseUrl}${J.list[t.config.app][$.value ? "forConsumer" : "all"]}`;
|
|
356
356
|
return t.config.app === "konnect" ? r = r.replace(/{controlPlaneId}/gi, ((m = t.config) == null ? void 0 : m.controlPlaneId) || "").replace(/{consumerId}/gi, ((h = t.config) == null ? void 0 : h.consumerId) || "") : t.config.app === "kongManager" && (r = r.replace(/\/{workspace}/gi, (w = t.config) != null && w.workspace ? `/${t.config.workspace}` : "").replace(/{consumerId}/gi, ((H = t.config) == null ? void 0 : H.consumerId) || "")), r;
|
|
357
|
-
}),
|
|
357
|
+
}), K = I(""), te = b(() => {
|
|
358
358
|
const r = t.config.app === "konnect" || t.config.isExactMatch;
|
|
359
359
|
return r ? {
|
|
360
360
|
isExactMatch: r,
|
|
361
361
|
fields: {
|
|
362
|
-
username:
|
|
362
|
+
username: D.name,
|
|
363
363
|
id: { label: i("consumer_groups.list.table_headers.id") }
|
|
364
364
|
},
|
|
365
365
|
placeholder: i("consumer_groups.search.placeholder")
|
|
366
366
|
} : {
|
|
367
367
|
isExactMatch: r,
|
|
368
368
|
fields: {
|
|
369
|
-
name:
|
|
369
|
+
name: D.name
|
|
370
370
|
},
|
|
371
371
|
schema: t.config.filterSchema
|
|
372
372
|
};
|
|
373
|
-
}), { hasRecords: X, handleStateChange: se } = We(
|
|
373
|
+
}), { hasRecords: X, handleStateChange: se } = We(K), de = b(() => X.value && t.config.app === "konnect"), R = b(() => !t.enableV2EmptyStates && t.config.app === "konnect"), $ = b(() => !!t.config.consumerId), x = b(
|
|
374
374
|
() => $.value ? "kong-ui-entities-consumer-groups-list-in-consumer-page" : "kong-ui-entities-consumer-groups-list"
|
|
375
|
-
), me = b(() => t.config.app === "konnect" &&
|
|
375
|
+
), me = b(() => t.config.app === "konnect" && K.value ? "consumer_group" : $.value && !t.config.paginatedEndpoint ? "consumer_groups" : void 0), {
|
|
376
376
|
fetcher: pe,
|
|
377
377
|
fetcherState: ge,
|
|
378
378
|
fetcherCacheKey: M
|
|
379
379
|
} = Xe({ ...t.config, cacheIdentifier: t.cacheIdentifier }, V.value, me), re = () => {
|
|
380
|
-
|
|
380
|
+
K.value = "";
|
|
381
381
|
}, j = () => {
|
|
382
382
|
M.value++;
|
|
383
383
|
}, d = I(null), k = (r, m) => {
|
|
@@ -417,30 +417,30 @@ const be = {
|
|
|
417
417
|
}), Z = (r) => ({
|
|
418
418
|
label: i("consumer_groups.actions.edit"),
|
|
419
419
|
to: t.config.getEditRoute(r)
|
|
420
|
-
}),
|
|
421
|
-
|
|
420
|
+
}), U = I(void 0), ne = I(!1), Y = I(!1), fe = I(""), ve = Ze(t.config, V.value), o = (r) => {
|
|
421
|
+
U.value = r, ne.value = !0;
|
|
422
422
|
}, a = () => {
|
|
423
423
|
ne.value = !1;
|
|
424
424
|
}, C = async () => {
|
|
425
425
|
var r, m, h;
|
|
426
|
-
if ((r =
|
|
426
|
+
if ((r = U.value) != null && r.id) {
|
|
427
427
|
Y.value = !0;
|
|
428
428
|
try {
|
|
429
|
-
await E.delete(ve(
|
|
429
|
+
await E.delete(ve(U.value.id)), Y.value = !1, ne.value = !1, M.value++, u("delete:success", U.value);
|
|
430
430
|
} catch (w) {
|
|
431
431
|
fe.value = ((h = (m = w.response) == null ? void 0 : m.data) == null ? void 0 : h.message) || w.message || i("consumer_groups.errors.delete"), u("error", w);
|
|
432
432
|
} finally {
|
|
433
433
|
Y.value = !1;
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
},
|
|
437
|
-
|
|
436
|
+
}, l = I(!1), c = () => {
|
|
437
|
+
l.value = !0;
|
|
438
438
|
}, A = () => {
|
|
439
|
-
|
|
440
|
-
},
|
|
439
|
+
l.value = !1;
|
|
440
|
+
}, B = (r, m) => {
|
|
441
441
|
m || A(), M.value++, u("add:success", r);
|
|
442
442
|
}, S = () => {
|
|
443
|
-
$.value &&
|
|
443
|
+
$.value && c();
|
|
444
444
|
}, P = I(void 0), ae = I(!1), Be = I(""), De = (r) => {
|
|
445
445
|
P.value = r, ae.value = !0;
|
|
446
446
|
}, xe = () => {
|
|
@@ -494,9 +494,9 @@ const be = {
|
|
|
494
494
|
"fetcher-cache-key": s(M),
|
|
495
495
|
"pagination-type": "offset",
|
|
496
496
|
"preferences-storage-key": x.value,
|
|
497
|
-
query:
|
|
498
|
-
"row-attributes":
|
|
499
|
-
"table-headers": s(
|
|
497
|
+
query: K.value,
|
|
498
|
+
"row-attributes": ce,
|
|
499
|
+
"table-headers": s(le),
|
|
500
500
|
onClearSearchInput: re,
|
|
501
501
|
"onClick:row": m[4] || (m[4] = (v) => _(v)),
|
|
502
502
|
onEmptyStateCtaClicked: S,
|
|
@@ -506,8 +506,8 @@ const be = {
|
|
|
506
506
|
"toolbar-filter": p(() => [
|
|
507
507
|
$.value ? oe("", !0) : (T(), ee(s(oo), {
|
|
508
508
|
key: 0,
|
|
509
|
-
modelValue:
|
|
510
|
-
"onUpdate:modelValue": m[0] || (m[0] = (v) =>
|
|
509
|
+
modelValue: K.value,
|
|
510
|
+
"onUpdate:modelValue": m[0] || (m[0] = (v) => K.value = v),
|
|
511
511
|
config: te.value
|
|
512
512
|
}, null, 8, ["modelValue", "config"]))
|
|
513
513
|
]),
|
|
@@ -657,7 +657,7 @@ const be = {
|
|
|
657
657
|
]),
|
|
658
658
|
key: "0"
|
|
659
659
|
} : void 0,
|
|
660
|
-
e.enableV2EmptyStates && e.config.app === "konnect" ? {
|
|
660
|
+
!K.value && e.enableV2EmptyStates && e.config.app === "konnect" ? {
|
|
661
661
|
name: "empty-state",
|
|
662
662
|
fn: p(() => {
|
|
663
663
|
var v;
|
|
@@ -676,7 +676,7 @@ const be = {
|
|
|
676
676
|
image: p(() => [
|
|
677
677
|
F("div", wo, [
|
|
678
678
|
g(s(He), {
|
|
679
|
-
color: s(
|
|
679
|
+
color: s(co),
|
|
680
680
|
size: s(mo)
|
|
681
681
|
}, null, 8, ["color", "size"])
|
|
682
682
|
])
|
|
@@ -700,7 +700,7 @@ const be = {
|
|
|
700
700
|
"action-pending": Y.value,
|
|
701
701
|
"data-testid": "delete-consumer-group-modal",
|
|
702
702
|
description: s(i)("consumer_groups.delete.description"),
|
|
703
|
-
"entity-name":
|
|
703
|
+
"entity-name": U.value && (U.value.name || U.value.id),
|
|
704
704
|
"entity-type": s(no).ConsumerGroup,
|
|
705
705
|
error: fe.value,
|
|
706
706
|
title: s(i)("consumer_groups.delete.title"),
|
|
@@ -712,9 +712,9 @@ const be = {
|
|
|
712
712
|
key: 0,
|
|
713
713
|
config: e.config,
|
|
714
714
|
"data-testid": "add-to-group-modal",
|
|
715
|
-
visible:
|
|
716
|
-
"onAdd:partialSuccess": m[5] || (m[5] = (v) =>
|
|
717
|
-
"onAdd:success": m[6] || (m[6] = (v) =>
|
|
715
|
+
visible: l.value,
|
|
716
|
+
"onAdd:partialSuccess": m[5] || (m[5] = (v) => B(v, !0)),
|
|
717
|
+
"onAdd:success": m[6] || (m[6] = (v) => B(v)),
|
|
718
718
|
onCancel: A
|
|
719
719
|
}, null, 8, ["config", "visible"])) : oe("", !0),
|
|
720
720
|
e.config.consumerId && P.value ? (T(), ee(qe, {
|
|
@@ -752,7 +752,7 @@ const be = {
|
|
|
752
752
|
]);
|
|
753
753
|
};
|
|
754
754
|
}
|
|
755
|
-
}), Uo = /* @__PURE__ */ $e(Eo, [["__scopeId", "data-v-
|
|
755
|
+
}), Uo = /* @__PURE__ */ $e(Eo, [["__scopeId", "data-v-67b47a6f"]]), $o = { class: "kong-ui-entities-consumer-group-form" }, xo = { class: "select-item-container" }, Mo = { class: "select-item-label" }, So = {
|
|
756
756
|
key: 0,
|
|
757
757
|
class: "select-item-description"
|
|
758
758
|
}, Go = /* @__PURE__ */ _e({
|
|
@@ -788,14 +788,14 @@ const be = {
|
|
|
788
788
|
consumers: []
|
|
789
789
|
}), {
|
|
790
790
|
debouncedQueryChange: ie,
|
|
791
|
-
loading:
|
|
792
|
-
error:
|
|
793
|
-
loadItems:
|
|
791
|
+
loading: D,
|
|
792
|
+
error: le,
|
|
793
|
+
loadItems: ce,
|
|
794
794
|
results: W
|
|
795
795
|
} = Ke(u.config, (fe = J.form[(Y = u.config) == null ? void 0 : Y.app]) == null ? void 0 : fe.consumersList, "", {
|
|
796
796
|
fetchedItemsKey: "data",
|
|
797
797
|
searchKeys: ["username", "custom_id", "id"]
|
|
798
|
-
}), { axiosInstance: V } = Ee((ve = u.config) == null ? void 0 : ve.axiosRequestConfig), { getMessageFromError:
|
|
798
|
+
}), { axiosInstance: V } = Ee((ve = u.config) == null ? void 0 : ve.axiosRequestConfig), { getMessageFromError: K } = ao(), te = uo(), X = b(() => W.value.map((o) => ({
|
|
799
799
|
label: o.username || o.custom_id,
|
|
800
800
|
value: o.id,
|
|
801
801
|
selected: n.fields.consumers.includes(o.id),
|
|
@@ -805,9 +805,9 @@ const be = {
|
|
|
805
805
|
var o, a;
|
|
806
806
|
return (a = J.form[(o = u.config) == null ? void 0 : o.app]) == null ? void 0 : a.edit;
|
|
807
807
|
}), de = b(() => u.consumerGroupId ? Ie.Edit : Ie.Create), R = b(() => !!n.fields.name && !re.value), $ = b(() => JSON.stringify(n.fields) !== JSON.stringify(E)), x = (o, a = "", C = "") => {
|
|
808
|
-
var
|
|
809
|
-
let
|
|
810
|
-
return ((
|
|
808
|
+
var c, A, B, S, P, ae;
|
|
809
|
+
let l = `${(c = u.config) == null ? void 0 : c.apiBaseUrl}${J.form[(A = u.config) == null ? void 0 : A.app][o]}`;
|
|
810
|
+
return ((B = u.config) == null ? void 0 : B.app) === "konnect" ? l = l.replace(/{controlPlaneId}/gi, ((S = u.config) == null ? void 0 : S.controlPlaneId) || "") : ((P = u.config) == null ? void 0 : P.app) === "kongManager" && (l = l.replace(/\/{workspace}/gi, (ae = u.config) != null && ae.workspace ? `/${u.config.workspace}` : "")), l = l.replace(/{id}/gi, a || u.consumerGroupId), (o === "addConsumer" || o === "removeConsumer") && (l = l.replace(/{consumerId}/gi, C)), l;
|
|
811
811
|
}, me = () => {
|
|
812
812
|
var o;
|
|
813
813
|
i.push(((o = u.config) == null ? void 0 : o.cancelRoute) || { name: "consumer-group-list" });
|
|
@@ -816,15 +816,15 @@ const be = {
|
|
|
816
816
|
}, ge = (o) => {
|
|
817
817
|
t("loading", o);
|
|
818
818
|
}, M = async (o) => {
|
|
819
|
-
var C,
|
|
820
|
-
n.fields.name = ((C = o == null ? void 0 : o.item) == null ? void 0 : C.name) || ((
|
|
821
|
-
const a = ((
|
|
819
|
+
var C, l, c, A, B;
|
|
820
|
+
n.fields.name = ((C = o == null ? void 0 : o.item) == null ? void 0 : C.name) || ((l = o == null ? void 0 : o.consumer_group) == null ? void 0 : l.name) || (o == null ? void 0 : o.name) || "";
|
|
821
|
+
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) || [];
|
|
822
822
|
if (n.fields.tags = (a == null ? void 0 : a.join(", ")) || "", "consumers" in o)
|
|
823
823
|
n.fields.consumers = ((A = o == null ? void 0 : o.consumers) == null ? void 0 : A.map((S) => S.id)) || [];
|
|
824
824
|
else
|
|
825
825
|
try {
|
|
826
826
|
const { data: S } = await V.get(x("getConsumers"));
|
|
827
|
-
n.fields.consumers = "consumers" in S ? (
|
|
827
|
+
n.fields.consumers = "consumers" in S ? (B = S == null ? void 0 : S.consumers) == null ? void 0 : B.map((P) => P.id) : [];
|
|
828
828
|
} catch (S) {
|
|
829
829
|
f(S);
|
|
830
830
|
}
|
|
@@ -836,13 +836,13 @@ const be = {
|
|
|
836
836
|
tags: (a = (o = n.fields.tags.split(",")) == null ? void 0 : o.map((C) => String(C || "").trim())) == null ? void 0 : a.filter((C) => C !== "")
|
|
837
837
|
};
|
|
838
838
|
}), d = async (o, a = "") => await V.post(x("addConsumer", a, o), { consumer: o }), k = async (o, a = "") => await V.delete(x("removeConsumer", a, o)), f = (o) => {
|
|
839
|
-
n.errorMessage =
|
|
839
|
+
n.errorMessage = K(o), t("error", o);
|
|
840
840
|
}, _ = (o = u.consumerGroupId) => {
|
|
841
841
|
Object.assign(E, n.fields), t("update", { ...n.fields, id: o });
|
|
842
842
|
}, O = (o, a, C = u.consumerGroupId) => {
|
|
843
|
-
const
|
|
844
|
-
|
|
845
|
-
code:
|
|
843
|
+
const l = o == null ? void 0 : o.find((c) => c.status !== "fulfilled");
|
|
844
|
+
l ? f({
|
|
845
|
+
code: l.status,
|
|
846
846
|
message: a
|
|
847
847
|
}) : _(C);
|
|
848
848
|
}, Z = async () => {
|
|
@@ -855,63 +855,63 @@ const be = {
|
|
|
855
855
|
}
|
|
856
856
|
if (n.fields.consumers.length > 0 && o)
|
|
857
857
|
try {
|
|
858
|
-
const a = n.fields.consumers.map((
|
|
858
|
+
const a = n.fields.consumers.map((l) => d(l, o)), C = await Promise.allSettled(a);
|
|
859
859
|
O(C, y("consumer_groups.errors.add_consumer"), o);
|
|
860
860
|
} catch (a) {
|
|
861
861
|
f(a);
|
|
862
862
|
}
|
|
863
863
|
else n.fields.consumers.length === 0 && o && _(o);
|
|
864
|
-
},
|
|
864
|
+
}, U = async () => {
|
|
865
865
|
var C;
|
|
866
866
|
try {
|
|
867
867
|
((C = u.config) == null ? void 0 : C.app) === "konnect" ? await V.put(x("edit"), j.value) : await V.patch(x("edit"), j.value);
|
|
868
|
-
} catch (
|
|
869
|
-
f(
|
|
868
|
+
} catch (l) {
|
|
869
|
+
f(l);
|
|
870
870
|
}
|
|
871
|
-
const o = n.fields.consumers.filter((
|
|
871
|
+
const o = n.fields.consumers.filter((l) => !E.consumers.includes(l)), a = E.consumers.filter((l) => !n.fields.consumers.includes(l));
|
|
872
872
|
if (a.length === 0 && o.length === 0)
|
|
873
873
|
_();
|
|
874
874
|
else {
|
|
875
875
|
if (a.length > 0)
|
|
876
876
|
try {
|
|
877
|
-
const
|
|
878
|
-
O(
|
|
879
|
-
} catch (
|
|
880
|
-
f(
|
|
877
|
+
const l = a.map((A) => k(A)), c = await Promise.allSettled(l);
|
|
878
|
+
O(c, y("consumer_groups.errors.remove_consumer"));
|
|
879
|
+
} catch (l) {
|
|
880
|
+
f(l);
|
|
881
881
|
}
|
|
882
882
|
if (o.length > 0)
|
|
883
883
|
try {
|
|
884
|
-
const
|
|
885
|
-
O(
|
|
886
|
-
} catch (
|
|
887
|
-
f(
|
|
884
|
+
const l = o.map((A) => d(A)), c = await Promise.allSettled(l);
|
|
885
|
+
O(c, y("consumer_groups.errors.add_consumer"));
|
|
886
|
+
} catch (l) {
|
|
887
|
+
f(l);
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
890
|
}, ne = async () => {
|
|
891
891
|
try {
|
|
892
|
-
n.readonly = !0, de.value === Ie.Create ? await Z() : await
|
|
892
|
+
n.readonly = !0, de.value === Ie.Create ? await Z() : await U();
|
|
893
893
|
} finally {
|
|
894
894
|
n.readonly = !1;
|
|
895
895
|
}
|
|
896
896
|
};
|
|
897
897
|
return Ve(async () => {
|
|
898
|
-
await
|
|
898
|
+
await ce();
|
|
899
899
|
}), (o, a) => {
|
|
900
|
-
const C = Q("KInput"),
|
|
900
|
+
const C = Q("KInput"), l = Q("KMultiselect");
|
|
901
901
|
return T(), z("div", $o, [
|
|
902
902
|
g(s(io), {
|
|
903
903
|
"can-submit": R.value && $.value,
|
|
904
904
|
config: e.config,
|
|
905
905
|
"edit-id": e.consumerGroupId,
|
|
906
906
|
"entity-type": s(Ue).ConsumerGroup,
|
|
907
|
-
"error-message": n.errorMessage || s(
|
|
907
|
+
"error-message": n.errorMessage || s(le) || re.value,
|
|
908
908
|
"fetch-url": se.value,
|
|
909
909
|
"form-fields": j.value,
|
|
910
910
|
"is-readonly": n.readonly,
|
|
911
911
|
onCancel: me,
|
|
912
|
-
"onFetch:error": a[3] || (a[3] = (
|
|
912
|
+
"onFetch:error": a[3] || (a[3] = (c) => pe(c)),
|
|
913
913
|
"onFetch:success": M,
|
|
914
|
-
onLoading: a[4] || (a[4] = (
|
|
914
|
+
onLoading: a[4] || (a[4] = (c) => ge(c)),
|
|
915
915
|
onSubmit: ne
|
|
916
916
|
}, {
|
|
917
917
|
default: p(() => [
|
|
@@ -922,7 +922,7 @@ const be = {
|
|
|
922
922
|
default: p(() => [
|
|
923
923
|
g(C, {
|
|
924
924
|
modelValue: n.fields.name,
|
|
925
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
925
|
+
"onUpdate:modelValue": a[0] || (a[0] = (c) => n.fields.name = c),
|
|
926
926
|
modelModifiers: { trim: !0 },
|
|
927
927
|
autocomplete: "off",
|
|
928
928
|
"data-testid": "consumer-group-form-name",
|
|
@@ -933,7 +933,7 @@ const be = {
|
|
|
933
933
|
}, null, 8, ["modelValue", "label", "placeholder"]),
|
|
934
934
|
g(C, {
|
|
935
935
|
modelValue: n.fields.tags,
|
|
936
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
936
|
+
"onUpdate:modelValue": a[1] || (a[1] = (c) => n.fields.tags = c),
|
|
937
937
|
modelModifiers: { trim: !0 },
|
|
938
938
|
autocomplete: "off",
|
|
939
939
|
"data-testid": "consumer-group-form-tags",
|
|
@@ -955,24 +955,24 @@ const be = {
|
|
|
955
955
|
title: s(y)("consumer_groups.form.consumers.title")
|
|
956
956
|
}, {
|
|
957
957
|
default: p(() => [
|
|
958
|
-
g(
|
|
958
|
+
g(l, {
|
|
959
959
|
modelValue: n.fields.consumers,
|
|
960
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
|
960
|
+
"onUpdate:modelValue": a[2] || (a[2] = (c) => n.fields.consumers = c),
|
|
961
961
|
appearance: "select",
|
|
962
962
|
autosuggest: "",
|
|
963
963
|
items: X.value,
|
|
964
964
|
label: s(y)("consumer_groups.form.fields.consumers.label"),
|
|
965
|
-
loading: s(
|
|
965
|
+
loading: s(D),
|
|
966
966
|
placeholder: s(y)("consumer_groups.form.fields.consumers.placeholder"),
|
|
967
967
|
width: "auto",
|
|
968
968
|
onQueryChange: s(ie)
|
|
969
969
|
}, {
|
|
970
|
-
"item-template": p(({ item:
|
|
971
|
-
var A,
|
|
970
|
+
"item-template": p(({ item: c }) => {
|
|
971
|
+
var A, B, S;
|
|
972
972
|
return [
|
|
973
973
|
F("div", xo, [
|
|
974
|
-
F("div", Mo, G(
|
|
975
|
-
(A =
|
|
974
|
+
F("div", Mo, G(c.label), 1),
|
|
975
|
+
(A = c == null ? void 0 : c.data) != null && A.username && ((B = c == null ? void 0 : c.data) != null && B.custom_id) ? (T(), z("div", So, G((S = c == null ? void 0 : c.data) == null ? void 0 : S.custom_id), 1)) : oe("", !0)
|
|
976
976
|
])
|
|
977
977
|
];
|
|
978
978
|
}),
|
|
@@ -1024,7 +1024,7 @@ const be = {
|
|
|
1024
1024
|
}
|
|
1025
1025
|
});
|
|
1026
1026
|
return (i, n) => (T(), z("div", Ao, [
|
|
1027
|
-
g(s(
|
|
1027
|
+
g(s(lo), {
|
|
1028
1028
|
config: e.config,
|
|
1029
1029
|
"config-card-doc": e.configCardDoc,
|
|
1030
1030
|
"config-schema": y.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function($,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):($=typeof globalThis<"u"?globalThis:$||self,e($["kong-ui-public-entities-consumer-groups"]={},$.Vue,$.VueRouter,$.KongIcons,$["kong-ui-public-i18n"],$["kong-ui-public-entities-shared"]))})(this,function($,e,me,ae,pe,p){"use strict";const he="#00abd2",_e="24px",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"},empty_state_v2:{title:"Configure your first consumer group",group:"Consumer groups created in gateways within this group will automatically appear here.",description:"Organize consumers into groups to easily apply policies like rate limiting and authentication across the entire 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 all its plugins and 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 ke(){const o=pe.createI18n("en-us",Ce);return{i18n:o,i18nT:pe.i18nTComponent(o)}}const ce={useI18n:ke},A="/v2/control-planes/{controlPlaneId}/core-entities",D="/{workspace}",q={list:{konnect:{all:`${A}/consumer_groups`,forModal:`${A}/consumer_groups`,forConsumer:`${A}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${A}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`},kongManager:{all:`${D}/consumer_groups?counter=true`,forModal:`${D}/consumer_groups`,forConsumer:`${D}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${D}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`}},form:{konnect:{consumersList:`${A}/consumers`,create:`${A}/consumer_groups`,edit:`${A}/consumer_groups/{id}`,addConsumer:`${A}/consumer_groups/{id}/consumers`,removeConsumer:`${A}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${A}/consumer_groups/{id}/consumers`},kongManager:{consumersList:`${D}/consumers`,create:`${D}/consumer_groups`,edit:`${D}/consumer_groups/{id}`,addConsumer:`${D}/consumer_groups/{id}/consumers`,removeConsumer:`${D}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${D}/consumer_groups/{id}/consumers`}}},be={class:"add-to-group-form-container"},we={class:"add-to-group-cta-text"},Ve={key:0,class:"kong-ui-entity-add-to-groups-error"},Ie={key:0},xe=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:U}){var R;const{i18n:{t:c}}=ce.useI18n(),r=o,y=U,{axiosInstance:i}=p.useAxios((R=r.config)==null?void 0:R.axiosRequestConfig),s=e.ref([]),{debouncedQueryChange:w,loading:Y,allRecords:P,error:v,loadItems:ee,results:j}=p.useDebouncedFilter(r.config,q.list[r.config.app].forModal,"",{fetchedItemsKey:"data",searchKeys:["name","id"]}),T=e.computed(()=>v.value?c("consumer_groups.errors.general"):""),S=e.ref(0),z=e.computed(()=>P.value===void 0),L=e.computed(()=>j.value.map(d=>({label:d.name,value:d.id,selected:s.value.includes(d.id),data:d}))),J=d=>{var f;const k=z.value?j.value.find(_=>_.id===d):(f=P.value)==null?void 0:f.find(_=>_.id===d);return k?k.name:d},oe=()=>{I.value="",F.value=[],x.value=[],y("cancel")},F=e.ref([]),V=e.ref(!1),I=e.ref(""),te=async()=>{if(!s.value.length){I.value="",x.value=[],y("cancel");return}V.value=!0,I.value="",F.value=[],x.value=[];try{const d=s.value.map(_=>ne(_)),k=await Promise.allSettled(d);let f=!0;k.forEach(_=>{_.status!=="fulfilled"&&(f=!1)}),f?(F.value=[],x.value=[],y("add:success",s.value),s.value=[]):(F.value.length&&y("add:partial-success",F.value),s.value=[],W(k))}catch{I.value=c("consumer_groups.errors.add"),y("error",I.value)}finally{V.value=!1}},re=e.computed(()=>{var k,f,_,K;let d=`${r.config.apiBaseUrl}${q.list[r.config.app].forConsumer}`;return r.config.app==="konnect"?d=d.replace(/{controlPlaneId}/gi,((k=r.config)==null?void 0:k.controlPlaneId)||"").replace(/{consumerId}/gi,((f=r.config)==null?void 0:f.consumerId)||""):r.config.app==="kongManager"&&(d=d.replace(/\/{workspace}/gi,(_=r.config)!=null&&_.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((K=r.config)==null?void 0:K.consumerId)||"")),d}),ne=async d=>{const k={group:d};try{const f=await i.post(re.value,k);return F.value.push(d),f}catch(f){let _=`${J(d)} - ${f.message}`;return f.response.status===409&&(_=`${J(d)} - ${c("consumer_groups.errors.already_added")}`),Promise.reject(Error(_))}},x=e.ref([]),W=d=>{x.value=d.map(k=>{var f;return(f=k.reason)==null?void 0:f.message}).filter(Boolean)};return e.watch(L,()=>{S.value++},{immediate:!0,deep:!0}),e.watch(()=>r.visible,()=>{r.visible&&ee()},{immediate:!0}),(d,k)=>{const f=e.resolveComponent("KMultiselect"),_=e.resolveComponent("KAlert"),K=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(K,{"action-button-disabled":V.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:oe,onProceed:te},{default:e.withCtx(()=>[e.createElementVNode("div",be,[e.createElementVNode("p",we,e.toDisplayString(e.unref(c)("consumer_groups.consumers.add.ctaText")),1),e.createVNode(f,{modelValue:s.value,"onUpdate:modelValue":k[0]||(k[0]=Q=>s.value=Q),autosuggest:"","data-testid":"add-to-groups-multiselect","dropdown-footer-text":z.value?e.unref(c)("consumer_groups.consumers.add.footer"):void 0,items:L.value,label:e.unref(c)("consumer_groups.consumers.add.consumer_groups_label"),loading:e.unref(Y),placeholder:e.unref(c)("consumer_groups.consumers.add.consumer_group_placeholder"),readonly:V.value,required:"",width:"100%",onQueryChange:e.unref(w)},null,8,["modelValue","dropdown-footer-text","items","label","loading","placeholder","readonly","onQueryChange"]),I.value||T.value||x.value.length?(e.openBlock(),e.createElementBlock("div",Ve,[e.createVNode(_,{appearance:"danger"},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(e.unref(c)("consumer_groups.errors.add")),1),x.value.length?(e.openBlock(),e.createElementBlock("ul",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(Q,M)=>(e.openBlock(),e.createElementBlock("li",{key:M},e.toDisplayString(Q),1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(I.value||T.value),1)]),_:1})])):e.createCommentVNode("",!0)])]),_:1},8,["action-button-disabled","title","visible"])}}}),ue=(o,U)=>{const c=o.__vccOpts||o;for(const[r,y]of U)c[r]=y;return c},Ee=ue(xe,[["__scopeId","data-v-4260ce03"]]),Ne={class:"kong-ui-entities-consumer-groups-list"},$e={class:"button-row"},Be={class:"empty-state-icon-gateway"},Te=ue(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},enableV2EmptyStates:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success","add:success","remove:success"],setup(o,{emit:U}){var ye;const c=U,r=o,{i18nT:y,i18n:{t:i}}=ce.useI18n(),s=me.useRouter(),{axiosInstance:w}=p.useAxios((ye=r.config)==null?void 0:ye.axiosRequestConfig),Y=e.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),P={name:{label:i("consumer_groups.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1}};r.config.app==="kongManager"&&(P.consumers_count={label:i("consumer_groups.list.table_headers.consumers_count"),searchable:!1,sortable:!1}),P.tags={label:i("consumer_groups.list.table_headers.tags"),sortable:!1};const v=P,ee=n=>({"data-testid":n.username??n.custom_id??n.id}),j=()=>{r.config.consumerId?u():s.push(r.config.createRoute)},T=e.computed(()=>{var m,h,b,O;let n=`${r.config.apiBaseUrl}${q.list[r.config.app][V.value?"forConsumer":"all"]}`;return r.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||"").replace(/{consumerId}/gi,((h=r.config)==null?void 0:h.consumerId)||""):r.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(b=r.config)!=null&&b.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((O=r.config)==null?void 0:O.consumerId)||"")),n}),S=e.ref(""),z=e.computed(()=>{const n=r.config.app==="konnect"||r.config.isExactMatch;return n?{isExactMatch:n,fields:{username:P.name,id:{label:i("consumer_groups.list.table_headers.id")}},placeholder:i("consumer_groups.search.placeholder")}:{isExactMatch:n,fields:{name:P.name},schema:r.config.filterSchema}}),{hasRecords:L,handleStateChange:J}=p.useTableState(S),oe=e.computed(()=>L.value&&r.config.app==="konnect"),F=e.computed(()=>!r.enableV2EmptyStates&&r.config.app==="konnect"),V=e.computed(()=>!!r.config.consumerId),I=e.computed(()=>V.value?"kong-ui-entities-consumer-groups-list-in-consumer-page":"kong-ui-entities-consumer-groups-list"),te=e.computed(()=>r.config.app==="konnect"&&S.value?"consumer_group":V.value&&!r.config.paginatedEndpoint?"consumer_groups":void 0),{fetcher:re,fetcherState:ne,fetcherCacheKey:x}=p.useFetcher({...r.config,cacheIdentifier:r.cacheIdentifier},T.value,te),W=()=>{S.value=""},R=()=>{x.value++},d=e.ref(null),k=(n,m)=>{const h=n.id;if(!m(h)){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:h})})},f=(n,m)=>{const h=JSON.stringify(n);if(!m(h)){c("copy:error",{entity:n,message:i("consumer_groups.errors.copy")});return}c("copy:success",{entity:n,message:i("consumer_groups.copy.success_brief")})},_=async n=>{var h;await((h=r.canRetrieve)==null?void 0:h.call(r,n))&&s.push(r.config.getViewRoute(n.id))},K=n=>({label:i("consumer_groups.actions.view"),to:r.config.getViewRoute(n)}),Q=n=>({label:i("consumer_groups.actions.edit"),to:r.config.getEditRoute(n)}),M=e.ref(void 0),X=e.ref(!1),H=e.ref(!1),se=e.ref(""),ie=p.useDeleteUrlBuilder(r.config,T.value),t=n=>{M.value=n,X.value=!0},a=()=>{X.value=!1},C=async()=>{var n,m,h;if((n=M.value)!=null&&n.id){H.value=!0;try{await w.delete(ie(M.value.id)),H.value=!1,X.value=!1,x.value++,c("delete:success",M.value)}catch(b){se.value=((h=(m=b.response)==null?void 0:m.data)==null?void 0:h.message)||b.message||i("consumer_groups.errors.delete"),c("error",b)}finally{H.value=!1}}},l=e.ref(!1),u=()=>{l.value=!0},N=()=>{l.value=!1},G=(n,m)=>{m||N(),x.value++,c("add:success",n)},E=()=>{V.value&&u()},B=e.ref(void 0),Z=e.ref(!1),Ke=e.ref(""),Ue=n=>{B.value=n,Z.value=!0},fe=()=>{Z.value=!1,B.value=void 0},Re=e.computed(()=>{var m,h,b,O;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,((h=r.config)==null?void 0:h.consumerId)||""):r.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(b=r.config)!=null&&b.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((O=r.config)==null?void 0:O.consumerId)||"")),n}),ge=e.ref(!1),qe=async()=>{if(B.value){ge.value=!0;try{const n=Re.value.replace(/{consumerGroupId}/gi,B.value.id);await w.delete(n),c("remove:success",B.value),fe(),x.value++}catch(n){Ke.value=n.message||i("consumer_groups.errors.delete"),c("error",n)}finally{ge.value=!1}}};e.watch(ne,n=>{var m,h,b;if(n.status===p.FetcherStatus.Error){d.value={title:i("consumer_groups.errors.general")},(b=(h=(m=n.error)==null?void 0:m.response)==null?void 0:h.data)!=null&&b.message&&(d.value.message=n.error.response.data.message),c("error",n.error);return}d.value=null});const de=e.ref({ctaPath:V.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=V.value?i("consumer_groups.list.empty_state.title_for_consumer"):i("consumer_groups.list.empty_state.title"),de.value.ctaText=V.value?i("consumer_groups.actions.add_to_group"):i("consumer_groups.actions.create"))}),(n,m)=>{const h=e.resolveComponent("KButton"),b=e.resolveComponent("KDropdownItem"),O=e.resolveComponent("KClipboardProvider"),Oe=e.resolveComponent("KPrompt");return e.openBlock(),e.createElementBlock("div",Ne,[e.createVNode(e.unref(p.EntityBaseTable),{"cache-identifier":o.cacheIdentifier,"disable-pagination":V.value&&!o.config.paginatedEndpoint,"disable-sorting":Y.value,"empty-state-options":de.value,"enable-entity-actions":"","error-message":d.value,fetcher:e.unref(re),"fetcher-cache-key":e.unref(x),"pagination-type":"offset","preferences-storage-key":I.value,query:S.value,"row-attributes":ee,"table-headers":e.unref(v),onClearSearchInput:W,"onClick:row":m[4]||(m[4]=g=>_(g)),onEmptyStateCtaClicked:E,onSort:R,onState:e.unref(J)},e.createSlots({"toolbar-filter":e.withCtx(()=>[V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(p.EntityFilter),{key:0,modelValue:S.value,"onUpdate:modelValue":m[0]||(m[0]=g=>S.value=g),config:z.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.createElementVNode("div",$e,[oe.value?(e.openBlock(),e.createBlock(h,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"consumer-groups-learn-more-button",icon:"",onClick:m[1]||(m[1]=g=>n.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(ae.BookIcon),{decorative:""})]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canCreate()},{default:e.withCtx(()=>[e.createVNode(h,{appearance:"primary","data-testid":"toolbar-add-consumer-group",size:o.useActionOutside?"medium":"large",onClick:j},{default:e.withCtx(()=>[e.createVNode(e.unref(ae.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"])]),_:1},8,["auth-function"])])],8,["disabled"]))]),name:e.withCtx(({rowValue:g})=>[e.createElementVNode("b",null,e.toDisplayString(g??"-"),1)]),consumers_count:e.withCtx(({rowValue:g})=>[e.createTextVNode(e.toDisplayString(g??"-"),1)]),tags:e.withCtx(({rowValue:g})=>[e.createVNode(e.unref(p.TableTags),{tags:g},null,8,["tags"])]),actions:e.withCtx(({row:g})=>[e.createVNode(O,null,{default:e.withCtx(({copyToClipboard:le})=>[e.createVNode(b,{"data-testid":"action-entity-copy-id",onClick:je=>k(g,le)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("consumer_groups.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(O,null,{default:e.withCtx(({copyToClipboard:le})=>[e.createVNode(b,{"data-testid":"action-entity-copy-json",onClick:je=>f(g,le)},{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(p.PermissionsWrapper),{"auth-function":()=>o.canRetrieve(g)},{default:e.withCtx(()=>[e.createVNode(b,{"data-testid":"action-entity-view","has-divider":"",item:K(g.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canEdit(g)},{default:e.withCtx(()=>[e.createVNode(b,{"data-testid":"action-entity-edit",item:Q(g.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canDelete(g)},{default:e.withCtx(()=>[e.createVNode(b,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:()=>o.config.consumerId?Ue(g):t(g)},{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"])]),_:2},[!e.unref(L)&&F.value?{name:"outside-actions",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!o.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(h,{appearance:"secondary",class:"open-learning-hub","data-testid":"consumer-groups-learn-more-button",icon:"",onClick:m[2]||(m[2]=g=>n.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(ae.BookIcon),{decorative:""})]),_:1})],8,["disabled"]))]),key:"0"}:void 0,o.enableV2EmptyStates&&o.config.app==="konnect"?{name:"empty-state",fn:e.withCtx(()=>{var g;return[e.createVNode(e.unref(p.EntityEmptyState),{"action-button-text":e.unref(i)("consumer_groups.list.toolbar_actions.new_consumer_group"),appearance:"secondary","can-create":()=>o.canCreate(),"data-testid":"consumer-groups-entity-empty-state",description:e.unref(i)("consumer_groups.list.empty_state_v2.description"),"learn-more":o.config.app==="konnect",title:e.unref(i)("consumer_groups.list.empty_state_v2.title"),"onClick:create":j,"onClick:learnMore":m[3]||(m[3]=le=>n.$emit("click:learn-more"))},e.createSlots({image:e.withCtx(()=>[e.createElementVNode("div",Be,[e.createVNode(e.unref(ae.TeamIcon),{color:e.unref(he),size:e.unref(_e)},null,8,["color","size"])])]),_:2},[(g=o.config)!=null&&g.isControlPlaneGroup?{name:"message",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("consumer_groups.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["action-button-text","can-create","description","learn-more","title"])]}),key:"1"}:void 0]),1032,["cache-identifier","disable-pagination","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","preferences-storage-key","query","table-headers","onState"]),e.createVNode(e.unref(p.EntityDeleteModal),{"action-pending":H.value,"data-testid":"delete-consumer-group-modal",description:e.unref(i)("consumer_groups.delete.description"),"entity-name":M.value&&(M.value.name||M.value.id),"entity-type":e.unref(p.EntityTypes).ConsumerGroup,error:se.value,title:e.unref(i)("consumer_groups.delete.title"),visible:X.value,onCancel:a,onProceed:C},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:l.value,"onAdd:partialSuccess":m[5]||(m[5]=g=>G(g,!0)),"onAdd:success":m[6]||(m[6]=g=>G(g)),onCancel:N},null,8,["config","visible"])):e.createCommentVNode("",!0),o.config.consumerId&&B.value?(e.openBlock(),e.createBlock(Oe,{key:1,"action-button-appearance":"danger","data-testid":"exit-group-modal",title:e.unref(i)("consumer_groups.consumers.exit.title"),visible:Z.value,onCancel:fe,onProceed:qe},{default:e.withCtx(()=>[e.createVNode(e.unref(y),{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(B.value.name||B.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-521aa93a"]]),Me={class:"kong-ui-entities-consumer-group-form"},Ge={class:"select-item-container"},Ae={class:"select-item-label"},De={key:0,class:"select-item-description"},Pe=ue(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:""}},emits:["update","error","loading"],setup(o,{emit:U}){var H,se,ie;const c=o,r=U,{i18n:{t:y}}=ce.useI18n(),i=me.useRouter(),s=e.reactive({fields:{name:"",tags:"",consumers:[]},errorMessage:"",readonly:!1}),w=e.reactive({name:"",tags:"",consumers:[]}),{debouncedQueryChange:Y,loading:P,error:v,loadItems:ee,results:j}=p.useDebouncedFilter(c.config,(se=q.form[(H=c.config)==null?void 0:H.app])==null?void 0:se.consumersList,"",{fetchedItemsKey:"data",searchKeys:["username","custom_id","id"]}),{axiosInstance:T}=p.useAxios((ie=c.config)==null?void 0:ie.axiosRequestConfig),{getMessageFromError:S}=p.useErrors(),z=p.useValidators(),L=e.computed(()=>j.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}),oe=e.computed(()=>c.consumerGroupId?p.EntityBaseFormType.Edit:p.EntityBaseFormType.Create),F=e.computed(()=>!!s.fields.name&&!W.value),V=e.computed(()=>JSON.stringify(s.fields)!==JSON.stringify(w)),I=(t,a="",C="")=>{var u,N,G,E,B,Z;let l=`${(u=c.config)==null?void 0:u.apiBaseUrl}${q.form[(N=c.config)==null?void 0:N.app][t]}`;return((G=c.config)==null?void 0:G.app)==="konnect"?l=l.replace(/{controlPlaneId}/gi,((E=c.config)==null?void 0:E.controlPlaneId)||""):((B=c.config)==null?void 0:B.app)==="kongManager"&&(l=l.replace(/\/{workspace}/gi,(Z=c.config)!=null&&Z.workspace?`/${c.config.workspace}`:"")),l=l.replace(/{id}/gi,a||c.consumerGroupId),(t==="addConsumer"||t==="removeConsumer")&&(l=l.replace(/{consumerId}/gi,C)),l},te=()=>{var t;i.push(((t=c.config)==null?void 0:t.cancelRoute)||{name:"consumer-group-list"})},re=t=>{r("error",t)},ne=t=>{r("loading",t)},x=async t=>{var C,l,u,N,G;s.fields.name=((C=t==null?void 0:t.item)==null?void 0:C.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=((N=t==null?void 0:t.consumers)==null?void 0:N.map(E=>E.id))||[];else try{const{data:E}=await T.get(I("getConsumers"));s.fields.consumers="consumers"in E?(G=E==null?void 0:E.consumers)==null?void 0:G.map(B=>B.id):[]}catch(E){f(E)}Object.assign(w,s.fields)},W=e.computed(()=>z.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(C=>String(C||"").trim()))==null?void 0:a.filter(C=>C!=="")}}),d=async(t,a="")=>await T.post(I("addConsumer",a,t),{consumer:t}),k=async(t,a="")=>await T.delete(I("removeConsumer",a,t)),f=t=>{s.errorMessage=S(t),r("error",t)},_=(t=c.consumerGroupId)=>{Object.assign(w,s.fields),r("update",{...s.fields,id:t})},K=(t,a,C=c.consumerGroupId)=>{const l=t==null?void 0:t.find(u=>u.status!=="fulfilled");l?f({code:l.status,message:a}):_(C)},Q=async()=>{let t="";try{const{data:a}=await T.post(I("create"),R.value);t="item"in a?a.item.id:a.id}catch(a){f(a)}if(s.fields.consumers.length>0&&t)try{const a=s.fields.consumers.map(l=>d(l,t)),C=await Promise.allSettled(a);K(C,y("consumer_groups.errors.add_consumer"),t)}catch(a){f(a)}else s.fields.consumers.length===0&&t&&_(t)},M=async()=>{var C;try{((C=c.config)==null?void 0:C.app)==="konnect"?await T.put(I("edit"),R.value):await T.patch(I("edit"),R.value)}catch(l){f(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)_();else{if(a.length>0)try{const l=a.map(N=>k(N)),u=await Promise.allSettled(l);K(u,y("consumer_groups.errors.remove_consumer"))}catch(l){f(l)}if(t.length>0)try{const l=t.map(N=>d(N)),u=await Promise.allSettled(l);K(u,y("consumer_groups.errors.add_consumer"))}catch(l){f(l)}}},X=async()=>{try{s.readonly=!0,oe.value===p.EntityBaseFormType.Create?await Q():await M()}finally{s.readonly=!1}};return e.onBeforeMount(async()=>{await ee()}),(t,a)=>{const C=e.resolveComponent("KInput"),l=e.resolveComponent("KMultiselect");return e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(e.unref(p.EntityBaseForm),{"can-submit":F.value&&V.value,config:o.config,"edit-id":o.consumerGroupId,"entity-type":e.unref(p.SupportedEntityType).ConsumerGroup,"error-message":s.errorMessage||e.unref(v)||W.value,"fetch-url":J.value,"form-fields":R.value,"is-readonly":s.readonly,onCancel:te,"onFetch:error":a[3]||(a[3]=u=>re(u)),"onFetch:success":x,onLoading:a[4]||(a[4]=u=>ne(u)),onSubmit:X},{default:e.withCtx(()=>[e.createVNode(e.unref(p.EntityFormSection),{description:e.unref(y)("consumer_groups.form.general_info.description"),title:e.unref(y)("consumer_groups.form.general_info.title")},{default:e.withCtx(()=>[e.createVNode(C,{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(y)("consumer_groups.form.fields.name.label"),placeholder:e.unref(y)("consumer_groups.form.fields.name.placeholder"),required:"",type:"text"},null,8,["modelValue","label","placeholder"]),e.createVNode(C,{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(y)("consumer_groups.form.fields.tags.help"),label:e.unref(y)("consumer_groups.form.fields.tags.label"),"label-attributes":{info:e.unref(y)("consumer_groups.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(y)("consumer_groups.form.fields.tags.placeholder"),type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder"])]),_:1},8,["description","title"]),e.createVNode(e.unref(p.EntityFormSection),{description:e.unref(y)("consumer_groups.form.consumers.description"),"has-divider":"",title:e.unref(y)("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:L.value,label:e.unref(y)("consumer_groups.form.fields.consumers.label"),loading:e.unref(P),placeholder:e.unref(y)("consumer_groups.form.fields.consumers.placeholder"),width:"auto",onQueryChange:e.unref(Y)},{"item-template":e.withCtx(({item:u})=>{var N,G,E;return[e.createElementVNode("div",Ge,[e.createElementVNode("div",Ae,e.toDisplayString(u.label),1),(N=u==null?void 0:u.data)!=null&&N.username&&((G=u==null?void 0:u.data)!=null&&G.custom_id)?(e.openBlock(),e.createElementBlock("div",De,e.toDisplayString((E=u==null?void 0:u.data)==null?void 0:E.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","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-ba631513"]]),Se={class:"kong-ui-consumer-group-entity-config-card"},Fe=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}},emits:["loading","fetch:error","fetch:success"],setup(o){const U=o,{i18n:{t:c}}=ce.useI18n(),r=e.computed(()=>q.form[U.config.app].edit),y=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",Se,[e.createVNode(e.unref(p.EntityBaseConfigCard),{config:o.config,"config-card-doc":o.configCardDoc,"config-schema":y.value,"data-key":"consumer_group","entity-type":e.unref(p.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","entity-type","fetch-url","hide-title"])]))}});$.ConsumerGroupConfigCard=Fe,$.ConsumerGroupForm=Pe,$.ConsumerGroupList=Te,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function($,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):($=typeof globalThis<"u"?globalThis:$||self,e($["kong-ui-public-entities-consumer-groups"]={},$.Vue,$.VueRouter,$.KongIcons,$["kong-ui-public-i18n"],$["kong-ui-public-entities-shared"]))})(this,function($,e,me,ae,pe,p){"use strict";const he="#00abd2",_e="24px",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"},empty_state_v2:{title:"Configure your first consumer group",group:"Consumer groups created in gateways within this group will automatically appear here.",description:"Organize consumers into groups to easily apply policies like rate limiting and authentication across the entire 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 all its plugins and 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 ke(){const o=pe.createI18n("en-us",Ce);return{i18n:o,i18nT:pe.i18nTComponent(o)}}const ce={useI18n:ke},D="/v2/control-planes/{controlPlaneId}/core-entities",P="/{workspace}",q={list:{konnect:{all:`${D}/consumer_groups`,forModal:`${D}/consumer_groups`,forConsumer:`${D}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${D}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`},kongManager:{all:`${P}/consumer_groups?counter=true`,forModal:`${P}/consumer_groups`,forConsumer:`${P}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${P}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`}},form:{konnect:{consumersList:`${D}/consumers`,create:`${D}/consumer_groups`,edit:`${D}/consumer_groups/{id}`,addConsumer:`${D}/consumer_groups/{id}/consumers`,removeConsumer:`${D}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${D}/consumer_groups/{id}/consumers`},kongManager:{consumersList:`${P}/consumers`,create:`${P}/consumer_groups`,edit:`${P}/consumer_groups/{id}`,addConsumer:`${P}/consumer_groups/{id}/consumers`,removeConsumer:`${P}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${P}/consumer_groups/{id}/consumers`}}},be={class:"add-to-group-form-container"},we={class:"add-to-group-cta-text"},Ve={key:0,class:"kong-ui-entity-add-to-groups-error"},Ie={key:0},xe=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:U}){var R;const{i18n:{t:c}}=ce.useI18n(),r=o,y=U,{axiosInstance:i}=p.useAxios((R=r.config)==null?void 0:R.axiosRequestConfig),s=e.ref([]),{debouncedQueryChange:w,loading:Y,allRecords:S,error:v,loadItems:ee,results:j}=p.useDebouncedFilter(r.config,q.list[r.config.app].forModal,"",{fetchedItemsKey:"data",searchKeys:["name","id"]}),T=e.computed(()=>v.value?c("consumer_groups.errors.general"):""),M=e.ref(0),z=e.computed(()=>S.value===void 0),L=e.computed(()=>j.value.map(d=>({label:d.name,value:d.id,selected:s.value.includes(d.id),data:d}))),J=d=>{var f;const k=z.value?j.value.find(_=>_.id===d):(f=S.value)==null?void 0:f.find(_=>_.id===d);return k?k.name:d},oe=()=>{I.value="",F.value=[],x.value=[],y("cancel")},F=e.ref([]),V=e.ref(!1),I=e.ref(""),te=async()=>{if(!s.value.length){I.value="",x.value=[],y("cancel");return}V.value=!0,I.value="",F.value=[],x.value=[];try{const d=s.value.map(_=>ne(_)),k=await Promise.allSettled(d);let f=!0;k.forEach(_=>{_.status!=="fulfilled"&&(f=!1)}),f?(F.value=[],x.value=[],y("add:success",s.value),s.value=[]):(F.value.length&&y("add:partial-success",F.value),s.value=[],W(k))}catch{I.value=c("consumer_groups.errors.add"),y("error",I.value)}finally{V.value=!1}},re=e.computed(()=>{var k,f,_,K;let d=`${r.config.apiBaseUrl}${q.list[r.config.app].forConsumer}`;return r.config.app==="konnect"?d=d.replace(/{controlPlaneId}/gi,((k=r.config)==null?void 0:k.controlPlaneId)||"").replace(/{consumerId}/gi,((f=r.config)==null?void 0:f.consumerId)||""):r.config.app==="kongManager"&&(d=d.replace(/\/{workspace}/gi,(_=r.config)!=null&&_.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((K=r.config)==null?void 0:K.consumerId)||"")),d}),ne=async d=>{const k={group:d};try{const f=await i.post(re.value,k);return F.value.push(d),f}catch(f){let _=`${J(d)} - ${f.message}`;return f.response.status===409&&(_=`${J(d)} - ${c("consumer_groups.errors.already_added")}`),Promise.reject(Error(_))}},x=e.ref([]),W=d=>{x.value=d.map(k=>{var f;return(f=k.reason)==null?void 0:f.message}).filter(Boolean)};return e.watch(L,()=>{M.value++},{immediate:!0,deep:!0}),e.watch(()=>r.visible,()=>{r.visible&&ee()},{immediate:!0}),(d,k)=>{const f=e.resolveComponent("KMultiselect"),_=e.resolveComponent("KAlert"),K=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(K,{"action-button-disabled":V.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:oe,onProceed:te},{default:e.withCtx(()=>[e.createElementVNode("div",be,[e.createElementVNode("p",we,e.toDisplayString(e.unref(c)("consumer_groups.consumers.add.ctaText")),1),e.createVNode(f,{modelValue:s.value,"onUpdate:modelValue":k[0]||(k[0]=Q=>s.value=Q),autosuggest:"","data-testid":"add-to-groups-multiselect","dropdown-footer-text":z.value?e.unref(c)("consumer_groups.consumers.add.footer"):void 0,items:L.value,label:e.unref(c)("consumer_groups.consumers.add.consumer_groups_label"),loading:e.unref(Y),placeholder:e.unref(c)("consumer_groups.consumers.add.consumer_group_placeholder"),readonly:V.value,required:"",width:"100%",onQueryChange:e.unref(w)},null,8,["modelValue","dropdown-footer-text","items","label","loading","placeholder","readonly","onQueryChange"]),I.value||T.value||x.value.length?(e.openBlock(),e.createElementBlock("div",Ve,[e.createVNode(_,{appearance:"danger"},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(e.unref(c)("consumer_groups.errors.add")),1),x.value.length?(e.openBlock(),e.createElementBlock("ul",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(Q,G)=>(e.openBlock(),e.createElementBlock("li",{key:G},e.toDisplayString(Q),1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(I.value||T.value),1)]),_:1})])):e.createCommentVNode("",!0)])]),_:1},8,["action-button-disabled","title","visible"])}}}),ue=(o,U)=>{const c=o.__vccOpts||o;for(const[r,y]of U)c[r]=y;return c},Ee=ue(xe,[["__scopeId","data-v-4260ce03"]]),Ne={class:"kong-ui-entities-consumer-groups-list"},$e={class:"button-row"},Be={class:"empty-state-icon-gateway"},Te=ue(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},enableV2EmptyStates:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success","add:success","remove:success"],setup(o,{emit:U}){var ye;const c=U,r=o,{i18nT:y,i18n:{t:i}}=ce.useI18n(),s=me.useRouter(),{axiosInstance:w}=p.useAxios((ye=r.config)==null?void 0:ye.axiosRequestConfig),Y=e.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),S={name:{label:i("consumer_groups.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1}};r.config.app==="kongManager"&&(S.consumers_count={label:i("consumer_groups.list.table_headers.consumers_count"),searchable:!1,sortable:!1}),S.tags={label:i("consumer_groups.list.table_headers.tags"),sortable:!1};const v=S,ee=n=>({"data-testid":n.username??n.custom_id??n.id}),j=()=>{r.config.consumerId?u():s.push(r.config.createRoute)},T=e.computed(()=>{var m,h,b,O;let n=`${r.config.apiBaseUrl}${q.list[r.config.app][V.value?"forConsumer":"all"]}`;return r.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||"").replace(/{consumerId}/gi,((h=r.config)==null?void 0:h.consumerId)||""):r.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(b=r.config)!=null&&b.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((O=r.config)==null?void 0:O.consumerId)||"")),n}),M=e.ref(""),z=e.computed(()=>{const n=r.config.app==="konnect"||r.config.isExactMatch;return n?{isExactMatch:n,fields:{username:S.name,id:{label:i("consumer_groups.list.table_headers.id")}},placeholder:i("consumer_groups.search.placeholder")}:{isExactMatch:n,fields:{name:S.name},schema:r.config.filterSchema}}),{hasRecords:L,handleStateChange:J}=p.useTableState(M),oe=e.computed(()=>L.value&&r.config.app==="konnect"),F=e.computed(()=>!r.enableV2EmptyStates&&r.config.app==="konnect"),V=e.computed(()=>!!r.config.consumerId),I=e.computed(()=>V.value?"kong-ui-entities-consumer-groups-list-in-consumer-page":"kong-ui-entities-consumer-groups-list"),te=e.computed(()=>r.config.app==="konnect"&&M.value?"consumer_group":V.value&&!r.config.paginatedEndpoint?"consumer_groups":void 0),{fetcher:re,fetcherState:ne,fetcherCacheKey:x}=p.useFetcher({...r.config,cacheIdentifier:r.cacheIdentifier},T.value,te),W=()=>{M.value=""},R=()=>{x.value++},d=e.ref(null),k=(n,m)=>{const h=n.id;if(!m(h)){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:h})})},f=(n,m)=>{const h=JSON.stringify(n);if(!m(h)){c("copy:error",{entity:n,message:i("consumer_groups.errors.copy")});return}c("copy:success",{entity:n,message:i("consumer_groups.copy.success_brief")})},_=async n=>{var h;await((h=r.canRetrieve)==null?void 0:h.call(r,n))&&s.push(r.config.getViewRoute(n.id))},K=n=>({label:i("consumer_groups.actions.view"),to:r.config.getViewRoute(n)}),Q=n=>({label:i("consumer_groups.actions.edit"),to:r.config.getEditRoute(n)}),G=e.ref(void 0),X=e.ref(!1),H=e.ref(!1),se=e.ref(""),ie=p.useDeleteUrlBuilder(r.config,T.value),t=n=>{G.value=n,X.value=!0},a=()=>{X.value=!1},C=async()=>{var n,m,h;if((n=G.value)!=null&&n.id){H.value=!0;try{await w.delete(ie(G.value.id)),H.value=!1,X.value=!1,x.value++,c("delete:success",G.value)}catch(b){se.value=((h=(m=b.response)==null?void 0:m.data)==null?void 0:h.message)||b.message||i("consumer_groups.errors.delete"),c("error",b)}finally{H.value=!1}}},l=e.ref(!1),u=()=>{l.value=!0},N=()=>{l.value=!1},A=(n,m)=>{m||N(),x.value++,c("add:success",n)},E=()=>{V.value&&u()},B=e.ref(void 0),Z=e.ref(!1),Ke=e.ref(""),Ue=n=>{B.value=n,Z.value=!0},fe=()=>{Z.value=!1,B.value=void 0},Re=e.computed(()=>{var m,h,b,O;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,((h=r.config)==null?void 0:h.consumerId)||""):r.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(b=r.config)!=null&&b.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((O=r.config)==null?void 0:O.consumerId)||"")),n}),ge=e.ref(!1),qe=async()=>{if(B.value){ge.value=!0;try{const n=Re.value.replace(/{consumerGroupId}/gi,B.value.id);await w.delete(n),c("remove:success",B.value),fe(),x.value++}catch(n){Ke.value=n.message||i("consumer_groups.errors.delete"),c("error",n)}finally{ge.value=!1}}};e.watch(ne,n=>{var m,h,b;if(n.status===p.FetcherStatus.Error){d.value={title:i("consumer_groups.errors.general")},(b=(h=(m=n.error)==null?void 0:m.response)==null?void 0:h.data)!=null&&b.message&&(d.value.message=n.error.response.data.message),c("error",n.error);return}d.value=null});const de=e.ref({ctaPath:V.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=V.value?i("consumer_groups.list.empty_state.title_for_consumer"):i("consumer_groups.list.empty_state.title"),de.value.ctaText=V.value?i("consumer_groups.actions.add_to_group"):i("consumer_groups.actions.create"))}),(n,m)=>{const h=e.resolveComponent("KButton"),b=e.resolveComponent("KDropdownItem"),O=e.resolveComponent("KClipboardProvider"),Oe=e.resolveComponent("KPrompt");return e.openBlock(),e.createElementBlock("div",Ne,[e.createVNode(e.unref(p.EntityBaseTable),{"cache-identifier":o.cacheIdentifier,"disable-pagination":V.value&&!o.config.paginatedEndpoint,"disable-sorting":Y.value,"empty-state-options":de.value,"enable-entity-actions":"","error-message":d.value,fetcher:e.unref(re),"fetcher-cache-key":e.unref(x),"pagination-type":"offset","preferences-storage-key":I.value,query:M.value,"row-attributes":ee,"table-headers":e.unref(v),onClearSearchInput:W,"onClick:row":m[4]||(m[4]=g=>_(g)),onEmptyStateCtaClicked:E,onSort:R,onState:e.unref(J)},e.createSlots({"toolbar-filter":e.withCtx(()=>[V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(p.EntityFilter),{key:0,modelValue:M.value,"onUpdate:modelValue":m[0]||(m[0]=g=>M.value=g),config:z.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.createElementVNode("div",$e,[oe.value?(e.openBlock(),e.createBlock(h,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"consumer-groups-learn-more-button",icon:"",onClick:m[1]||(m[1]=g=>n.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(ae.BookIcon),{decorative:""})]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canCreate()},{default:e.withCtx(()=>[e.createVNode(h,{appearance:"primary","data-testid":"toolbar-add-consumer-group",size:o.useActionOutside?"medium":"large",onClick:j},{default:e.withCtx(()=>[e.createVNode(e.unref(ae.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"])]),_:1},8,["auth-function"])])],8,["disabled"]))]),name:e.withCtx(({rowValue:g})=>[e.createElementVNode("b",null,e.toDisplayString(g??"-"),1)]),consumers_count:e.withCtx(({rowValue:g})=>[e.createTextVNode(e.toDisplayString(g??"-"),1)]),tags:e.withCtx(({rowValue:g})=>[e.createVNode(e.unref(p.TableTags),{tags:g},null,8,["tags"])]),actions:e.withCtx(({row:g})=>[e.createVNode(O,null,{default:e.withCtx(({copyToClipboard:le})=>[e.createVNode(b,{"data-testid":"action-entity-copy-id",onClick:je=>k(g,le)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("consumer_groups.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(O,null,{default:e.withCtx(({copyToClipboard:le})=>[e.createVNode(b,{"data-testid":"action-entity-copy-json",onClick:je=>f(g,le)},{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(p.PermissionsWrapper),{"auth-function":()=>o.canRetrieve(g)},{default:e.withCtx(()=>[e.createVNode(b,{"data-testid":"action-entity-view","has-divider":"",item:K(g.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canEdit(g)},{default:e.withCtx(()=>[e.createVNode(b,{"data-testid":"action-entity-edit",item:Q(g.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canDelete(g)},{default:e.withCtx(()=>[e.createVNode(b,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:()=>o.config.consumerId?Ue(g):t(g)},{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"])]),_:2},[!e.unref(L)&&F.value?{name:"outside-actions",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!o.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(h,{appearance:"secondary",class:"open-learning-hub","data-testid":"consumer-groups-learn-more-button",icon:"",onClick:m[2]||(m[2]=g=>n.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(ae.BookIcon),{decorative:""})]),_:1})],8,["disabled"]))]),key:"0"}:void 0,!M.value&&o.enableV2EmptyStates&&o.config.app==="konnect"?{name:"empty-state",fn:e.withCtx(()=>{var g;return[e.createVNode(e.unref(p.EntityEmptyState),{"action-button-text":e.unref(i)("consumer_groups.list.toolbar_actions.new_consumer_group"),appearance:"secondary","can-create":()=>o.canCreate(),"data-testid":"consumer-groups-entity-empty-state",description:e.unref(i)("consumer_groups.list.empty_state_v2.description"),"learn-more":o.config.app==="konnect",title:e.unref(i)("consumer_groups.list.empty_state_v2.title"),"onClick:create":j,"onClick:learnMore":m[3]||(m[3]=le=>n.$emit("click:learn-more"))},e.createSlots({image:e.withCtx(()=>[e.createElementVNode("div",Be,[e.createVNode(e.unref(ae.TeamIcon),{color:e.unref(he),size:e.unref(_e)},null,8,["color","size"])])]),_:2},[(g=o.config)!=null&&g.isControlPlaneGroup?{name:"message",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("consumer_groups.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["action-button-text","can-create","description","learn-more","title"])]}),key:"1"}:void 0]),1032,["cache-identifier","disable-pagination","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","preferences-storage-key","query","table-headers","onState"]),e.createVNode(e.unref(p.EntityDeleteModal),{"action-pending":H.value,"data-testid":"delete-consumer-group-modal",description:e.unref(i)("consumer_groups.delete.description"),"entity-name":G.value&&(G.value.name||G.value.id),"entity-type":e.unref(p.EntityTypes).ConsumerGroup,error:se.value,title:e.unref(i)("consumer_groups.delete.title"),visible:X.value,onCancel:a,onProceed:C},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:l.value,"onAdd:partialSuccess":m[5]||(m[5]=g=>A(g,!0)),"onAdd:success":m[6]||(m[6]=g=>A(g)),onCancel:N},null,8,["config","visible"])):e.createCommentVNode("",!0),o.config.consumerId&&B.value?(e.openBlock(),e.createBlock(Oe,{key:1,"action-button-appearance":"danger","data-testid":"exit-group-modal",title:e.unref(i)("consumer_groups.consumers.exit.title"),visible:Z.value,onCancel:fe,onProceed:qe},{default:e.withCtx(()=>[e.createVNode(e.unref(y),{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(B.value.name||B.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-67b47a6f"]]),Me={class:"kong-ui-entities-consumer-group-form"},Ge={class:"select-item-container"},Ae={class:"select-item-label"},De={key:0,class:"select-item-description"},Pe=ue(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:""}},emits:["update","error","loading"],setup(o,{emit:U}){var H,se,ie;const c=o,r=U,{i18n:{t:y}}=ce.useI18n(),i=me.useRouter(),s=e.reactive({fields:{name:"",tags:"",consumers:[]},errorMessage:"",readonly:!1}),w=e.reactive({name:"",tags:"",consumers:[]}),{debouncedQueryChange:Y,loading:S,error:v,loadItems:ee,results:j}=p.useDebouncedFilter(c.config,(se=q.form[(H=c.config)==null?void 0:H.app])==null?void 0:se.consumersList,"",{fetchedItemsKey:"data",searchKeys:["username","custom_id","id"]}),{axiosInstance:T}=p.useAxios((ie=c.config)==null?void 0:ie.axiosRequestConfig),{getMessageFromError:M}=p.useErrors(),z=p.useValidators(),L=e.computed(()=>j.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}),oe=e.computed(()=>c.consumerGroupId?p.EntityBaseFormType.Edit:p.EntityBaseFormType.Create),F=e.computed(()=>!!s.fields.name&&!W.value),V=e.computed(()=>JSON.stringify(s.fields)!==JSON.stringify(w)),I=(t,a="",C="")=>{var u,N,A,E,B,Z;let l=`${(u=c.config)==null?void 0:u.apiBaseUrl}${q.form[(N=c.config)==null?void 0:N.app][t]}`;return((A=c.config)==null?void 0:A.app)==="konnect"?l=l.replace(/{controlPlaneId}/gi,((E=c.config)==null?void 0:E.controlPlaneId)||""):((B=c.config)==null?void 0:B.app)==="kongManager"&&(l=l.replace(/\/{workspace}/gi,(Z=c.config)!=null&&Z.workspace?`/${c.config.workspace}`:"")),l=l.replace(/{id}/gi,a||c.consumerGroupId),(t==="addConsumer"||t==="removeConsumer")&&(l=l.replace(/{consumerId}/gi,C)),l},te=()=>{var t;i.push(((t=c.config)==null?void 0:t.cancelRoute)||{name:"consumer-group-list"})},re=t=>{r("error",t)},ne=t=>{r("loading",t)},x=async t=>{var C,l,u,N,A;s.fields.name=((C=t==null?void 0:t.item)==null?void 0:C.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=((N=t==null?void 0:t.consumers)==null?void 0:N.map(E=>E.id))||[];else try{const{data:E}=await T.get(I("getConsumers"));s.fields.consumers="consumers"in E?(A=E==null?void 0:E.consumers)==null?void 0:A.map(B=>B.id):[]}catch(E){f(E)}Object.assign(w,s.fields)},W=e.computed(()=>z.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(C=>String(C||"").trim()))==null?void 0:a.filter(C=>C!=="")}}),d=async(t,a="")=>await T.post(I("addConsumer",a,t),{consumer:t}),k=async(t,a="")=>await T.delete(I("removeConsumer",a,t)),f=t=>{s.errorMessage=M(t),r("error",t)},_=(t=c.consumerGroupId)=>{Object.assign(w,s.fields),r("update",{...s.fields,id:t})},K=(t,a,C=c.consumerGroupId)=>{const l=t==null?void 0:t.find(u=>u.status!=="fulfilled");l?f({code:l.status,message:a}):_(C)},Q=async()=>{let t="";try{const{data:a}=await T.post(I("create"),R.value);t="item"in a?a.item.id:a.id}catch(a){f(a)}if(s.fields.consumers.length>0&&t)try{const a=s.fields.consumers.map(l=>d(l,t)),C=await Promise.allSettled(a);K(C,y("consumer_groups.errors.add_consumer"),t)}catch(a){f(a)}else s.fields.consumers.length===0&&t&&_(t)},G=async()=>{var C;try{((C=c.config)==null?void 0:C.app)==="konnect"?await T.put(I("edit"),R.value):await T.patch(I("edit"),R.value)}catch(l){f(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)_();else{if(a.length>0)try{const l=a.map(N=>k(N)),u=await Promise.allSettled(l);K(u,y("consumer_groups.errors.remove_consumer"))}catch(l){f(l)}if(t.length>0)try{const l=t.map(N=>d(N)),u=await Promise.allSettled(l);K(u,y("consumer_groups.errors.add_consumer"))}catch(l){f(l)}}},X=async()=>{try{s.readonly=!0,oe.value===p.EntityBaseFormType.Create?await Q():await G()}finally{s.readonly=!1}};return e.onBeforeMount(async()=>{await ee()}),(t,a)=>{const C=e.resolveComponent("KInput"),l=e.resolveComponent("KMultiselect");return e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(e.unref(p.EntityBaseForm),{"can-submit":F.value&&V.value,config:o.config,"edit-id":o.consumerGroupId,"entity-type":e.unref(p.SupportedEntityType).ConsumerGroup,"error-message":s.errorMessage||e.unref(v)||W.value,"fetch-url":J.value,"form-fields":R.value,"is-readonly":s.readonly,onCancel:te,"onFetch:error":a[3]||(a[3]=u=>re(u)),"onFetch:success":x,onLoading:a[4]||(a[4]=u=>ne(u)),onSubmit:X},{default:e.withCtx(()=>[e.createVNode(e.unref(p.EntityFormSection),{description:e.unref(y)("consumer_groups.form.general_info.description"),title:e.unref(y)("consumer_groups.form.general_info.title")},{default:e.withCtx(()=>[e.createVNode(C,{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(y)("consumer_groups.form.fields.name.label"),placeholder:e.unref(y)("consumer_groups.form.fields.name.placeholder"),required:"",type:"text"},null,8,["modelValue","label","placeholder"]),e.createVNode(C,{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(y)("consumer_groups.form.fields.tags.help"),label:e.unref(y)("consumer_groups.form.fields.tags.label"),"label-attributes":{info:e.unref(y)("consumer_groups.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(y)("consumer_groups.form.fields.tags.placeholder"),type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder"])]),_:1},8,["description","title"]),e.createVNode(e.unref(p.EntityFormSection),{description:e.unref(y)("consumer_groups.form.consumers.description"),"has-divider":"",title:e.unref(y)("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:L.value,label:e.unref(y)("consumer_groups.form.fields.consumers.label"),loading:e.unref(S),placeholder:e.unref(y)("consumer_groups.form.fields.consumers.placeholder"),width:"auto",onQueryChange:e.unref(Y)},{"item-template":e.withCtx(({item:u})=>{var N,A,E;return[e.createElementVNode("div",Ge,[e.createElementVNode("div",Ae,e.toDisplayString(u.label),1),(N=u==null?void 0:u.data)!=null&&N.username&&((A=u==null?void 0:u.data)!=null&&A.custom_id)?(e.openBlock(),e.createElementBlock("div",De,e.toDisplayString((E=u==null?void 0:u.data)==null?void 0:E.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","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-ba631513"]]),Se={class:"kong-ui-consumer-group-entity-config-card"},Fe=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}},emits:["loading","fetch:error","fetch:success"],setup(o){const U=o,{i18n:{t:c}}=ce.useI18n(),r=e.computed(()=>q.form[U.config.app].edit),y=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",Se,[e.createVNode(e.unref(p.EntityBaseConfigCard),{config:o.config,"config-card-doc":o.configCardDoc,"config-schema":y.value,"data-key":"consumer_group","entity-type":e.unref(p.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","entity-type","fetch-url","hide-title"])]))}});$.ConsumerGroupConfigCard=Fe,$.ConsumerGroupForm=Pe,$.ConsumerGroupList=Te,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.config-card-fieldset[data-v-f7096c33]{border:solid 1px #e0e4ea;border-radius:4px;margin-bottom:8px;margin-top:4px}.config-card-fieldset-title[data-v-f7096c33]{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-761f7e64]{align-items:center;border-bottom:var(--3ccdd5d2);box-sizing:border-box;display:var(--4b1da305);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-761f7e64]{box-sizing:border-box;padding-right:16px;width:var(--cd20788a)}.config-card-details-row .config-card-details-label label[data-v-761f7e64]{color:#3a3f51;display:inline-flex;max-width:100%}.config-card-details-row .config-card-details-label label .label-content[data-v-761f7e64]{line-height:initial;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-label label .k-popover[data-v-761f7e64]{min-width:0}.config-card-details-row .config-card-details-value[data-v-761f7e64]{box-sizing:border-box;width:var(--cd1becd4)}.config-card-details-row .config-card-details-value .truncated[data-v-761f7e64]{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-761f7e64]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-761f7e64] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-761f7e64]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-761f7e64]{margin-right:4px}.config-card-details-row[data-v-761f7e64] .k-label{margin-bottom:0}.config-card-details-row[data-v-761f7e64] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-761f7e64] .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(--54aebfa2);overflow:hidden!important;text-align:left;text-overflow:ellipsis;white-space:nowrap}.config-card-prop-section-title[data-v-d67757a9]{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-be491a0e]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-be491a0e]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-be491a0e]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-be491a0e] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-be491a0e]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-18af080f]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form[data-v-18af080f] .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-18af080f] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-18af080f] .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-18af080f] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.form-actions[data-v-18af080f]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.form-actions[data-v-18af080f] .k-button:last-of-type,.form-actions[data-v-18af080f] .k-button:nth-last-of-type(2){margin-left:16px}.content-wrapper[data-v-b252463e] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-d58db70c]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-d58db70c]{margin-left:auto}.kong-ui-entity-base-table .hidden[data-v-d58db70c]{display:none}.kong-ui-entity-base-table[data-v-d58db70c] .empty-state-icon-gateway{background-color:#ecfcff;border-radius:4px;padding:8px}.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-10fa27a5]{width:100%}.kong-ui-entity-filter-clear[data-v-10fa27a5]{cursor:pointer}.kong-ui-entity-filter[data-v-10fa27a5]{display:flex;position:relative}.kong-ui-entity-filter[data-v-10fa27a5] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-10fa27a5] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-10fa27a5]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-10fa27a5]{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-10fa27a5]{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-10fa27a5]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-10fa27a5]{color:#232633}.menu-item-expand-icon[data-v-10fa27a5]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-10fa27a5]{transform:rotate(180deg)}.menu-item-indicator[data-v-10fa27a5]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-10fa27a5]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-10fa27a5] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-10fa27a5] .k-input{width:100%}.menu-item-body[data-v-10fa27a5] .k-select-input .input{font-size:12px}.menu-item-body[data-v-10fa27a5] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-10fa27a5]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-10fa27a5]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-10fa27a5]{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-6f25ab21]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-6f25ab21]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-6f25ab21]{display:flex;flex:1}.kong-ui-public-entity-link .entity-link[data-v-6f25ab21] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-6f25ab21]{display:inline-block;font-weight:400;max-width:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kong-ui-public-entity-link .copy-uuid-tooltip[data-v-6f25ab21]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-6f25ab21]{margin-left:2px}.kong-ui-public-entity-empty-state[data-v-48ae9c8c]{align-items:center;background-color:#fff;box-sizing:border-box;display:flex;flex-direction:column;font-family:Inter,Roboto,Helvetica,sans-serif;gap:24px;padding:64px 0;width:100%}@media (min-width: 640px){.kong-ui-public-entity-empty-state[data-v-48ae9c8c]{padding:64px 96px}}.kong-ui-public-entity-empty-state .empty-state-image[data-v-48ae9c8c]{margin-bottom:8px}.kong-ui-public-entity-empty-state .entity-empty-state-content[data-v-48ae9c8c]{align-items:center;display:flex;flex-direction:column;gap:8px;text-align:center;width:100%}.kong-ui-public-entity-empty-state .entity-empty-state-content .entity-empty-state-title h1[data-v-48ae9c8c]{align-items:center;color:#000933;display:flex;font-size:24px;font-weight:700;gap:8px;line-height:32px;margin:0}.kong-ui-public-entity-empty-state .entity-empty-state-content .entity-empty-state-title h1.secondary[data-v-48ae9c8c]{font-size:18px}.kong-ui-public-entity-empty-state .entity-empty-state-description[data-v-48ae9c8c],.kong-ui-public-entity-empty-state .entity-empty-state-pricing[data-v-48ae9c8c]{color:#52596e;font-size:14px;font-weight:400;line-height:20px;max-width:640px}.kong-ui-public-entity-empty-state .entity-empty-state-description p[data-v-48ae9c8c],.kong-ui-public-entity-empty-state .entity-empty-state-pricing p[data-v-48ae9c8c]{margin:0}.kong-ui-public-entity-empty-state .entity-empty-state-pricing[data-v-48ae9c8c]{margin-top:16px}.kong-ui-public-entity-empty-state .entity-empty-state-message[data-v-48ae9c8c]{color:#52596e}.kong-ui-public-entity-empty-state .entity-empty-state-action[data-v-48ae9c8c]{align-items:center;display:flex;gap:12px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container[data-v-48ae9c8c]{display:flex;flex-wrap:wrap;gap:16px;justify-content:space-around;margin-top:8px;width:312px}@media (min-width: 640px){.kong-ui-public-entity-empty-state .entity-empty-state-card-container[data-v-48ae9c8c]{width:640px}}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-48ae9c8c]{background-color:#f9fafb;border:1px solid #e0e4ea;border-radius:6px;color:#afb7c5;gap:8px;height:160px;padding:20px;width:312px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card .feature-icon[data-v-48ae9c8c]{color:#3a3f51;display:flex;margin-bottom:12px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card .feature-icon[data-v-48ae9c8c] .kui-icon{height:20px!important;width:20px!important}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-48ae9c8c] .card-title{font-size:14px;font-weight:600}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-48ae9c8c] .card-content{-webkit-box-orient:vertical;color:#6c7489;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;overflow:hidden}.kong-ui-public-entity-empty-state .entity-empty-state-bottom-container[data-v-48ae9c8c]{border-top:1px solid #e0e4ea;display:flex;flex-direction:column;gap:16px;padding-top:48px;width:100%}@media (min-width: 640px){.kong-ui-public-entity-empty-state .entity-empty-state-bottom-container[data-v-48ae9c8c]{width:640px}}.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}.button-row[data-v-521aa93a]{align-items:center;display:flex;gap:12px}.kong-ui-entities-consumer-groups-list[data-v-521aa93a]{width:100%}.kong-ui-entities-consumer-groups-list .kong-ui-entity-filter-input[data-v-521aa93a]{margin-right:12px}.kong-ui-entities-consumer-groups-list .exit-modal-message[data-v-521aa93a]{margin-top:0}.kong-ui-entities-consumer-group-form[data-v-ba631513]{width:100%}@media screen and (min-width: 1280px){.kong-ui-entities-consumer-group-form[data-v-ba631513] .form-section-wrapper{column-gap:64px}}.kong-ui-entities-consumer-group-form .select-item-container .select-item-label[data-v-ba631513]{font-weight:600}.kong-ui-entities-consumer-group-form .select-item-container .select-item-description[data-v-ba631513]{color:#6c7489;font-size:12px}
|
|
1
|
+
.config-card-fieldset[data-v-f7096c33]{border:solid 1px #e0e4ea;border-radius:4px;margin-bottom:8px;margin-top:4px}.config-card-fieldset-title[data-v-f7096c33]{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-761f7e64]{align-items:center;border-bottom:var(--3ccdd5d2);box-sizing:border-box;display:var(--4b1da305);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-761f7e64]{box-sizing:border-box;padding-right:16px;width:var(--cd20788a)}.config-card-details-row .config-card-details-label label[data-v-761f7e64]{color:#3a3f51;display:inline-flex;max-width:100%}.config-card-details-row .config-card-details-label label .label-content[data-v-761f7e64]{line-height:initial;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-label label .k-popover[data-v-761f7e64]{min-width:0}.config-card-details-row .config-card-details-value[data-v-761f7e64]{box-sizing:border-box;width:var(--cd1becd4)}.config-card-details-row .config-card-details-value .truncated[data-v-761f7e64]{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-761f7e64]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-761f7e64] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-761f7e64]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-761f7e64]{margin-right:4px}.config-card-details-row[data-v-761f7e64] .k-label{margin-bottom:0}.config-card-details-row[data-v-761f7e64] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-761f7e64] .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(--54aebfa2);overflow:hidden!important;text-align:left;text-overflow:ellipsis;white-space:nowrap}.config-card-prop-section-title[data-v-d67757a9]{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-be491a0e]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-be491a0e]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-be491a0e]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-be491a0e] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-be491a0e]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-18af080f]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form[data-v-18af080f] .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-18af080f] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-18af080f] .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-18af080f] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.form-actions[data-v-18af080f]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.form-actions[data-v-18af080f] .k-button:last-of-type,.form-actions[data-v-18af080f] .k-button:nth-last-of-type(2){margin-left:16px}.content-wrapper[data-v-b252463e] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-d58db70c]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-d58db70c]{margin-left:auto}.kong-ui-entity-base-table .hidden[data-v-d58db70c]{display:none}.kong-ui-entity-base-table[data-v-d58db70c] .empty-state-icon-gateway{background-color:#ecfcff;border-radius:4px;padding:8px}.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-10fa27a5]{width:100%}.kong-ui-entity-filter-clear[data-v-10fa27a5]{cursor:pointer}.kong-ui-entity-filter[data-v-10fa27a5]{display:flex;position:relative}.kong-ui-entity-filter[data-v-10fa27a5] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-10fa27a5] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-10fa27a5]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-10fa27a5]{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-10fa27a5]{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-10fa27a5]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-10fa27a5]{color:#232633}.menu-item-expand-icon[data-v-10fa27a5]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-10fa27a5]{transform:rotate(180deg)}.menu-item-indicator[data-v-10fa27a5]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-10fa27a5]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-10fa27a5] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-10fa27a5] .k-input{width:100%}.menu-item-body[data-v-10fa27a5] .k-select-input .input{font-size:12px}.menu-item-body[data-v-10fa27a5] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-10fa27a5]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-10fa27a5]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-10fa27a5]{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-6f25ab21]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-6f25ab21]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-6f25ab21]{display:flex;flex:1}.kong-ui-public-entity-link .entity-link[data-v-6f25ab21] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-6f25ab21]{display:inline-block;font-weight:400;max-width:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kong-ui-public-entity-link .copy-uuid-tooltip[data-v-6f25ab21]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-6f25ab21]{margin-left:2px}.kong-ui-public-entity-empty-state[data-v-48ae9c8c]{align-items:center;background-color:#fff;box-sizing:border-box;display:flex;flex-direction:column;font-family:Inter,Roboto,Helvetica,sans-serif;gap:24px;padding:64px 0;width:100%}@media (min-width: 640px){.kong-ui-public-entity-empty-state[data-v-48ae9c8c]{padding:64px 96px}}.kong-ui-public-entity-empty-state .empty-state-image[data-v-48ae9c8c]{margin-bottom:8px}.kong-ui-public-entity-empty-state .entity-empty-state-content[data-v-48ae9c8c]{align-items:center;display:flex;flex-direction:column;gap:8px;text-align:center;width:100%}.kong-ui-public-entity-empty-state .entity-empty-state-content .entity-empty-state-title h1[data-v-48ae9c8c]{align-items:center;color:#000933;display:flex;font-size:24px;font-weight:700;gap:8px;line-height:32px;margin:0}.kong-ui-public-entity-empty-state .entity-empty-state-content .entity-empty-state-title h1.secondary[data-v-48ae9c8c]{font-size:18px}.kong-ui-public-entity-empty-state .entity-empty-state-description[data-v-48ae9c8c],.kong-ui-public-entity-empty-state .entity-empty-state-pricing[data-v-48ae9c8c]{color:#52596e;font-size:14px;font-weight:400;line-height:20px;max-width:640px}.kong-ui-public-entity-empty-state .entity-empty-state-description p[data-v-48ae9c8c],.kong-ui-public-entity-empty-state .entity-empty-state-pricing p[data-v-48ae9c8c]{margin:0}.kong-ui-public-entity-empty-state .entity-empty-state-pricing[data-v-48ae9c8c]{margin-top:16px}.kong-ui-public-entity-empty-state .entity-empty-state-message[data-v-48ae9c8c]{color:#52596e}.kong-ui-public-entity-empty-state .entity-empty-state-action[data-v-48ae9c8c]{align-items:center;display:flex;gap:12px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container[data-v-48ae9c8c]{display:flex;flex-wrap:wrap;gap:16px;justify-content:space-around;margin-top:8px;width:312px}@media (min-width: 640px){.kong-ui-public-entity-empty-state .entity-empty-state-card-container[data-v-48ae9c8c]{width:640px}}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-48ae9c8c]{background-color:#f9fafb;border:1px solid #e0e4ea;border-radius:6px;color:#afb7c5;gap:8px;height:160px;padding:20px;width:312px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card .feature-icon[data-v-48ae9c8c]{color:#3a3f51;display:flex;margin-bottom:12px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card .feature-icon[data-v-48ae9c8c] .kui-icon{height:20px!important;width:20px!important}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-48ae9c8c] .card-title{font-size:14px;font-weight:600}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-48ae9c8c] .card-content{-webkit-box-orient:vertical;color:#6c7489;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;overflow:hidden}.kong-ui-public-entity-empty-state .entity-empty-state-bottom-container[data-v-48ae9c8c]{border-top:1px solid #e0e4ea;display:flex;flex-direction:column;gap:16px;padding-top:48px;width:100%}@media (min-width: 640px){.kong-ui-public-entity-empty-state .entity-empty-state-bottom-container[data-v-48ae9c8c]{width:640px}}.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}.button-row[data-v-67b47a6f]{align-items:center;display:flex;gap:12px}.kong-ui-entities-consumer-groups-list[data-v-67b47a6f]{width:100%}.kong-ui-entities-consumer-groups-list .kong-ui-entity-filter-input[data-v-67b47a6f]{margin-right:12px}.kong-ui-entities-consumer-groups-list .exit-modal-message[data-v-67b47a6f]{margin-top:0}.kong-ui-entities-consumer-group-form[data-v-ba631513]{width:100%}@media screen and (min-width: 1280px){.kong-ui-entities-consumer-group-form[data-v-ba631513] .form-section-wrapper{column-gap:64px}}.kong-ui-entities-consumer-group-form .select-item-container .select-item-label[data-v-ba631513]{font-weight:600}.kong-ui-entities-consumer-group-form .select-item-container .select-item-description[data-v-ba631513]{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.7.
|
|
3
|
+
"version": "3.7.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-consumer-groups.umd.js",
|
|
6
6
|
"module": "./dist/entities-consumer-groups.es.js",
|
|
@@ -21,37 +21,23 @@
|
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
+
"@kong-ui-public/entities-shared": "workspace:^",
|
|
25
|
+
"@kong-ui-public/i18n": "workspace:^",
|
|
24
26
|
"@kong/icons": "^1.21.2",
|
|
25
27
|
"@kong/kongponents": "^9.21.6",
|
|
26
28
|
"axios": "^1.7.7",
|
|
27
29
|
"vue": ">= 3.3.13 < 4",
|
|
28
|
-
"vue-router": "^4.4.5"
|
|
29
|
-
"@kong-ui-public/i18n": "^2.2.10",
|
|
30
|
-
"@kong-ui-public/entities-shared": "^3.19.3"
|
|
30
|
+
"vue-router": "^4.4.5"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
+
"@kong-ui-public/entities-shared": "^3.19.3",
|
|
34
|
+
"@kong-ui-public/i18n": "^2.2.10",
|
|
33
35
|
"@kong/design-tokens": "1.17.3",
|
|
34
36
|
"@kong/icons": "^1.21.2",
|
|
35
37
|
"@kong/kongponents": "9.21.6",
|
|
36
38
|
"axios": "^1.7.7",
|
|
37
39
|
"vue": "^3.5.13",
|
|
38
|
-
"vue-router": "^4.4.5"
|
|
39
|
-
"@kong-ui-public/entities-shared": "^3.19.3",
|
|
40
|
-
"@kong-ui-public/i18n": "^2.2.10"
|
|
41
|
-
},
|
|
42
|
-
"repository": {
|
|
43
|
-
"type": "git",
|
|
44
|
-
"url": "https://github.com/Kong/public-ui-components.git",
|
|
45
|
-
"directory": "packages/entities/entities-consumer-groups"
|
|
46
|
-
},
|
|
47
|
-
"homepage": "https://github.com/Kong/public-ui-components/tree/main/packages/entities/entities-consumer-groups",
|
|
48
|
-
"author": "Kong, Inc.",
|
|
49
|
-
"license": "Apache-2.0",
|
|
50
|
-
"volta": {
|
|
51
|
-
"extends": "../../../package.json"
|
|
52
|
-
},
|
|
53
|
-
"distSizeChecker": {
|
|
54
|
-
"errorLimit": "500KB"
|
|
40
|
+
"vue-router": "^4.4.5"
|
|
55
41
|
},
|
|
56
42
|
"scripts": {
|
|
57
43
|
"dev": "cross-env USE_SANDBOX=true vite",
|
|
@@ -70,5 +56,20 @@
|
|
|
70
56
|
"test:component:open": "BABEL_ENV=cypress cross-env FORCE_COLOR=1 cypress open --component -b chrome --project '../../../.'",
|
|
71
57
|
"test:unit": "cross-env FORCE_COLOR=1 vitest run",
|
|
72
58
|
"test:unit:open": "cross-env FORCE_COLOR=1 vitest --ui"
|
|
73
|
-
}
|
|
74
|
-
|
|
59
|
+
},
|
|
60
|
+
"repository": {
|
|
61
|
+
"type": "git",
|
|
62
|
+
"url": "https://github.com/Kong/public-ui-components.git",
|
|
63
|
+
"directory": "packages/entities/entities-consumer-groups"
|
|
64
|
+
},
|
|
65
|
+
"homepage": "https://github.com/Kong/public-ui-components/tree/main/packages/entities/entities-consumer-groups",
|
|
66
|
+
"author": "Kong, Inc.",
|
|
67
|
+
"license": "Apache-2.0",
|
|
68
|
+
"volta": {
|
|
69
|
+
"extends": "../../../package.json"
|
|
70
|
+
},
|
|
71
|
+
"distSizeChecker": {
|
|
72
|
+
"errorLimit": "500KB"
|
|
73
|
+
},
|
|
74
|
+
"gitHead": "fb43f17c1677bdc8361d7845e3a019db3899d92d"
|
|
75
|
+
}
|