@kong-ui-public/entities-consumer-groups 3.8.10-pr.2132.9d20c0358.0 → 3.8.10-pr.2132.c7fba69a4.0
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.
|
@@ -165,7 +165,7 @@ const be = {
|
|
|
165
165
|
emits: ["cancel", "add:success", "add:partial-success", "error"],
|
|
166
166
|
setup(e, { emit: L }) {
|
|
167
167
|
var j;
|
|
168
|
-
const { i18n: { t:
|
|
168
|
+
const { i18n: { t: a } } = be.useI18n(), t = e, v = L, { axiosInstance: i } = Ee((j = t.config) == null ? void 0 : j.axiosRequestConfig), n = I([]), {
|
|
169
169
|
debouncedQueryChange: E,
|
|
170
170
|
loading: ie,
|
|
171
171
|
allRecords: D,
|
|
@@ -180,7 +180,7 @@ const be = {
|
|
|
180
180
|
fetchedItemsKey: "data",
|
|
181
181
|
searchKeys: ["name", "id"]
|
|
182
182
|
}
|
|
183
|
-
), V = _(() => le.value ?
|
|
183
|
+
), V = _(() => le.value ? a("consumer_groups.errors.general") : ""), B = I(0), te = _(() => D.value === void 0), Y = _(() => Z.value.map((d) => ({
|
|
184
184
|
label: d.name,
|
|
185
185
|
value: d.id,
|
|
186
186
|
selected: n.value.includes(d.id),
|
|
@@ -205,7 +205,7 @@ const be = {
|
|
|
205
205
|
b.status !== "fulfilled" && (f = !1);
|
|
206
206
|
}), f ? (R.value = [], M.value = [], v("add:success", n.value), n.value = []) : (R.value.length && v("add:partial-success", R.value), n.value = [], re(k));
|
|
207
207
|
} catch {
|
|
208
|
-
x.value =
|
|
208
|
+
x.value = a("consumer_groups.errors.add"), v("error", x.value);
|
|
209
209
|
} finally {
|
|
210
210
|
$.value = !1;
|
|
211
211
|
}
|
|
@@ -222,7 +222,7 @@ const be = {
|
|
|
222
222
|
return R.value.push(d), f;
|
|
223
223
|
} catch (f) {
|
|
224
224
|
let b = `${se(d)} - ${f.message}`;
|
|
225
|
-
return f.response.status === 409 && (b = `${se(d)} - ${
|
|
225
|
+
return f.response.status === 409 && (b = `${se(d)} - ${a("consumer_groups.errors.already_added")}`), Promise.reject(Error(b));
|
|
226
226
|
}
|
|
227
227
|
}, M = I([]), re = (d) => {
|
|
228
228
|
M.value = d.map((k) => {
|
|
@@ -240,24 +240,24 @@ const be = {
|
|
|
240
240
|
"action-button-disabled": $.value,
|
|
241
241
|
class: "kong-ui-entities-add-to-groups-modal",
|
|
242
242
|
"data-testid": "add-to-group-modal",
|
|
243
|
-
title: s(
|
|
243
|
+
title: s(a)("consumer_groups.consumers.add.title"),
|
|
244
244
|
visible: e.visible,
|
|
245
245
|
onCancel: de,
|
|
246
246
|
onProceed: me
|
|
247
247
|
}, {
|
|
248
248
|
default: p(() => [
|
|
249
249
|
F("div", yo, [
|
|
250
|
-
F("p", vo, G(s(
|
|
250
|
+
F("p", vo, G(s(a)("consumer_groups.consumers.add.ctaText")), 1),
|
|
251
251
|
g(f, {
|
|
252
252
|
modelValue: n.value,
|
|
253
253
|
"onUpdate:modelValue": k[0] || (k[0] = (ee) => n.value = ee),
|
|
254
254
|
autosuggest: "",
|
|
255
255
|
"data-testid": "add-to-groups-multiselect",
|
|
256
|
-
"dropdown-footer-text": te.value ? s(
|
|
256
|
+
"dropdown-footer-text": te.value ? s(a)("consumer_groups.consumers.add.footer") : void 0,
|
|
257
257
|
items: Y.value,
|
|
258
|
-
label: s(
|
|
258
|
+
label: s(a)("consumer_groups.consumers.add.consumer_groups_label"),
|
|
259
259
|
loading: s(ie),
|
|
260
|
-
placeholder: s(
|
|
260
|
+
placeholder: s(a)("consumer_groups.consumers.add.consumer_group_placeholder"),
|
|
261
261
|
readonly: $.value,
|
|
262
262
|
required: "",
|
|
263
263
|
width: "100%",
|
|
@@ -266,7 +266,7 @@ const be = {
|
|
|
266
266
|
x.value || V.value || M.value.length ? (A(), J("div", ho, [
|
|
267
267
|
g(b, { appearance: "danger" }, {
|
|
268
268
|
default: p(() => [
|
|
269
|
-
F("p", null, G(s(
|
|
269
|
+
F("p", null, G(s(a)("consumer_groups.errors.add")), 1),
|
|
270
270
|
M.value.length ? (A(), J("ul", _o, [
|
|
271
271
|
(A(!0), J(Le, null, je(M.value, (ee, K) => (A(), J("li", { key: K }, G(ee), 1))), 128))
|
|
272
272
|
])) : W("", !0),
|
|
@@ -282,10 +282,10 @@ const be = {
|
|
|
282
282
|
};
|
|
283
283
|
}
|
|
284
284
|
}), $e = (e, L) => {
|
|
285
|
-
const
|
|
285
|
+
const a = e.__vccOpts || e;
|
|
286
286
|
for (const [t, v] of L)
|
|
287
|
-
|
|
288
|
-
return
|
|
287
|
+
a[t] = v;
|
|
288
|
+
return a;
|
|
289
289
|
}, Co = /* @__PURE__ */ $e(bo, [["__scopeId", "data-v-4260ce03"]]), ko = { class: "kong-ui-entities-consumer-groups-list" }, Io = { class: "button-row" }, wo = { class: "empty-state-icon-gateway" }, Eo = /* @__PURE__ */ _e({
|
|
290
290
|
__name: "ConsumerGroupList",
|
|
291
291
|
props: {
|
|
@@ -341,7 +341,7 @@ 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
|
|
344
|
+
const a = L, t = e, { i18nT: v, i18n: { t: i } } = be.useI18n(), n = Fe(), { axiosInstance: E } = Ee((Se = t.config) == null ? void 0 : Se.axiosRequestConfig), ie = _(() => 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
|
};
|
|
@@ -383,14 +383,14 @@ const be = {
|
|
|
383
383
|
}, d = I(null), k = async (r, m) => {
|
|
384
384
|
const h = r.id;
|
|
385
385
|
if (!await m(h)) {
|
|
386
|
-
|
|
386
|
+
a("copy:error", {
|
|
387
387
|
entity: r,
|
|
388
388
|
field: "id",
|
|
389
389
|
message: i("consumer_groups.errors.copy")
|
|
390
390
|
});
|
|
391
391
|
return;
|
|
392
392
|
}
|
|
393
|
-
|
|
393
|
+
a("copy:success", {
|
|
394
394
|
entity: r,
|
|
395
395
|
field: "id",
|
|
396
396
|
message: i("consumer_groups.copy.success", { val: h })
|
|
@@ -398,13 +398,13 @@ const be = {
|
|
|
398
398
|
}, f = async (r, m) => {
|
|
399
399
|
const h = JSON.stringify(r);
|
|
400
400
|
if (!await m(h)) {
|
|
401
|
-
|
|
401
|
+
a("copy:error", {
|
|
402
402
|
entity: r,
|
|
403
403
|
message: i("consumer_groups.errors.copy")
|
|
404
404
|
});
|
|
405
405
|
return;
|
|
406
406
|
}
|
|
407
|
-
|
|
407
|
+
a("copy:success", {
|
|
408
408
|
entity: r,
|
|
409
409
|
message: i("consumer_groups.copy.success_brief")
|
|
410
410
|
});
|
|
@@ -419,16 +419,16 @@ const be = {
|
|
|
419
419
|
to: t.config.getEditRoute(r)
|
|
420
420
|
}), K = I(void 0), ne = I(!1), oe = I(!1), fe = I(""), ye = Ze(t.config, V.value), o = (r) => {
|
|
421
421
|
K.value = r, ne.value = !0;
|
|
422
|
-
},
|
|
422
|
+
}, u = () => {
|
|
423
423
|
ne.value = !1;
|
|
424
424
|
}, C = async () => {
|
|
425
425
|
var r, m, h;
|
|
426
426
|
if ((r = K.value) != null && r.id) {
|
|
427
427
|
oe.value = !0;
|
|
428
428
|
try {
|
|
429
|
-
await E.delete(ye(K.value.id)), oe.value = !1, ne.value = !1, M.value++,
|
|
429
|
+
await E.delete(ye(K.value.id)), oe.value = !1, ne.value = !1, M.value++, a("delete:success", K.value);
|
|
430
430
|
} catch (w) {
|
|
431
|
-
fe.value = ((h = (m = w.response) == null ? void 0 : m.data) == null ? void 0 : h.message) || w.message || i("consumer_groups.errors.delete"),
|
|
431
|
+
fe.value = ((h = (m = w.response) == null ? void 0 : m.data) == null ? void 0 : h.message) || w.message || i("consumer_groups.errors.delete"), a("error", w);
|
|
432
432
|
} finally {
|
|
433
433
|
oe.value = !1;
|
|
434
434
|
}
|
|
@@ -438,7 +438,7 @@ const be = {
|
|
|
438
438
|
}, T = () => {
|
|
439
439
|
l.value = !1;
|
|
440
440
|
}, U = (r, m) => {
|
|
441
|
-
m || T(), M.value++,
|
|
441
|
+
m || T(), M.value++, a("add:success", r);
|
|
442
442
|
}, S = () => {
|
|
443
443
|
$.value && c();
|
|
444
444
|
}, P = I(void 0), ae = I(!1), Ue = I(""), De = (r) => {
|
|
@@ -454,9 +454,9 @@ const be = {
|
|
|
454
454
|
Me.value = !0;
|
|
455
455
|
try {
|
|
456
456
|
const r = Re.value.replace(/{consumerGroupId}/gi, P.value.id);
|
|
457
|
-
await E.delete(r),
|
|
457
|
+
await E.delete(r), a("remove:success", P.value), xe(), M.value++;
|
|
458
458
|
} catch (r) {
|
|
459
|
-
Ue.value = r.message || i("consumer_groups.errors.delete"),
|
|
459
|
+
Ue.value = r.message || i("consumer_groups.errors.delete"), a("error", r);
|
|
460
460
|
} finally {
|
|
461
461
|
Me.value = !1;
|
|
462
462
|
}
|
|
@@ -467,7 +467,7 @@ const be = {
|
|
|
467
467
|
if (r.status === Ye.Error) {
|
|
468
468
|
d.value = {
|
|
469
469
|
title: i("consumer_groups.errors.general")
|
|
470
|
-
}, (w = (h = (m = r.error) == null ? void 0 : m.response) == null ? void 0 : h.data) != null && w.message && (d.value.message = r.error.response.data.message),
|
|
470
|
+
}, (w = (h = (m = r.error) == null ? void 0 : m.response) == null ? void 0 : h.data) != null && w.message && (d.value.message = r.error.response.data.message), a("error", r.error);
|
|
471
471
|
return;
|
|
472
472
|
}
|
|
473
473
|
d.value = null;
|
|
@@ -705,7 +705,7 @@ const be = {
|
|
|
705
705
|
error: fe.value,
|
|
706
706
|
title: s(i)("consumer_groups.delete.title"),
|
|
707
707
|
visible: ne.value,
|
|
708
|
-
onCancel:
|
|
708
|
+
onCancel: u,
|
|
709
709
|
onProceed: C
|
|
710
710
|
}, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"]),
|
|
711
711
|
e.config.consumerId ? (A(), z(Co, {
|
|
@@ -778,7 +778,7 @@ const be = {
|
|
|
778
778
|
emits: ["update", "error", "loading"],
|
|
779
779
|
setup(e, { emit: L }) {
|
|
780
780
|
var oe, fe, ye;
|
|
781
|
-
const
|
|
781
|
+
const a = e, t = L, { i18n: { t: v } } = be.useI18n(), i = Fe(), n = Ae({
|
|
782
782
|
fields: {
|
|
783
783
|
name: "",
|
|
784
784
|
tags: "",
|
|
@@ -796,25 +796,25 @@ const be = {
|
|
|
796
796
|
error: le,
|
|
797
797
|
loadItems: ce,
|
|
798
798
|
results: Z
|
|
799
|
-
} = Be(
|
|
799
|
+
} = Be(a.config, (fe = X.form[(oe = a.config) == null ? void 0 : oe.app]) == null ? void 0 : fe.consumersList, "", {
|
|
800
800
|
fetchedItemsKey: "data",
|
|
801
801
|
searchKeys: ["username", "custom_id", "id"]
|
|
802
|
-
}), { axiosInstance: V } = Ee((ye =
|
|
802
|
+
}), { axiosInstance: V } = Ee((ye = a.config) == null ? void 0 : ye.axiosRequestConfig), { getMessageFromError: B } = ao(), te = uo(), Y = _(() => Z.value.map((o) => ({
|
|
803
803
|
label: o.username || o.custom_id,
|
|
804
804
|
value: o.id,
|
|
805
805
|
selected: n.fields.consumers.includes(o.id),
|
|
806
806
|
data: o
|
|
807
807
|
// we need this to determine whether or not to show the description text
|
|
808
808
|
}))), se = _(() => {
|
|
809
|
-
var o,
|
|
810
|
-
return (
|
|
811
|
-
}), de = _(() =>
|
|
809
|
+
var o, u;
|
|
810
|
+
return (u = X.form[(o = a.config) == null ? void 0 : o.app]) == null ? void 0 : u.edit;
|
|
811
|
+
}), de = _(() => a.consumerGroupId ? Ie.Edit : Ie.Create), R = _(() => !!n.fields.name && !re.value), $ = _(() => JSON.stringify(n.fields) !== JSON.stringify(E)), x = (o, u = "", C = "") => {
|
|
812
812
|
var c, T, U, S, P, ae;
|
|
813
|
-
let l = `${(c =
|
|
814
|
-
return ((U =
|
|
813
|
+
let l = `${(c = a.config) == null ? void 0 : c.apiBaseUrl}${X.form[(T = a.config) == null ? void 0 : T.app][o]}`;
|
|
814
|
+
return ((U = a.config) == null ? void 0 : U.app) === "konnect" ? l = l.replace(/{controlPlaneId}/gi, ((S = a.config) == null ? void 0 : S.controlPlaneId) || "") : ((P = a.config) == null ? void 0 : P.app) === "kongManager" && (l = l.replace(/\/{workspace}/gi, (ae = a.config) != null && ae.workspace ? `/${a.config.workspace}` : "")), l = l.replace(/{id}/gi, u || a.consumerGroupId), (o === "addConsumer" || o === "removeConsumer") && (l = l.replace(/{consumerId}/gi, C)), l;
|
|
815
815
|
}, me = () => {
|
|
816
816
|
var o;
|
|
817
|
-
i.push(((o =
|
|
817
|
+
i.push(((o = a.config) == null ? void 0 : o.cancelRoute) || { name: "consumer-group-list" });
|
|
818
818
|
}, pe = (o) => {
|
|
819
819
|
t("error", o);
|
|
820
820
|
}, ge = (o) => {
|
|
@@ -822,8 +822,8 @@ const be = {
|
|
|
822
822
|
}, M = async (o) => {
|
|
823
823
|
var C, l, c, T, U;
|
|
824
824
|
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) || "";
|
|
825
|
-
const
|
|
826
|
-
if (n.fields.tags = (
|
|
825
|
+
const u = ((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) || [];
|
|
826
|
+
if (n.fields.tags = (u == null ? void 0 : u.join(", ")) || "", "consumers" in o)
|
|
827
827
|
n.fields.consumers = ((T = o == null ? void 0 : o.consumers) == null ? void 0 : T.map((S) => S.id)) || [];
|
|
828
828
|
else
|
|
829
829
|
try {
|
|
@@ -834,51 +834,51 @@ const be = {
|
|
|
834
834
|
}
|
|
835
835
|
Object.assign(E, n.fields);
|
|
836
836
|
}, re = _(() => te.utf8Name(n.fields.name)), j = _(() => {
|
|
837
|
-
var o,
|
|
837
|
+
var o, u;
|
|
838
838
|
return {
|
|
839
839
|
name: n.fields.name,
|
|
840
|
-
tags: (
|
|
840
|
+
tags: (u = (o = n.fields.tags.split(",")) == null ? void 0 : o.map((C) => String(C || "").trim())) == null ? void 0 : u.filter((C) => C !== "")
|
|
841
841
|
};
|
|
842
|
-
}), d = async (o,
|
|
842
|
+
}), d = async (o, u = "") => await V.post(x("addConsumer", u, o), { consumer: o }), k = async (o, u = "") => await V.delete(x("removeConsumer", u, o)), f = (o) => {
|
|
843
843
|
n.errorMessage = B(o), t("error", o);
|
|
844
|
-
}, b = (o =
|
|
844
|
+
}, b = (o = a.consumerGroupId) => {
|
|
845
845
|
Object.assign(E, n.fields), t("update", { ...n.fields, id: o });
|
|
846
|
-
}, O = (o,
|
|
846
|
+
}, O = (o, u, C = a.consumerGroupId) => {
|
|
847
847
|
const l = o == null ? void 0 : o.find((c) => c.status !== "fulfilled");
|
|
848
848
|
l ? f({
|
|
849
849
|
code: l.status,
|
|
850
|
-
message:
|
|
850
|
+
message: u
|
|
851
851
|
}) : b(C);
|
|
852
852
|
}, ee = async () => {
|
|
853
853
|
let o = "";
|
|
854
854
|
try {
|
|
855
|
-
const { data:
|
|
856
|
-
o = "item" in
|
|
857
|
-
} catch (
|
|
858
|
-
f(
|
|
855
|
+
const { data: u } = await V.post(x("create"), j.value);
|
|
856
|
+
o = "item" in u ? u.item.id : u.id;
|
|
857
|
+
} catch (u) {
|
|
858
|
+
f(u);
|
|
859
859
|
}
|
|
860
860
|
if (n.fields.consumers.length > 0 && o)
|
|
861
861
|
try {
|
|
862
|
-
const
|
|
862
|
+
const u = n.fields.consumers.map((l) => d(l, o)), C = await Promise.allSettled(u);
|
|
863
863
|
O(C, v("consumer_groups.errors.add_consumer"), o);
|
|
864
|
-
} catch (
|
|
865
|
-
f(
|
|
864
|
+
} catch (u) {
|
|
865
|
+
f(u);
|
|
866
866
|
}
|
|
867
867
|
else n.fields.consumers.length === 0 && o && b(o);
|
|
868
868
|
}, K = async () => {
|
|
869
869
|
var C;
|
|
870
870
|
try {
|
|
871
|
-
((C =
|
|
871
|
+
((C = a.config) == null ? void 0 : C.app) === "konnect" ? await V.put(x("edit"), j.value) : await V.patch(x("edit"), j.value);
|
|
872
872
|
} catch (l) {
|
|
873
873
|
f(l);
|
|
874
874
|
}
|
|
875
|
-
const o = n.fields.consumers.filter((l) => !E.consumers.includes(l)),
|
|
876
|
-
if (
|
|
875
|
+
const o = n.fields.consumers.filter((l) => !E.consumers.includes(l)), u = E.consumers.filter((l) => !n.fields.consumers.includes(l));
|
|
876
|
+
if (u.length === 0 && o.length === 0)
|
|
877
877
|
b();
|
|
878
878
|
else {
|
|
879
|
-
if (
|
|
879
|
+
if (u.length > 0)
|
|
880
880
|
try {
|
|
881
|
-
const l =
|
|
881
|
+
const l = u.map((T) => k(T)), c = await Promise.allSettled(l);
|
|
882
882
|
O(c, v("consumer_groups.errors.remove_consumer"));
|
|
883
883
|
} catch (l) {
|
|
884
884
|
f(l);
|
|
@@ -899,8 +899,8 @@ const be = {
|
|
|
899
899
|
}
|
|
900
900
|
};
|
|
901
901
|
return Ve(async () => {
|
|
902
|
-
await ce();
|
|
903
|
-
}), (o,
|
|
902
|
+
a.hideConsumers || await ce();
|
|
903
|
+
}), (o, u) => {
|
|
904
904
|
const C = Q("KInput"), l = Q("KMultiselect");
|
|
905
905
|
return A(), J("div", $o, [
|
|
906
906
|
g(s(io), {
|
|
@@ -913,9 +913,9 @@ const be = {
|
|
|
913
913
|
"form-fields": j.value,
|
|
914
914
|
"is-readonly": n.readonly,
|
|
915
915
|
onCancel: me,
|
|
916
|
-
"onFetch:error":
|
|
916
|
+
"onFetch:error": u[3] || (u[3] = (c) => pe(c)),
|
|
917
917
|
"onFetch:success": M,
|
|
918
|
-
onLoading:
|
|
918
|
+
onLoading: u[4] || (u[4] = (c) => ge(c)),
|
|
919
919
|
onSubmit: ne
|
|
920
920
|
}, {
|
|
921
921
|
default: p(() => [
|
|
@@ -926,7 +926,7 @@ const be = {
|
|
|
926
926
|
default: p(() => [
|
|
927
927
|
g(C, {
|
|
928
928
|
modelValue: n.fields.name,
|
|
929
|
-
"onUpdate:modelValue":
|
|
929
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => n.fields.name = c),
|
|
930
930
|
modelModifiers: { trim: !0 },
|
|
931
931
|
autocomplete: "off",
|
|
932
932
|
"data-testid": "consumer-group-form-name",
|
|
@@ -937,7 +937,7 @@ const be = {
|
|
|
937
937
|
}, null, 8, ["modelValue", "label", "placeholder"]),
|
|
938
938
|
g(C, {
|
|
939
939
|
modelValue: n.fields.tags,
|
|
940
|
-
"onUpdate:modelValue":
|
|
940
|
+
"onUpdate:modelValue": u[1] || (u[1] = (c) => n.fields.tags = c),
|
|
941
941
|
modelModifiers: { trim: !0 },
|
|
942
942
|
autocomplete: "off",
|
|
943
943
|
"data-testid": "consumer-group-form-tags",
|
|
@@ -962,7 +962,7 @@ const be = {
|
|
|
962
962
|
default: p(() => [
|
|
963
963
|
g(l, {
|
|
964
964
|
modelValue: n.fields.consumers,
|
|
965
|
-
"onUpdate:modelValue":
|
|
965
|
+
"onUpdate:modelValue": u[2] || (u[2] = (c) => n.fields.consumers = c),
|
|
966
966
|
appearance: "select",
|
|
967
967
|
autosuggest: "",
|
|
968
968
|
items: Y.value,
|
|
@@ -992,7 +992,7 @@ const be = {
|
|
|
992
992
|
]);
|
|
993
993
|
};
|
|
994
994
|
}
|
|
995
|
-
}), Uo = /* @__PURE__ */ $e(Go, [["__scopeId", "data-v-
|
|
995
|
+
}), Uo = /* @__PURE__ */ $e(Go, [["__scopeId", "data-v-0487fbd2"]]), Ao = { class: "kong-ui-consumer-group-entity-config-card" }, Do = /* @__PURE__ */ _e({
|
|
996
996
|
__name: "ConsumerGroupConfigCard",
|
|
997
997
|
props: {
|
|
998
998
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -1019,13 +1019,13 @@ const be = {
|
|
|
1019
1019
|
},
|
|
1020
1020
|
emits: ["loading", "fetch:error", "fetch:success"],
|
|
1021
1021
|
setup(e) {
|
|
1022
|
-
const L = e, { i18n: { t:
|
|
1022
|
+
const L = e, { i18n: { t: a } } = be.useI18n(), t = _(() => X.form[L.config.app].edit), v = I({
|
|
1023
1023
|
id: {},
|
|
1024
1024
|
name: {},
|
|
1025
1025
|
created_at: {},
|
|
1026
1026
|
updated_at: {},
|
|
1027
1027
|
tags: {
|
|
1028
|
-
tooltip:
|
|
1028
|
+
tooltip: a("consumer_groups.form.fields.tags.tooltip")
|
|
1029
1029
|
}
|
|
1030
1030
|
});
|
|
1031
1031
|
return (i, n) => (A(), J("div", Ao, [
|
|
@@ -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",Ce="24px",_e={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",_e);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(C=>C.id===d):(f=S.value)==null?void 0:f.find(C=>C.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(C=>ne(C)),k=await Promise.allSettled(d);let f=!0;k.forEach(C=>{C.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,C,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,(C=r.config)!=null&&C.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 C=`${J(d)} - ${f.message}`;return f.response.status===409&&(C=`${J(d)} - ${c("consumer_groups.errors.already_added")}`),Promise.reject(Error(C))}},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"),C=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(C,{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(e.computed(()=>({...r.config,cacheIdentifier:r.cacheIdentifier})),T,te),W=()=>{M.value=""},R=()=>{x.value++},d=e.ref(null),k=async(n,m)=>{const h=n.id;if(!await 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=async(n,m)=>{const h=JSON.stringify(n);if(!await 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")})},C=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},_=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=>C(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(Ce)},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:_},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-dbf64903"]]),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:""},hideConsumers:{type:Boolean,default:!1}},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="",_="")=>{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,_)),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 _,l,u,N,A;s.fields.name=((_=t==null?void 0:t.item)==null?void 0:_.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(_=>String(_||"").trim()))==null?void 0:a.filter(_=>_!=="")}}),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)},C=(t=c.consumerGroupId)=>{Object.assign(w,s.fields),r("update",{...s.fields,id:t})},K=(t,a,_=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)),_=await Promise.allSettled(a);K(_,y("consumer_groups.errors.add_consumer"),t)}catch(a){f(a)}else s.fields.consumers.length===0&&t&&C(t)},G=async()=>{var _;try{((_=c.config)==null?void 0:_.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)C();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 _=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(_,{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(_,{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"]),o.hideConsumers?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(p.EntityFormSection),{key:0,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-1e5f8adb"]]),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",Ce="24px",_e={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",_e);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:a}}=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?a("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(C=>C.id===d):(f=S.value)==null?void 0:f.find(C=>C.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(C=>ne(C)),k=await Promise.allSettled(d);let f=!0;k.forEach(C=>{C.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=a("consumer_groups.errors.add"),y("error",I.value)}finally{V.value=!1}},re=e.computed(()=>{var k,f,C,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,(C=r.config)!=null&&C.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 C=`${J(d)} - ${f.message}`;return f.response.status===409&&(C=`${J(d)} - ${a("consumer_groups.errors.already_added")}`),Promise.reject(Error(C))}},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"),C=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(a)("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(a)("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(a)("consumer_groups.consumers.add.footer"):void 0,items:L.value,label:e.unref(a)("consumer_groups.consumers.add.consumer_groups_label"),loading:e.unref(Y),placeholder:e.unref(a)("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(C,{appearance:"danger"},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(e.unref(a)("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 a=o.__vccOpts||o;for(const[r,y]of U)a[r]=y;return a},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 a=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(e.computed(()=>({...r.config,cacheIdentifier:r.cacheIdentifier})),T,te),W=()=>{M.value=""},R=()=>{x.value++},d=e.ref(null),k=async(n,m)=>{const h=n.id;if(!await m(h)){a("copy:error",{entity:n,field:"id",message:i("consumer_groups.errors.copy")});return}a("copy:success",{entity:n,field:"id",message:i("consumer_groups.copy.success",{val:h})})},f=async(n,m)=>{const h=JSON.stringify(n);if(!await m(h)){a("copy:error",{entity:n,message:i("consumer_groups.errors.copy")});return}a("copy:success",{entity:n,message:i("consumer_groups.copy.success_brief")})},C=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},c=()=>{X.value=!1},_=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++,a("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"),a("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++,a("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),a("remove:success",B.value),fe(),x.value++}catch(n){Ke.value=n.message||i("consumer_groups.errors.delete"),a("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),a("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=>C(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(Ce)},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:c,onProceed:_},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-dbf64903"]]),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:""},hideConsumers:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(o,{emit:U}){var H,se,ie;const a=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(a.config,(se=q.form[(H=a.config)==null?void 0:H.app])==null?void 0:se.consumersList,"",{fetchedItemsKey:"data",searchKeys:["username","custom_id","id"]}),{axiosInstance:T}=p.useAxios((ie=a.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,c;return(c=q.form[(t=a.config)==null?void 0:t.app])==null?void 0:c.edit}),oe=e.computed(()=>a.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,c="",_="")=>{var u,N,A,E,B,Z;let l=`${(u=a.config)==null?void 0:u.apiBaseUrl}${q.form[(N=a.config)==null?void 0:N.app][t]}`;return((A=a.config)==null?void 0:A.app)==="konnect"?l=l.replace(/{controlPlaneId}/gi,((E=a.config)==null?void 0:E.controlPlaneId)||""):((B=a.config)==null?void 0:B.app)==="kongManager"&&(l=l.replace(/\/{workspace}/gi,(Z=a.config)!=null&&Z.workspace?`/${a.config.workspace}`:"")),l=l.replace(/{id}/gi,c||a.consumerGroupId),(t==="addConsumer"||t==="removeConsumer")&&(l=l.replace(/{consumerId}/gi,_)),l},te=()=>{var t;i.push(((t=a.config)==null?void 0:t.cancelRoute)||{name:"consumer-group-list"})},re=t=>{r("error",t)},ne=t=>{r("loading",t)},x=async t=>{var _,l,u,N,A;s.fields.name=((_=t==null?void 0:t.item)==null?void 0:_.name)||((l=t==null?void 0:t.consumer_group)==null?void 0:l.name)||(t==null?void 0:t.name)||"";const c=((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=(c==null?void 0:c.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,c;return{name:s.fields.name,tags:(c=(t=s.fields.tags.split(","))==null?void 0:t.map(_=>String(_||"").trim()))==null?void 0:c.filter(_=>_!=="")}}),d=async(t,c="")=>await T.post(I("addConsumer",c,t),{consumer:t}),k=async(t,c="")=>await T.delete(I("removeConsumer",c,t)),f=t=>{s.errorMessage=M(t),r("error",t)},C=(t=a.consumerGroupId)=>{Object.assign(w,s.fields),r("update",{...s.fields,id:t})},K=(t,c,_=a.consumerGroupId)=>{const l=t==null?void 0:t.find(u=>u.status!=="fulfilled");l?f({code:l.status,message:c}):C(_)},Q=async()=>{let t="";try{const{data:c}=await T.post(I("create"),R.value);t="item"in c?c.item.id:c.id}catch(c){f(c)}if(s.fields.consumers.length>0&&t)try{const c=s.fields.consumers.map(l=>d(l,t)),_=await Promise.allSettled(c);K(_,y("consumer_groups.errors.add_consumer"),t)}catch(c){f(c)}else s.fields.consumers.length===0&&t&&C(t)},G=async()=>{var _;try{((_=a.config)==null?void 0:_.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)),c=w.consumers.filter(l=>!s.fields.consumers.includes(l));if(c.length===0&&t.length===0)C();else{if(c.length>0)try{const l=c.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()=>{a.hideConsumers||await ee()}),(t,c)=>{const _=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":c[3]||(c[3]=u=>re(u)),"onFetch:success":x,onLoading:c[4]||(c[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(_,{modelValue:s.fields.name,"onUpdate:modelValue":c[0]||(c[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(_,{modelValue:s.fields.tags,"onUpdate:modelValue":c[1]||(c[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"]),o.hideConsumers?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(p.EntityFormSection),{key:0,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":c[2]||(c[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-0487fbd2"]]),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:a}}=ce.useI18n(),r=e.computed(()=>q.form[U.config.app].edit),y=e.ref({id:{},name:{},created_at:{},updated_at:{},tags:{tooltip:a("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-2feb8c2e] .k-button.navigation-button{font-size:14px;font-weight:400}.config-card-details-row[data-v-5f9aa0e8]{align-items:center;border-bottom:var(--2f90d7f7);box-sizing:border-box;display:var(--668a792a);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-5f9aa0e8]{box-sizing:border-box;padding-right:16px;width:var(--5bc9ad14)}.config-card-details-row .config-card-details-label label[data-v-5f9aa0e8]{color:#3a3f51;display:inline-flex;max-width:100%}.config-card-details-row .config-card-details-label label .label-content[data-v-5f9aa0e8]{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-5f9aa0e8]{min-width:0}.config-card-details-row .config-card-details-value[data-v-5f9aa0e8]{box-sizing:border-box;width:var(--5bc5215e)}.config-card-details-row .config-card-details-value .truncated[data-v-5f9aa0e8]{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-5f9aa0e8]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-5f9aa0e8] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-5f9aa0e8]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-5f9aa0e8]{margin-right:4px}.config-card-details-row[data-v-5f9aa0e8] .k-label{margin-bottom:0}.config-card-details-row[data-v-5f9aa0e8] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-5f9aa0e8] .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-dd0edd92]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-dd0edd92]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-dd0edd92]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-dd0edd92] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-dd0edd92]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-b073d014]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form[data-v-b073d014] .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-b073d014] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-b073d014] .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-b073d014] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.form-actions[data-v-b073d014]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.form-actions[data-v-b073d014] .k-button:last-of-type,.form-actions[data-v-b073d014] .k-button:nth-last-of-type(2){margin-left:16px}.content-wrapper[data-v-a3a65cac] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-1cdbe476]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-1cdbe476]{margin-left:auto}.kong-ui-entity-base-table .hidden[data-v-1cdbe476]{display:none}.kong-ui-entity-base-table[data-v-1cdbe476] .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-d1bb74d1]{width:100%}.kong-ui-entity-filter-clear[data-v-d1bb74d1]{cursor:pointer}.kong-ui-entity-filter[data-v-d1bb74d1]{display:flex;position:relative}.kong-ui-entity-filter[data-v-d1bb74d1] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-d1bb74d1] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-d1bb74d1]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-d1bb74d1]{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-d1bb74d1]{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-d1bb74d1]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-d1bb74d1]{color:#232633}.menu-item-expand-icon[data-v-d1bb74d1]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-d1bb74d1]{transform:rotate(180deg)}.menu-item-indicator[data-v-d1bb74d1]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-d1bb74d1]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-d1bb74d1] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-d1bb74d1] .k-input{width:100%}.menu-item-body[data-v-d1bb74d1] .k-select-input .input{font-size:12px}.menu-item-body[data-v-d1bb74d1] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-d1bb74d1]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-d1bb74d1]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-d1bb74d1]{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-96efdfa5]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-96efdfa5]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-96efdfa5]{display:flex;flex:1}.kong-ui-public-entity-link .entity-link[data-v-96efdfa5] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-96efdfa5]{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-96efdfa5]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-96efdfa5]{margin-left:2px}.kong-ui-public-entity-empty-state[data-v-b6376b66]{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-b6376b66]{padding:64px 96px}}.kong-ui-public-entity-empty-state .empty-state-image[data-v-b6376b66]{margin-bottom:8px}.kong-ui-public-entity-empty-state .entity-empty-state-content[data-v-b6376b66]{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-b6376b66]{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-b6376b66]{font-size:18px}.kong-ui-public-entity-empty-state .entity-empty-state-description[data-v-b6376b66],.kong-ui-public-entity-empty-state .entity-empty-state-pricing[data-v-b6376b66]{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-b6376b66],.kong-ui-public-entity-empty-state .entity-empty-state-pricing p[data-v-b6376b66]{margin:0}.kong-ui-public-entity-empty-state .entity-empty-state-pricing[data-v-b6376b66]{margin-top:16px}.kong-ui-public-entity-empty-state .entity-empty-state-message[data-v-b6376b66]{color:#52596e}.kong-ui-public-entity-empty-state .entity-empty-state-action[data-v-b6376b66]{align-items:center;display:flex;gap:12px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container[data-v-b6376b66]{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-b6376b66]{width:640px}}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-b6376b66]{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-b6376b66]{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-b6376b66] .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-b6376b66] .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-b6376b66] .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-b6376b66]{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-b6376b66]{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-dbf64903]{align-items:center;display:flex;gap:12px}.kong-ui-entities-consumer-groups-list[data-v-dbf64903]{width:100%}.kong-ui-entities-consumer-groups-list .kong-ui-entity-filter-input[data-v-dbf64903]{margin-right:12px}.kong-ui-entities-consumer-groups-list .exit-modal-message[data-v-dbf64903]{margin-top:0}.kong-ui-entities-consumer-group-form[data-v-1e5f8adb]{width:100%}@media screen and (min-width: 1280px){.kong-ui-entities-consumer-group-form[data-v-1e5f8adb] .form-section-wrapper{column-gap:64px}}.kong-ui-entities-consumer-group-form .select-item-container .select-item-label[data-v-1e5f8adb]{font-weight:600}.kong-ui-entities-consumer-group-form .select-item-container .select-item-description[data-v-1e5f8adb]{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-2feb8c2e] .k-button.navigation-button{font-size:14px;font-weight:400}.config-card-details-row[data-v-5f9aa0e8]{align-items:center;border-bottom:var(--2f90d7f7);box-sizing:border-box;display:var(--668a792a);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-5f9aa0e8]{box-sizing:border-box;padding-right:16px;width:var(--5bc9ad14)}.config-card-details-row .config-card-details-label label[data-v-5f9aa0e8]{color:#3a3f51;display:inline-flex;max-width:100%}.config-card-details-row .config-card-details-label label .label-content[data-v-5f9aa0e8]{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-5f9aa0e8]{min-width:0}.config-card-details-row .config-card-details-value[data-v-5f9aa0e8]{box-sizing:border-box;width:var(--5bc5215e)}.config-card-details-row .config-card-details-value .truncated[data-v-5f9aa0e8]{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-5f9aa0e8]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-5f9aa0e8] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-5f9aa0e8]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-5f9aa0e8]{margin-right:4px}.config-card-details-row[data-v-5f9aa0e8] .k-label{margin-bottom:0}.config-card-details-row[data-v-5f9aa0e8] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-5f9aa0e8] .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-dd0edd92]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-dd0edd92]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-dd0edd92]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-dd0edd92] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-dd0edd92]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-b073d014]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form[data-v-b073d014] .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-b073d014] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-b073d014] .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-b073d014] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.form-actions[data-v-b073d014]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.form-actions[data-v-b073d014] .k-button:last-of-type,.form-actions[data-v-b073d014] .k-button:nth-last-of-type(2){margin-left:16px}.content-wrapper[data-v-a3a65cac] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-1cdbe476]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-1cdbe476]{margin-left:auto}.kong-ui-entity-base-table .hidden[data-v-1cdbe476]{display:none}.kong-ui-entity-base-table[data-v-1cdbe476] .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-d1bb74d1]{width:100%}.kong-ui-entity-filter-clear[data-v-d1bb74d1]{cursor:pointer}.kong-ui-entity-filter[data-v-d1bb74d1]{display:flex;position:relative}.kong-ui-entity-filter[data-v-d1bb74d1] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-d1bb74d1] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-d1bb74d1]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-d1bb74d1]{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-d1bb74d1]{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-d1bb74d1]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-d1bb74d1]{color:#232633}.menu-item-expand-icon[data-v-d1bb74d1]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-d1bb74d1]{transform:rotate(180deg)}.menu-item-indicator[data-v-d1bb74d1]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-d1bb74d1]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-d1bb74d1] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-d1bb74d1] .k-input{width:100%}.menu-item-body[data-v-d1bb74d1] .k-select-input .input{font-size:12px}.menu-item-body[data-v-d1bb74d1] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-d1bb74d1]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-d1bb74d1]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-d1bb74d1]{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-96efdfa5]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-96efdfa5]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-96efdfa5]{display:flex;flex:1}.kong-ui-public-entity-link .entity-link[data-v-96efdfa5] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-96efdfa5]{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-96efdfa5]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-96efdfa5]{margin-left:2px}.kong-ui-public-entity-empty-state[data-v-b6376b66]{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-b6376b66]{padding:64px 96px}}.kong-ui-public-entity-empty-state .empty-state-image[data-v-b6376b66]{margin-bottom:8px}.kong-ui-public-entity-empty-state .entity-empty-state-content[data-v-b6376b66]{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-b6376b66]{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-b6376b66]{font-size:18px}.kong-ui-public-entity-empty-state .entity-empty-state-description[data-v-b6376b66],.kong-ui-public-entity-empty-state .entity-empty-state-pricing[data-v-b6376b66]{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-b6376b66],.kong-ui-public-entity-empty-state .entity-empty-state-pricing p[data-v-b6376b66]{margin:0}.kong-ui-public-entity-empty-state .entity-empty-state-pricing[data-v-b6376b66]{margin-top:16px}.kong-ui-public-entity-empty-state .entity-empty-state-message[data-v-b6376b66]{color:#52596e}.kong-ui-public-entity-empty-state .entity-empty-state-action[data-v-b6376b66]{align-items:center;display:flex;gap:12px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container[data-v-b6376b66]{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-b6376b66]{width:640px}}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-b6376b66]{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-b6376b66]{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-b6376b66] .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-b6376b66] .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-b6376b66] .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-b6376b66]{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-b6376b66]{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-dbf64903]{align-items:center;display:flex;gap:12px}.kong-ui-entities-consumer-groups-list[data-v-dbf64903]{width:100%}.kong-ui-entities-consumer-groups-list .kong-ui-entity-filter-input[data-v-dbf64903]{margin-right:12px}.kong-ui-entities-consumer-groups-list .exit-modal-message[data-v-dbf64903]{margin-top:0}.kong-ui-entities-consumer-group-form[data-v-0487fbd2]{width:100%}@media screen and (min-width: 1280px){.kong-ui-entities-consumer-group-form[data-v-0487fbd2] .form-section-wrapper{column-gap:64px}}.kong-ui-entities-consumer-group-form .select-item-container .select-item-label[data-v-0487fbd2]{font-weight:600}.kong-ui-entities-consumer-group-form .select-item-container .select-item-description[data-v-0487fbd2]{color:#6c7489;font-size:12px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsumerGroupForm.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ConsumerGroupForm.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConsumerGroupForm.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ConsumerGroupForm.vue"],"names":[],"mappings":"AAwZA,OAAO,gDAAgD,CAAA;AAEvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAEnC,OAAO,KAAK,EAMV,kCAAkC,EAClC,8BAA8B,EAAE,iBAAiB,EAClD,MAAM,UAAU,CAAA;AAIjB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;;IAuiBrC,oHAAoH;;cAElG,QAAQ,CAAC,8BAA8B,GAAG,kCAAkC,CAAC;;4BAEzE,8BAA8B,GAAG,kCAAkC,KAAG,OAAO;;IAQnG,kGAAkG;;;;;;;;;;;;;;;IAZlG,oHAAoH;;cAElG,QAAQ,CAAC,8BAA8B,GAAG,kCAAkC,CAAC;;4BAEzE,8BAA8B,GAAG,kCAAkC,KAAG,OAAO;;IAQnG,kGAAkG;;;;;;;;;;;;;;;;;;AAvBpG,wBAkCG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-consumer-groups",
|
|
3
|
-
"version": "3.8.10-pr.2132.
|
|
3
|
+
"version": "3.8.10-pr.2132.c7fba69a4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-consumer-groups.umd.js",
|
|
6
6
|
"module": "./dist/entities-consumer-groups.es.js",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"axios": "^1.7.7",
|
|
27
27
|
"vue": ">= 3.3.13 < 4",
|
|
28
28
|
"vue-router": "^4.4.5",
|
|
29
|
-
"@kong-ui-public/
|
|
30
|
-
"@kong-ui-public/
|
|
29
|
+
"@kong-ui-public/entities-shared": "^3.23.1-pr.2132.c7fba69a4.0",
|
|
30
|
+
"@kong-ui-public/i18n": "^2.3.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@kong/design-tokens": "1.17.4",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"axios": "^1.7.7",
|
|
37
37
|
"vue": "^3.5.13",
|
|
38
38
|
"vue-router": "^4.4.5",
|
|
39
|
-
"@kong-ui-public/entities-shared": "^3.23.1-pr.2132.
|
|
39
|
+
"@kong-ui-public/entities-shared": "^3.23.1-pr.2132.c7fba69a4.0",
|
|
40
40
|
"@kong-ui-public/i18n": "^2.3.0"
|
|
41
41
|
},
|
|
42
42
|
"repository": {
|