@kong-ui-public/entities-consumer-groups 3.5.32 → 3.5.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities-consumer-groups.es.js +185 -203
- package/dist/entities-consumer-groups.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/ConsumerGroupConfigCard.vue.d.ts +0 -17
- package/dist/types/components/ConsumerGroupConfigCard.vue.d.ts.map +1 -1
- package/dist/types/components/ConsumerGroupForm.vue.d.ts +0 -17
- package/dist/types/components/ConsumerGroupForm.vue.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as _e, ref as _, computed as I, watch as $e, resolveComponent as F, openBlock as $, createBlock as oe, unref as
|
|
1
|
+
import { defineComponent as _e, ref as _, computed as I, watch as $e, resolveComponent as F, openBlock as $, createBlock as oe, unref as r, withCtx as f, createElementVNode as O, toDisplayString as G, createVNode as y, createElementBlock as j, Fragment as Ke, renderList as Fe, createCommentVNode as ue, onBeforeMount as De, Teleport as Oe, withDirectives as je, createTextVNode as ae, vShow as Le, withModifiers as Qe, createSlots as Je, reactive as Se } from "vue";
|
|
2
2
|
import { useRouter as Be } from "vue-router";
|
|
3
3
|
import { AddIcon as He } from "@kong/icons";
|
|
4
4
|
import { createI18n as ze, i18nTComponent as We } from "@kong-ui-public/i18n";
|
|
5
|
-
import { useAxios as we, useDebouncedFilter as Ue, useFetcher as Xe, useDeleteUrlBuilder as Ye, FetcherStatus as
|
|
5
|
+
import { useAxios as we, useDebouncedFilter as Ue, useFetcher as Xe, useDeleteUrlBuilder as Ye, FetcherStatus as Te, EntityBaseTable as Ze, EntityFilter as eo, PermissionsWrapper as he, EntityDeleteModal as oo, EntityTypes as so, useErrors as to, useValidators as ro, EntityBaseFormType as Ie, EntityBaseForm as no, SupportedEntityType as Ve, EntityFormSection as Pe, EntityBaseConfigCard as ao } from "@kong-ui-public/entities-shared";
|
|
6
6
|
const uo = {
|
|
7
7
|
list: {
|
|
8
8
|
table_headers: {
|
|
@@ -92,11 +92,11 @@ const uo = {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
},
|
|
95
|
+
}, io = {
|
|
96
96
|
consumer_groups: uo
|
|
97
97
|
};
|
|
98
|
-
function
|
|
99
|
-
const e = ze("en-us",
|
|
98
|
+
function lo() {
|
|
99
|
+
const e = ze("en-us", io);
|
|
100
100
|
return {
|
|
101
101
|
i18n: e,
|
|
102
102
|
i18nT: We(e)
|
|
@@ -104,7 +104,7 @@ function io() {
|
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
const be = {
|
|
107
|
-
useI18n:
|
|
107
|
+
useI18n: lo
|
|
108
108
|
}, q = "/v2/control-planes/{controlPlaneId}/core-entities", N = "/{workspace}", X = {
|
|
109
109
|
list: {
|
|
110
110
|
konnect: {
|
|
@@ -160,30 +160,30 @@ const be = {
|
|
|
160
160
|
emits: ["cancel", "add:success", "add:partial-success", "error"],
|
|
161
161
|
setup(e, { emit: L }) {
|
|
162
162
|
var J;
|
|
163
|
-
const { i18n: { t: u } } = be.useI18n(),
|
|
163
|
+
const { i18n: { t: u } } = be.useI18n(), s = e, g = L, { axiosInstance: l } = we((J = s.config) == null ? void 0 : J.axiosRequestConfig), n = _([]), {
|
|
164
164
|
debouncedQueryChange: w,
|
|
165
165
|
loading: Q,
|
|
166
|
-
allRecords:
|
|
167
|
-
error:
|
|
168
|
-
loadItems:
|
|
166
|
+
allRecords: A,
|
|
167
|
+
error: ie,
|
|
168
|
+
loadItems: le,
|
|
169
169
|
results: D
|
|
170
170
|
} = Ue(
|
|
171
|
-
|
|
172
|
-
X.list[
|
|
171
|
+
s.config,
|
|
172
|
+
X.list[s.config.app].forModal,
|
|
173
173
|
"",
|
|
174
174
|
{
|
|
175
175
|
fetchedItemsKey: "data",
|
|
176
176
|
searchKeys: ["name", "id"]
|
|
177
177
|
}
|
|
178
|
-
), K = I(() =>
|
|
178
|
+
), K = I(() => ie.value ? u("consumer_groups.errors.general") : ""), ce = _(0), Y = I(() => A.value === void 0), B = I(() => D.value.map((p) => ({
|
|
179
179
|
label: p.name,
|
|
180
180
|
value: p.id,
|
|
181
181
|
selected: n.value.includes(p.id),
|
|
182
182
|
data: p
|
|
183
183
|
// we need this to determine whether or not to show the description text
|
|
184
|
-
}))),
|
|
184
|
+
}))), se = (p) => {
|
|
185
185
|
var d;
|
|
186
|
-
const k = Y.value ? D.value.find((h) => h.id === p) : (d =
|
|
186
|
+
const k = Y.value ? D.value.find((h) => h.id === p) : (d = A.value) == null ? void 0 : d.find((h) => h.id === p);
|
|
187
187
|
return k ? k.name : p;
|
|
188
188
|
}, de = () => {
|
|
189
189
|
E.value = "", U.value = [], P.value = [], g("cancel");
|
|
@@ -205,19 +205,19 @@ const be = {
|
|
|
205
205
|
H.value = !1;
|
|
206
206
|
}
|
|
207
207
|
}, z = I(() => {
|
|
208
|
-
var k, d, h,
|
|
209
|
-
let p = `${
|
|
210
|
-
return
|
|
208
|
+
var k, d, h, T;
|
|
209
|
+
let p = `${s.config.apiBaseUrl}${X.list[s.config.app].forConsumer}`;
|
|
210
|
+
return s.config.app === "konnect" ? p = p.replace(/{controlPlaneId}/gi, ((k = s.config) == null ? void 0 : k.controlPlaneId) || "").replace(/{consumerId}/gi, ((d = s.config) == null ? void 0 : d.consumerId) || "") : s.config.app === "kongManager" && (p = p.replace(/\/{workspace}/gi, (h = s.config) != null && h.workspace ? `/${s.config.workspace}` : "").replace(/{consumerId}/gi, ((T = s.config) == null ? void 0 : T.consumerId) || "")), p;
|
|
211
211
|
}), Z = async (p) => {
|
|
212
212
|
const k = {
|
|
213
213
|
group: p
|
|
214
214
|
};
|
|
215
215
|
try {
|
|
216
|
-
const d = await
|
|
216
|
+
const d = await l.post(z.value, k);
|
|
217
217
|
return U.value.push(p), d;
|
|
218
218
|
} catch (d) {
|
|
219
|
-
let h = `${
|
|
220
|
-
return d.response.status === 409 && (h = `${
|
|
219
|
+
let h = `${se(p)} - ${d.message}`;
|
|
220
|
+
return d.response.status === 409 && (h = `${se(p)} - ${u("consumer_groups.errors.already_added")}`), Promise.reject(Error(h));
|
|
221
221
|
}
|
|
222
222
|
}, P = _([]), te = (p) => {
|
|
223
223
|
P.value = p.map((k) => {
|
|
@@ -227,41 +227,41 @@ const be = {
|
|
|
227
227
|
};
|
|
228
228
|
return $e(B, () => {
|
|
229
229
|
ce.value++;
|
|
230
|
-
}, { immediate: !0, deep: !0 }), $e(() =>
|
|
231
|
-
|
|
230
|
+
}, { immediate: !0, deep: !0 }), $e(() => s.visible, () => {
|
|
231
|
+
s.visible && le();
|
|
232
232
|
}, { immediate: !0 }), (p, k) => {
|
|
233
|
-
const d = F("KMultiselect"), h = F("KAlert"),
|
|
234
|
-
return $(), oe(
|
|
233
|
+
const d = F("KMultiselect"), h = F("KAlert"), T = F("KPrompt");
|
|
234
|
+
return $(), oe(T, {
|
|
235
235
|
"action-button-disabled": H.value,
|
|
236
236
|
class: "kong-ui-entities-add-to-groups-modal",
|
|
237
237
|
"data-testid": "add-to-group-modal",
|
|
238
|
-
title:
|
|
238
|
+
title: r(u)("consumer_groups.consumers.add.title"),
|
|
239
239
|
visible: e.visible,
|
|
240
240
|
onCancel: de,
|
|
241
241
|
onProceed: me
|
|
242
242
|
}, {
|
|
243
243
|
default: f(() => [
|
|
244
244
|
O("div", co, [
|
|
245
|
-
O("p", mo, G(
|
|
245
|
+
O("p", mo, G(r(u)("consumer_groups.consumers.add.ctaText")), 1),
|
|
246
246
|
y(d, {
|
|
247
247
|
modelValue: n.value,
|
|
248
248
|
"onUpdate:modelValue": k[0] || (k[0] = (W) => n.value = W),
|
|
249
249
|
autosuggest: "",
|
|
250
250
|
"data-testid": "add-to-groups-multiselect",
|
|
251
|
-
"dropdown-footer-text": Y.value ?
|
|
251
|
+
"dropdown-footer-text": Y.value ? r(u)("consumer_groups.consumers.add.footer") : void 0,
|
|
252
252
|
items: B.value,
|
|
253
|
-
label:
|
|
254
|
-
loading:
|
|
255
|
-
placeholder:
|
|
253
|
+
label: r(u)("consumer_groups.consumers.add.consumer_groups_label"),
|
|
254
|
+
loading: r(Q),
|
|
255
|
+
placeholder: r(u)("consumer_groups.consumers.add.consumer_group_placeholder"),
|
|
256
256
|
readonly: H.value,
|
|
257
257
|
required: "",
|
|
258
258
|
width: "100%",
|
|
259
|
-
onQueryChange:
|
|
259
|
+
onQueryChange: r(w)
|
|
260
260
|
}, null, 8, ["modelValue", "dropdown-footer-text", "items", "label", "loading", "placeholder", "readonly", "onQueryChange"]),
|
|
261
261
|
E.value || K.value || P.value.length ? ($(), j("div", po, [
|
|
262
262
|
y(h, { appearance: "danger" }, {
|
|
263
263
|
default: f(() => [
|
|
264
|
-
O("p", null, G(
|
|
264
|
+
O("p", null, G(r(u)("consumer_groups.errors.add")), 1),
|
|
265
265
|
P.value.length ? ($(), j("ul", go, [
|
|
266
266
|
($(!0), j(Ke, null, Fe(P.value, (W, pe) => ($(), j("li", { key: pe }, G(W), 1))), 128))
|
|
267
267
|
])) : ue("", !0),
|
|
@@ -278,8 +278,8 @@ const be = {
|
|
|
278
278
|
}
|
|
279
279
|
}), Ee = (e, L) => {
|
|
280
280
|
const u = e.__vccOpts || e;
|
|
281
|
-
for (const [
|
|
282
|
-
u[
|
|
281
|
+
for (const [s, g] of L)
|
|
282
|
+
u[s] = g;
|
|
283
283
|
return u;
|
|
284
284
|
}, vo = /* @__PURE__ */ Ee(fo, [["__scopeId", "data-v-4260ce03"]]), yo = { class: "kong-ui-entities-consumer-groups-list" }, ho = { key: 1 }, _o = /* @__PURE__ */ _e({
|
|
285
285
|
__name: "ConsumerGroupList",
|
|
@@ -328,36 +328,36 @@ const be = {
|
|
|
328
328
|
emits: ["error", "copy:success", "copy:error", "delete:success", "add:success", "remove:success"],
|
|
329
329
|
setup(e, { emit: L }) {
|
|
330
330
|
var Ge;
|
|
331
|
-
const u = L,
|
|
332
|
-
() =>
|
|
333
|
-
),
|
|
331
|
+
const u = L, s = e, { i18nT: g, i18n: { t: l } } = be.useI18n(), n = Be(), { axiosInstance: w } = we((Ge = s.config) == null ? void 0 : Ge.axiosRequestConfig), Q = _(1), A = I(() => !!s.config.consumerId), ie = I(
|
|
332
|
+
() => A.value ? "kong-ui-entities-consumer-groups-list-in-consumer-page" : "kong-ui-entities-consumer-groups-list"
|
|
333
|
+
), le = I(() => s.config.app !== "kongManager" || !!s.config.disableSorting), D = {
|
|
334
334
|
// the Name column is non-hidable
|
|
335
|
-
name: { label:
|
|
335
|
+
name: { label: l("consumer_groups.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 }
|
|
336
336
|
};
|
|
337
|
-
|
|
337
|
+
s.config.app === "kongManager" && (D.consumers_count = { label: l("consumer_groups.list.table_headers.consumers_count"), searchable: !1, sortable: !1 }), D.tags = { label: l("consumer_groups.list.table_headers.tags"), sortable: !1 };
|
|
338
338
|
const K = D, ce = (t) => ({
|
|
339
339
|
"data-testid": t.username ?? t.custom_id ?? t.id
|
|
340
340
|
}), Y = I(() => {
|
|
341
|
-
var m, C,
|
|
342
|
-
let t = `${
|
|
343
|
-
return
|
|
344
|
-
}), B = _(""),
|
|
345
|
-
const t =
|
|
341
|
+
var m, C, S, R;
|
|
342
|
+
let t = `${s.config.apiBaseUrl}${X.list[s.config.app][A.value ? "forConsumer" : "all"]}`;
|
|
343
|
+
return s.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((m = s.config) == null ? void 0 : m.controlPlaneId) || "").replace(/{consumerId}/gi, ((C = s.config) == null ? void 0 : C.consumerId) || "") : s.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (S = s.config) != null && S.workspace ? `/${s.config.workspace}` : "").replace(/{consumerId}/gi, ((R = s.config) == null ? void 0 : R.consumerId) || "")), t;
|
|
344
|
+
}), B = _(""), se = I(() => {
|
|
345
|
+
const t = s.config.app === "konnect" || s.config.isExactMatch;
|
|
346
346
|
return t ? {
|
|
347
347
|
isExactMatch: t,
|
|
348
348
|
fields: {
|
|
349
349
|
username: D.name,
|
|
350
|
-
id: { label:
|
|
350
|
+
id: { label: l("consumer_groups.list.table_headers.id") }
|
|
351
351
|
},
|
|
352
|
-
placeholder:
|
|
352
|
+
placeholder: l("consumer_groups.search.placeholder")
|
|
353
353
|
} : {
|
|
354
354
|
isExactMatch: t,
|
|
355
355
|
fields: {
|
|
356
356
|
name: D.name
|
|
357
357
|
},
|
|
358
|
-
schema:
|
|
358
|
+
schema: s.config.filterSchema
|
|
359
359
|
};
|
|
360
|
-
}), de = I(() =>
|
|
360
|
+
}), de = I(() => s.config.app === "konnect" && B.value ? "consumer_group" : A.value && !s.config.paginatedEndpoint ? "consumer_groups" : void 0), { fetcher: U, fetcherState: H } = Xe(s.config, Y.value, de), E = () => {
|
|
361
361
|
B.value = "";
|
|
362
362
|
}, me = () => {
|
|
363
363
|
Q.value++;
|
|
@@ -367,129 +367,129 @@ const be = {
|
|
|
367
367
|
u("copy:error", {
|
|
368
368
|
entity: t,
|
|
369
369
|
field: "id",
|
|
370
|
-
message:
|
|
370
|
+
message: l("consumer_groups.errors.copy")
|
|
371
371
|
});
|
|
372
372
|
return;
|
|
373
373
|
}
|
|
374
374
|
u("copy:success", {
|
|
375
375
|
entity: t,
|
|
376
376
|
field: "id",
|
|
377
|
-
message:
|
|
377
|
+
message: l("consumer_groups.copy.success", { val: C })
|
|
378
378
|
});
|
|
379
379
|
}, te = (t, m) => {
|
|
380
380
|
const C = JSON.stringify(t);
|
|
381
381
|
if (!m(C)) {
|
|
382
382
|
u("copy:error", {
|
|
383
383
|
entity: t,
|
|
384
|
-
message:
|
|
384
|
+
message: l("consumer_groups.errors.copy")
|
|
385
385
|
});
|
|
386
386
|
return;
|
|
387
387
|
}
|
|
388
388
|
u("copy:success", {
|
|
389
389
|
entity: t,
|
|
390
|
-
message:
|
|
390
|
+
message: l("consumer_groups.copy.success_brief")
|
|
391
391
|
});
|
|
392
392
|
}, J = async (t) => {
|
|
393
393
|
var C;
|
|
394
|
-
await ((C =
|
|
394
|
+
await ((C = s.canRetrieve) == null ? void 0 : C.call(s, t)) && n.push(s.config.getViewRoute(t.id));
|
|
395
395
|
}, p = (t) => ({
|
|
396
|
-
label:
|
|
397
|
-
to:
|
|
396
|
+
label: l("consumer_groups.actions.view"),
|
|
397
|
+
to: s.config.getViewRoute(t)
|
|
398
398
|
}), k = (t) => ({
|
|
399
|
-
label:
|
|
400
|
-
to:
|
|
401
|
-
}), d = _(void 0), h = _(!1),
|
|
399
|
+
label: l("consumer_groups.actions.edit"),
|
|
400
|
+
to: s.config.getEditRoute(t)
|
|
401
|
+
}), d = _(void 0), h = _(!1), T = _(!1), W = _(""), pe = Ye(s.config, Y.value), Ce = (t) => {
|
|
402
402
|
d.value = t, h.value = !0;
|
|
403
403
|
}, fe = () => {
|
|
404
404
|
h.value = !1;
|
|
405
405
|
}, ve = async () => {
|
|
406
406
|
var t, m, C;
|
|
407
407
|
if ((t = d.value) != null && t.id) {
|
|
408
|
-
|
|
408
|
+
T.value = !0;
|
|
409
409
|
try {
|
|
410
|
-
await w.delete(pe(d.value.id)),
|
|
411
|
-
} catch (
|
|
412
|
-
W.value = ((C = (m =
|
|
410
|
+
await w.delete(pe(d.value.id)), T.value = !1, h.value = !1, Q.value++, u("delete:success", d.value);
|
|
411
|
+
} catch (S) {
|
|
412
|
+
W.value = ((C = (m = S.response) == null ? void 0 : m.data) == null ? void 0 : C.message) || S.message || l("consumer_groups.errors.delete"), u("error", S);
|
|
413
413
|
} finally {
|
|
414
|
-
|
|
414
|
+
T.value = !1;
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
},
|
|
418
|
-
|
|
417
|
+
}, re = _(!1), o = () => {
|
|
418
|
+
re.value = !0;
|
|
419
419
|
}, a = () => {
|
|
420
|
-
|
|
420
|
+
re.value = !1;
|
|
421
421
|
}, b = (t, m) => {
|
|
422
422
|
m || a(), Q.value++, u("add:success", t);
|
|
423
423
|
}, c = () => {
|
|
424
|
-
|
|
425
|
-
},
|
|
426
|
-
|
|
424
|
+
A.value && o();
|
|
425
|
+
}, i = _(void 0), x = _(!1), V = _(""), M = (t) => {
|
|
426
|
+
i.value = t, x.value = !0;
|
|
427
427
|
}, ee = () => {
|
|
428
|
-
x.value = !1,
|
|
428
|
+
x.value = !1, i.value = void 0;
|
|
429
429
|
}, ye = I(() => {
|
|
430
|
-
var m, C,
|
|
431
|
-
let t = `${
|
|
432
|
-
return
|
|
430
|
+
var m, C, S, R;
|
|
431
|
+
let t = `${s.config.apiBaseUrl}${X.list[s.config.app].oneForConsumer}`;
|
|
432
|
+
return s.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((m = s.config) == null ? void 0 : m.controlPlaneId) || "").replace(/{consumerId}/gi, ((C = s.config) == null ? void 0 : C.consumerId) || "") : s.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (S = s.config) != null && S.workspace ? `/${s.config.workspace}` : "").replace(/{consumerId}/gi, ((R = s.config) == null ? void 0 : R.consumerId) || "")), t;
|
|
433
433
|
}), xe = _(!1), Re = async () => {
|
|
434
|
-
if (
|
|
434
|
+
if (i.value) {
|
|
435
435
|
xe.value = !0;
|
|
436
436
|
try {
|
|
437
|
-
const t = ye.value.replace(/{consumerGroupId}/gi,
|
|
438
|
-
await w.delete(t), u("remove:success",
|
|
437
|
+
const t = ye.value.replace(/{consumerGroupId}/gi, i.value.id);
|
|
438
|
+
await w.delete(t), u("remove:success", i.value), ee(), Q.value++;
|
|
439
439
|
} catch (t) {
|
|
440
|
-
V.value = t.message ||
|
|
440
|
+
V.value = t.message || l("consumer_groups.errors.delete"), u("error", t);
|
|
441
441
|
} finally {
|
|
442
442
|
xe.value = !1;
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
}, Me = _(!1);
|
|
446
446
|
$e(H, (t) => {
|
|
447
|
-
var m, C,
|
|
448
|
-
if (Array.isArray((m = t == null ? void 0 : t.response) == null ? void 0 : m.data) && (Me.value = t.response.data.length > 0), t.status ===
|
|
447
|
+
var m, C, S, R;
|
|
448
|
+
if (Array.isArray((m = t == null ? void 0 : t.response) == null ? void 0 : m.data) && (Me.value = t.response.data.length > 0), t.status === Te.NoRecords ? Z.value = !0 : Z.value = !1, t.status === Te.Error) {
|
|
449
449
|
z.value = {
|
|
450
|
-
title:
|
|
451
|
-
}, (R = (
|
|
450
|
+
title: l("consumer_groups.errors.general")
|
|
451
|
+
}, (R = (S = (C = t.error) == null ? void 0 : C.response) == null ? void 0 : S.data) != null && R.message && (z.value.message = t.error.response.data.message), u("error", t.error);
|
|
452
452
|
return;
|
|
453
453
|
}
|
|
454
454
|
z.value = null;
|
|
455
455
|
});
|
|
456
456
|
const ke = _({
|
|
457
|
-
ctaPath:
|
|
457
|
+
ctaPath: A.value ? void 0 : s.config.createRoute,
|
|
458
458
|
ctaText: void 0,
|
|
459
|
-
message: `${
|
|
460
|
-
title:
|
|
459
|
+
message: `${l("consumer_groups.list.empty_state.description")}${s.config.additionMessageForEmptyState ? ` ${s.config.additionMessageForEmptyState}` : ""}`,
|
|
460
|
+
title: l("consumer_groups.title")
|
|
461
461
|
});
|
|
462
462
|
return De(async () => {
|
|
463
|
-
await
|
|
463
|
+
await s.canCreate() && (ke.value.title = A.value ? l("consumer_groups.list.empty_state.title_for_consumer") : l("consumer_groups.list.empty_state.title"), ke.value.ctaText = A.value ? l("consumer_groups.actions.add_to_group") : l("consumer_groups.actions.create"));
|
|
464
464
|
}), (t, m) => {
|
|
465
|
-
const C = F("KButton"),
|
|
465
|
+
const C = F("KButton"), S = F("KBadge"), R = F("KTruncate"), ge = F("KDropdownItem"), Ae = F("KClipboardProvider"), qe = F("KPrompt");
|
|
466
466
|
return $(), j("div", yo, [
|
|
467
|
-
y(
|
|
467
|
+
y(r(Ze), {
|
|
468
468
|
"cache-identifier": e.cacheIdentifier,
|
|
469
|
-
"disable-pagination":
|
|
470
|
-
"disable-sorting":
|
|
469
|
+
"disable-pagination": A.value && !e.config.paginatedEndpoint,
|
|
470
|
+
"disable-sorting": le.value,
|
|
471
471
|
"empty-state-options": ke.value,
|
|
472
472
|
"enable-entity-actions": "",
|
|
473
473
|
"error-message": z.value,
|
|
474
|
-
fetcher:
|
|
474
|
+
fetcher: r(U),
|
|
475
475
|
"fetcher-cache-key": Q.value,
|
|
476
476
|
"hide-toolbar": Z.value,
|
|
477
477
|
"pagination-type": "offset",
|
|
478
|
-
"preferences-storage-key":
|
|
478
|
+
"preferences-storage-key": ie.value,
|
|
479
479
|
query: B.value,
|
|
480
480
|
"row-attributes": ce,
|
|
481
|
-
"table-headers":
|
|
481
|
+
"table-headers": r(K),
|
|
482
482
|
onClearSearchInput: E,
|
|
483
483
|
"onClick:row": m[3] || (m[3] = (v) => J(v)),
|
|
484
484
|
onEmptyStateCtaClicked: c,
|
|
485
485
|
onSort: me
|
|
486
486
|
}, {
|
|
487
487
|
"toolbar-filter": f(() => [
|
|
488
|
-
|
|
488
|
+
A.value ? ue("", !0) : ($(), oe(r(eo), {
|
|
489
489
|
key: 0,
|
|
490
490
|
modelValue: B.value,
|
|
491
491
|
"onUpdate:modelValue": m[0] || (m[0] = (v) => B.value = v),
|
|
492
|
-
config:
|
|
492
|
+
config: se.value
|
|
493
493
|
}, null, 8, ["modelValue", "config"]))
|
|
494
494
|
]),
|
|
495
495
|
"toolbar-button": f(() => [
|
|
@@ -497,7 +497,7 @@ const be = {
|
|
|
497
497
|
disabled: !e.useActionOutside,
|
|
498
498
|
to: "#kong-ui-app-page-header-action-button"
|
|
499
499
|
}, [
|
|
500
|
-
y(
|
|
500
|
+
y(r(he), {
|
|
501
501
|
"auth-function": () => e.canCreate()
|
|
502
502
|
}, {
|
|
503
503
|
default: f(() => [
|
|
@@ -509,8 +509,8 @@ const be = {
|
|
|
509
509
|
onClick: m[1] || (m[1] = () => e.config.consumerId ? o() : void 0)
|
|
510
510
|
}, {
|
|
511
511
|
default: f(() => [
|
|
512
|
-
y(
|
|
513
|
-
ae(" " + G(e.config.consumerId ?
|
|
512
|
+
y(r(He)),
|
|
513
|
+
ae(" " + G(e.config.consumerId ? r(l)("consumer_groups.actions.add_to_group") : r(l)("consumer_groups.list.toolbar_actions.new_consumer_group")), 1)
|
|
514
514
|
]),
|
|
515
515
|
_: 1
|
|
516
516
|
}, 8, ["size", "to"]), [
|
|
@@ -530,7 +530,7 @@ const be = {
|
|
|
530
530
|
tags: f(({ rowValue: v }) => [
|
|
531
531
|
(v == null ? void 0 : v.length) > 0 ? ($(), oe(R, { key: 0 }, {
|
|
532
532
|
default: f(() => [
|
|
533
|
-
($(!0), j(Ke, null, Fe(v, (ne) => ($(), oe(
|
|
533
|
+
($(!0), j(Ke, null, Fe(v, (ne) => ($(), oe(S, {
|
|
534
534
|
key: ne,
|
|
535
535
|
onClick: m[2] || (m[2] = Qe(() => {
|
|
536
536
|
}, ["stop"]))
|
|
@@ -545,35 +545,35 @@ const be = {
|
|
|
545
545
|
}, 1024)) : ($(), j("span", ho, "-"))
|
|
546
546
|
]),
|
|
547
547
|
actions: f(({ row: v }) => [
|
|
548
|
-
y(
|
|
548
|
+
y(Ae, null, {
|
|
549
549
|
default: f(({ copyToClipboard: ne }) => [
|
|
550
550
|
y(ge, {
|
|
551
551
|
"data-testid": "action-entity-copy-id",
|
|
552
552
|
onClick: (Ne) => P(v, ne)
|
|
553
553
|
}, {
|
|
554
554
|
default: f(() => [
|
|
555
|
-
ae(G(
|
|
555
|
+
ae(G(r(l)("consumer_groups.actions.copy_id")), 1)
|
|
556
556
|
]),
|
|
557
557
|
_: 2
|
|
558
558
|
}, 1032, ["onClick"])
|
|
559
559
|
]),
|
|
560
560
|
_: 2
|
|
561
561
|
}, 1024),
|
|
562
|
-
y(
|
|
562
|
+
y(Ae, null, {
|
|
563
563
|
default: f(({ copyToClipboard: ne }) => [
|
|
564
564
|
y(ge, {
|
|
565
565
|
"data-testid": "action-entity-copy-json",
|
|
566
566
|
onClick: (Ne) => te(v, ne)
|
|
567
567
|
}, {
|
|
568
568
|
default: f(() => [
|
|
569
|
-
ae(G(
|
|
569
|
+
ae(G(r(l)("consumer_groups.actions.copy_json")), 1)
|
|
570
570
|
]),
|
|
571
571
|
_: 2
|
|
572
572
|
}, 1032, ["onClick"])
|
|
573
573
|
]),
|
|
574
574
|
_: 2
|
|
575
575
|
}, 1024),
|
|
576
|
-
y(
|
|
576
|
+
y(r(he), {
|
|
577
577
|
"auth-function": () => e.canRetrieve(v)
|
|
578
578
|
}, {
|
|
579
579
|
default: f(() => [
|
|
@@ -585,7 +585,7 @@ const be = {
|
|
|
585
585
|
]),
|
|
586
586
|
_: 2
|
|
587
587
|
}, 1032, ["auth-function"]),
|
|
588
|
-
y(
|
|
588
|
+
y(r(he), {
|
|
589
589
|
"auth-function": () => e.canEdit(v)
|
|
590
590
|
}, {
|
|
591
591
|
default: f(() => [
|
|
@@ -596,7 +596,7 @@ const be = {
|
|
|
596
596
|
]),
|
|
597
597
|
_: 2
|
|
598
598
|
}, 1032, ["auth-function"]),
|
|
599
|
-
y(
|
|
599
|
+
y(r(he), {
|
|
600
600
|
"auth-function": () => e.canDelete(v)
|
|
601
601
|
}, {
|
|
602
602
|
default: f(() => [
|
|
@@ -607,7 +607,7 @@ const be = {
|
|
|
607
607
|
onClick: () => e.config.consumerId ? M(v) : Ce(v)
|
|
608
608
|
}, {
|
|
609
609
|
default: f(() => [
|
|
610
|
-
ae(G(e.config.consumerId ?
|
|
610
|
+
ae(G(e.config.consumerId ? r(l)("consumer_groups.actions.exit") : r(l)("consumer_groups.actions.delete")), 1)
|
|
611
611
|
]),
|
|
612
612
|
_: 2
|
|
613
613
|
}, 1032, ["onClick"])
|
|
@@ -617,14 +617,14 @@ const be = {
|
|
|
617
617
|
]),
|
|
618
618
|
_: 1
|
|
619
619
|
}, 8, ["cache-identifier", "disable-pagination", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "hide-toolbar", "preferences-storage-key", "query", "table-headers"]),
|
|
620
|
-
y(
|
|
621
|
-
"action-pending":
|
|
620
|
+
y(r(oo), {
|
|
621
|
+
"action-pending": T.value,
|
|
622
622
|
"data-testid": "delete-consumer-group-modal",
|
|
623
|
-
description:
|
|
623
|
+
description: r(l)("consumer_groups.delete.description"),
|
|
624
624
|
"entity-name": d.value && (d.value.name || d.value.id),
|
|
625
|
-
"entity-type":
|
|
625
|
+
"entity-type": r(so).ConsumerGroup,
|
|
626
626
|
error: W.value,
|
|
627
|
-
title:
|
|
627
|
+
title: r(l)("consumer_groups.delete.title"),
|
|
628
628
|
visible: h.value,
|
|
629
629
|
onCancel: fe,
|
|
630
630
|
onProceed: ve
|
|
@@ -633,28 +633,28 @@ const be = {
|
|
|
633
633
|
key: 0,
|
|
634
634
|
config: e.config,
|
|
635
635
|
"data-testid": "add-to-group-modal",
|
|
636
|
-
visible:
|
|
636
|
+
visible: re.value,
|
|
637
637
|
"onAdd:partialSuccess": m[4] || (m[4] = (v) => b(v, !0)),
|
|
638
638
|
"onAdd:success": m[5] || (m[5] = (v) => b(v)),
|
|
639
639
|
onCancel: a
|
|
640
640
|
}, null, 8, ["config", "visible"])) : ue("", !0),
|
|
641
|
-
e.config.consumerId &&
|
|
641
|
+
e.config.consumerId && i.value ? ($(), oe(qe, {
|
|
642
642
|
key: 1,
|
|
643
643
|
"action-button-appearance": "danger",
|
|
644
644
|
"data-testid": "exit-group-modal",
|
|
645
|
-
title:
|
|
645
|
+
title: r(l)("consumer_groups.consumers.exit.title"),
|
|
646
646
|
visible: x.value,
|
|
647
647
|
onCancel: ee,
|
|
648
648
|
onProceed: Re
|
|
649
649
|
}, {
|
|
650
650
|
default: f(() => [
|
|
651
|
-
y(
|
|
651
|
+
y(r(g), {
|
|
652
652
|
class: "exit-modal-message",
|
|
653
653
|
keypath: e.config.consumerUsername ? "consumer_groups.consumers.exit.confirmation" : "consumer_groups.consumers.exit.confirmationNoUsername",
|
|
654
654
|
tag: "p"
|
|
655
655
|
}, Je({
|
|
656
656
|
consumerGroup: f(() => [
|
|
657
|
-
O("strong", null, G(
|
|
657
|
+
O("strong", null, G(i.value.name || i.value.id), 1)
|
|
658
658
|
]),
|
|
659
659
|
_: 2
|
|
660
660
|
}, [
|
|
@@ -666,14 +666,14 @@ const be = {
|
|
|
666
666
|
key: "0"
|
|
667
667
|
} : void 0
|
|
668
668
|
]), 1032, ["keypath"]),
|
|
669
|
-
O("p", null, G(
|
|
669
|
+
O("p", null, G(r(l)("consumer_groups.consumers.exit.description")), 1)
|
|
670
670
|
]),
|
|
671
671
|
_: 1
|
|
672
672
|
}, 8, ["title", "visible"])) : ue("", !0)
|
|
673
673
|
]);
|
|
674
674
|
};
|
|
675
675
|
}
|
|
676
|
-
}),
|
|
676
|
+
}), So = /* @__PURE__ */ Ee(_o, [["__scopeId", "data-v-8bb72c5a"]]), bo = { class: "kong-ui-entities-consumer-group-form" }, Co = { class: "select-item-container" }, ko = { class: "select-item-label" }, Io = {
|
|
677
677
|
key: 0,
|
|
678
678
|
class: "select-item-description"
|
|
679
679
|
}, $o = /* @__PURE__ */ _e({
|
|
@@ -690,20 +690,12 @@ const be = {
|
|
|
690
690
|
type: String,
|
|
691
691
|
required: !1,
|
|
692
692
|
default: ""
|
|
693
|
-
},
|
|
694
|
-
/**
|
|
695
|
-
* Enable display of Terraform code
|
|
696
|
-
* Guarded by FF: khcp-12445-terraform-config-details
|
|
697
|
-
*/
|
|
698
|
-
enableTerraform: {
|
|
699
|
-
type: Boolean,
|
|
700
|
-
default: !1
|
|
701
693
|
}
|
|
702
694
|
},
|
|
703
695
|
emits: ["update", "error", "loading"],
|
|
704
696
|
setup(e, { emit: L }) {
|
|
705
|
-
var fe, ve,
|
|
706
|
-
const u = e,
|
|
697
|
+
var fe, ve, re;
|
|
698
|
+
const u = e, s = L, { i18n: { t: g } } = be.useI18n(), l = Be(), n = Se({
|
|
707
699
|
fields: {
|
|
708
700
|
name: "",
|
|
709
701
|
tags: "",
|
|
@@ -711,43 +703,43 @@ const be = {
|
|
|
711
703
|
},
|
|
712
704
|
errorMessage: "",
|
|
713
705
|
readonly: !1
|
|
714
|
-
}), w =
|
|
706
|
+
}), w = Se({
|
|
715
707
|
name: "",
|
|
716
708
|
tags: "",
|
|
717
709
|
consumers: []
|
|
718
710
|
}), {
|
|
719
711
|
debouncedQueryChange: Q,
|
|
720
|
-
loading:
|
|
721
|
-
error:
|
|
722
|
-
loadItems:
|
|
712
|
+
loading: A,
|
|
713
|
+
error: ie,
|
|
714
|
+
loadItems: le,
|
|
723
715
|
results: D
|
|
724
716
|
} = Ue(u.config, (ve = X.form[(fe = u.config) == null ? void 0 : fe.app]) == null ? void 0 : ve.consumersList, "", {
|
|
725
717
|
fetchedItemsKey: "data",
|
|
726
718
|
searchKeys: ["username", "custom_id", "id"]
|
|
727
|
-
}), { axiosInstance: K } = we((
|
|
719
|
+
}), { axiosInstance: K } = we((re = u.config) == null ? void 0 : re.axiosRequestConfig), { getMessageFromError: ce } = to(), Y = ro(), B = I(() => D.value.map((o) => ({
|
|
728
720
|
label: o.username || o.custom_id,
|
|
729
721
|
value: o.id,
|
|
730
722
|
selected: n.fields.consumers.includes(o.id),
|
|
731
723
|
data: o
|
|
732
724
|
// we need this to determine whether or not to show the description text
|
|
733
|
-
}))),
|
|
725
|
+
}))), se = I(() => {
|
|
734
726
|
var o, a;
|
|
735
727
|
return (a = X.form[(o = u.config) == null ? void 0 : o.app]) == null ? void 0 : a.edit;
|
|
736
728
|
}), de = I(() => u.consumerGroupId ? Ie.Edit : Ie.Create), U = I(() => !!n.fields.name && !te.value), H = I(() => JSON.stringify(n.fields) !== JSON.stringify(w)), E = (o, a = "", b = "") => {
|
|
737
|
-
var
|
|
738
|
-
let c = `${(
|
|
729
|
+
var i, x, V, M, ee, ye;
|
|
730
|
+
let c = `${(i = u.config) == null ? void 0 : i.apiBaseUrl}${X.form[(x = u.config) == null ? void 0 : x.app][o]}`;
|
|
739
731
|
return ((V = u.config) == null ? void 0 : V.app) === "konnect" ? c = c.replace(/{controlPlaneId}/gi, ((M = u.config) == null ? void 0 : M.controlPlaneId) || "") : ((ee = u.config) == null ? void 0 : ee.app) === "kongManager" && (c = c.replace(/\/{workspace}/gi, (ye = u.config) != null && ye.workspace ? `/${u.config.workspace}` : "")), c = c.replace(/{id}/gi, a || u.consumerGroupId), (o === "addConsumer" || o === "removeConsumer") && (c = c.replace(/{consumerId}/gi, b)), c;
|
|
740
732
|
}, me = () => {
|
|
741
733
|
var o;
|
|
742
|
-
|
|
734
|
+
l.push(((o = u.config) == null ? void 0 : o.cancelRoute) || { name: "consumer-group-list" });
|
|
743
735
|
}, z = (o) => {
|
|
744
|
-
|
|
736
|
+
s("error", o);
|
|
745
737
|
}, Z = (o) => {
|
|
746
|
-
|
|
738
|
+
s("loading", o);
|
|
747
739
|
}, P = async (o) => {
|
|
748
|
-
var b, c,
|
|
740
|
+
var b, c, i, x, V;
|
|
749
741
|
n.fields.name = ((b = o == null ? void 0 : o.item) == null ? void 0 : b.name) || ((c = o == null ? void 0 : o.consumer_group) == null ? void 0 : c.name) || (o == null ? void 0 : o.name) || "";
|
|
750
|
-
const a = ((
|
|
742
|
+
const a = ((i = o == null ? void 0 : o.item) == null ? void 0 : i.tags) || (o == null ? void 0 : o.consumer_group.tags) || (o == null ? void 0 : o.tags) || [];
|
|
751
743
|
if (n.fields.tags = (a == null ? void 0 : a.join(", ")) || "", "consumers" in o)
|
|
752
744
|
n.fields.consumers = ((x = o == null ? void 0 : o.consumers) == null ? void 0 : x.map((M) => M.id)) || [];
|
|
753
745
|
else
|
|
@@ -765,11 +757,11 @@ const be = {
|
|
|
765
757
|
tags: (a = (o = n.fields.tags.split(",")) == null ? void 0 : o.map((b) => String(b || "").trim())) == null ? void 0 : a.filter((b) => b !== "")
|
|
766
758
|
};
|
|
767
759
|
}), p = async (o, a = "") => await K.post(E("addConsumer", a, o), { consumer: o }), k = async (o, a = "") => await K.delete(E("removeConsumer", a, o)), d = (o) => {
|
|
768
|
-
n.errorMessage = ce(o),
|
|
760
|
+
n.errorMessage = ce(o), s("error", o);
|
|
769
761
|
}, h = (o = u.consumerGroupId) => {
|
|
770
|
-
Object.assign(w, n.fields),
|
|
771
|
-
},
|
|
772
|
-
const c = o == null ? void 0 : o.find((
|
|
762
|
+
Object.assign(w, n.fields), s("update", { ...n.fields, id: o });
|
|
763
|
+
}, T = (o, a, b = u.consumerGroupId) => {
|
|
764
|
+
const c = o == null ? void 0 : o.find((i) => i.status !== "fulfilled");
|
|
773
765
|
c ? d({
|
|
774
766
|
code: c.status,
|
|
775
767
|
message: a
|
|
@@ -785,7 +777,7 @@ const be = {
|
|
|
785
777
|
if (n.fields.consumers.length > 0 && o)
|
|
786
778
|
try {
|
|
787
779
|
const a = n.fields.consumers.map((c) => p(c, o)), b = await Promise.allSettled(a);
|
|
788
|
-
|
|
780
|
+
T(b, g("consumer_groups.errors.add_consumer"), o);
|
|
789
781
|
} catch (a) {
|
|
790
782
|
d(a);
|
|
791
783
|
}
|
|
@@ -803,15 +795,15 @@ const be = {
|
|
|
803
795
|
else {
|
|
804
796
|
if (a.length > 0)
|
|
805
797
|
try {
|
|
806
|
-
const c = a.map((x) => k(x)),
|
|
807
|
-
|
|
798
|
+
const c = a.map((x) => k(x)), i = await Promise.allSettled(c);
|
|
799
|
+
T(i, g("consumer_groups.errors.remove_consumer"));
|
|
808
800
|
} catch (c) {
|
|
809
801
|
d(c);
|
|
810
802
|
}
|
|
811
803
|
if (o.length > 0)
|
|
812
804
|
try {
|
|
813
|
-
const c = o.map((x) => p(x)),
|
|
814
|
-
|
|
805
|
+
const c = o.map((x) => p(x)), i = await Promise.allSettled(c);
|
|
806
|
+
T(i, g("consumer_groups.errors.add_consumer"));
|
|
815
807
|
} catch (c) {
|
|
816
808
|
d(c);
|
|
817
809
|
}
|
|
@@ -824,85 +816,84 @@ const be = {
|
|
|
824
816
|
}
|
|
825
817
|
};
|
|
826
818
|
return De(async () => {
|
|
827
|
-
await
|
|
819
|
+
await le();
|
|
828
820
|
}), (o, a) => {
|
|
829
821
|
const b = F("KInput"), c = F("KMultiselect");
|
|
830
822
|
return $(), j("div", bo, [
|
|
831
|
-
y(
|
|
823
|
+
y(r(no), {
|
|
832
824
|
"can-submit": U.value && H.value,
|
|
833
825
|
config: e.config,
|
|
834
826
|
"edit-id": e.consumerGroupId,
|
|
835
|
-
"
|
|
836
|
-
"
|
|
837
|
-
"
|
|
838
|
-
"fetch-url": re.value,
|
|
827
|
+
"entity-type": r(Ve).ConsumerGroup,
|
|
828
|
+
"error-message": n.errorMessage || r(ie) || te.value,
|
|
829
|
+
"fetch-url": se.value,
|
|
839
830
|
"form-fields": J.value,
|
|
840
831
|
"is-readonly": n.readonly,
|
|
841
832
|
onCancel: me,
|
|
842
|
-
"onFetch:error": a[3] || (a[3] = (
|
|
833
|
+
"onFetch:error": a[3] || (a[3] = (i) => z(i)),
|
|
843
834
|
"onFetch:success": P,
|
|
844
|
-
onLoading: a[4] || (a[4] = (
|
|
835
|
+
onLoading: a[4] || (a[4] = (i) => Z(i)),
|
|
845
836
|
onSubmit: Ce
|
|
846
837
|
}, {
|
|
847
838
|
default: f(() => [
|
|
848
|
-
y(
|
|
849
|
-
description:
|
|
850
|
-
title:
|
|
839
|
+
y(r(Pe), {
|
|
840
|
+
description: r(g)("consumer_groups.form.general_info.description"),
|
|
841
|
+
title: r(g)("consumer_groups.form.general_info.title")
|
|
851
842
|
}, {
|
|
852
843
|
default: f(() => [
|
|
853
844
|
y(b, {
|
|
854
845
|
modelValue: n.fields.name,
|
|
855
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
846
|
+
"onUpdate:modelValue": a[0] || (a[0] = (i) => n.fields.name = i),
|
|
856
847
|
modelModifiers: { trim: !0 },
|
|
857
848
|
autocomplete: "off",
|
|
858
849
|
"data-testid": "consumer-group-form-name",
|
|
859
|
-
label:
|
|
860
|
-
placeholder:
|
|
850
|
+
label: r(g)("consumer_groups.form.fields.name.label"),
|
|
851
|
+
placeholder: r(g)("consumer_groups.form.fields.name.placeholder"),
|
|
861
852
|
required: "",
|
|
862
853
|
type: "text"
|
|
863
854
|
}, null, 8, ["modelValue", "label", "placeholder"]),
|
|
864
855
|
y(b, {
|
|
865
856
|
modelValue: n.fields.tags,
|
|
866
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
857
|
+
"onUpdate:modelValue": a[1] || (a[1] = (i) => n.fields.tags = i),
|
|
867
858
|
modelModifiers: { trim: !0 },
|
|
868
859
|
autocomplete: "off",
|
|
869
860
|
"data-testid": "consumer-group-form-tags",
|
|
870
|
-
help:
|
|
871
|
-
label:
|
|
861
|
+
help: r(g)("consumer_groups.form.fields.tags.help"),
|
|
862
|
+
label: r(g)("consumer_groups.form.fields.tags.label"),
|
|
872
863
|
"label-attributes": {
|
|
873
|
-
info:
|
|
864
|
+
info: r(g)("consumer_groups.form.fields.tags.tooltip"),
|
|
874
865
|
tooltipAttributes: { maxWidth: "400" }
|
|
875
866
|
},
|
|
876
|
-
placeholder:
|
|
867
|
+
placeholder: r(g)("consumer_groups.form.fields.tags.placeholder"),
|
|
877
868
|
type: "text"
|
|
878
869
|
}, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder"])
|
|
879
870
|
]),
|
|
880
871
|
_: 1
|
|
881
872
|
}, 8, ["description", "title"]),
|
|
882
|
-
y(
|
|
883
|
-
description:
|
|
873
|
+
y(r(Pe), {
|
|
874
|
+
description: r(g)("consumer_groups.form.consumers.description"),
|
|
884
875
|
"has-divider": "",
|
|
885
|
-
title:
|
|
876
|
+
title: r(g)("consumer_groups.form.consumers.title")
|
|
886
877
|
}, {
|
|
887
878
|
default: f(() => [
|
|
888
879
|
y(c, {
|
|
889
880
|
modelValue: n.fields.consumers,
|
|
890
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
|
881
|
+
"onUpdate:modelValue": a[2] || (a[2] = (i) => n.fields.consumers = i),
|
|
891
882
|
appearance: "select",
|
|
892
883
|
autosuggest: "",
|
|
893
884
|
items: B.value,
|
|
894
|
-
label:
|
|
895
|
-
loading:
|
|
896
|
-
placeholder:
|
|
885
|
+
label: r(g)("consumer_groups.form.fields.consumers.label"),
|
|
886
|
+
loading: r(A),
|
|
887
|
+
placeholder: r(g)("consumer_groups.form.fields.consumers.placeholder"),
|
|
897
888
|
width: "auto",
|
|
898
|
-
onQueryChange:
|
|
889
|
+
onQueryChange: r(Q)
|
|
899
890
|
}, {
|
|
900
|
-
"item-template": f(({ item:
|
|
891
|
+
"item-template": f(({ item: i }) => {
|
|
901
892
|
var x, V, M;
|
|
902
893
|
return [
|
|
903
894
|
O("div", Co, [
|
|
904
|
-
O("div", ko, G(
|
|
905
|
-
(x =
|
|
895
|
+
O("div", ko, G(i.label), 1),
|
|
896
|
+
(x = i == null ? void 0 : i.data) != null && x.username && ((V = i == null ? void 0 : i.data) != null && V.custom_id) ? ($(), j("div", Io, G((M = i == null ? void 0 : i.data) == null ? void 0 : M.custom_id), 1)) : ue("", !0)
|
|
906
897
|
])
|
|
907
898
|
];
|
|
908
899
|
}),
|
|
@@ -913,11 +904,11 @@ const be = {
|
|
|
913
904
|
}, 8, ["description", "title"])
|
|
914
905
|
]),
|
|
915
906
|
_: 1
|
|
916
|
-
}, 8, ["can-submit", "config", "edit-id", "
|
|
907
|
+
}, 8, ["can-submit", "config", "edit-id", "entity-type", "error-message", "fetch-url", "form-fields", "is-readonly"])
|
|
917
908
|
]);
|
|
918
909
|
};
|
|
919
910
|
}
|
|
920
|
-
}),
|
|
911
|
+
}), To = /* @__PURE__ */ Ee($o, [["__scopeId", "data-v-dfa56d62"]]), wo = { class: "kong-ui-consumer-group-entity-config-card" }, Po = /* @__PURE__ */ _e({
|
|
921
912
|
__name: "ConsumerGroupConfigCard",
|
|
922
913
|
props: {
|
|
923
914
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -940,19 +931,11 @@ const be = {
|
|
|
940
931
|
hideTitle: {
|
|
941
932
|
type: Boolean,
|
|
942
933
|
default: !1
|
|
943
|
-
},
|
|
944
|
-
/**
|
|
945
|
-
* Enable display of Terraform code
|
|
946
|
-
* Guarded by FF: khcp-12445-terraform-config-details
|
|
947
|
-
*/
|
|
948
|
-
enableTerraform: {
|
|
949
|
-
type: Boolean,
|
|
950
|
-
default: !1
|
|
951
934
|
}
|
|
952
935
|
},
|
|
953
936
|
emits: ["loading", "fetch:error", "fetch:success"],
|
|
954
937
|
setup(e) {
|
|
955
|
-
const L = e, { i18n: { t: u } } = be.useI18n(),
|
|
938
|
+
const L = e, { i18n: { t: u } } = be.useI18n(), s = I(() => X.form[L.config.app].edit), g = _({
|
|
956
939
|
id: {},
|
|
957
940
|
name: {},
|
|
958
941
|
created_at: {},
|
|
@@ -961,25 +944,24 @@ const be = {
|
|
|
961
944
|
tooltip: u("consumer_groups.form.fields.tags.tooltip")
|
|
962
945
|
}
|
|
963
946
|
});
|
|
964
|
-
return (
|
|
965
|
-
y(
|
|
947
|
+
return (l, n) => ($(), j("div", wo, [
|
|
948
|
+
y(r(ao), {
|
|
966
949
|
config: e.config,
|
|
967
950
|
"config-card-doc": e.configCardDoc,
|
|
968
951
|
"config-schema": g.value,
|
|
969
952
|
"data-key": "consumer_group",
|
|
970
|
-
"
|
|
971
|
-
"
|
|
972
|
-
"fetch-url": r.value,
|
|
953
|
+
"entity-type": r(Ve).ConsumerGroup,
|
|
954
|
+
"fetch-url": s.value,
|
|
973
955
|
"hide-title": e.hideTitle,
|
|
974
|
-
"onFetch:error": n[0] || (n[0] = (w) =>
|
|
975
|
-
"onFetch:success": n[1] || (n[1] = (w) =>
|
|
976
|
-
onLoading: n[2] || (n[2] = (w) =>
|
|
977
|
-
}, null, 8, ["config", "config-card-doc", "config-schema", "
|
|
956
|
+
"onFetch:error": n[0] || (n[0] = (w) => l.$emit("fetch:error", w)),
|
|
957
|
+
"onFetch:success": n[1] || (n[1] = (w) => l.$emit("fetch:success", w)),
|
|
958
|
+
onLoading: n[2] || (n[2] = (w) => l.$emit("loading", w))
|
|
959
|
+
}, null, 8, ["config", "config-card-doc", "config-schema", "entity-type", "fetch-url", "hide-title"])
|
|
978
960
|
]));
|
|
979
961
|
}
|
|
980
962
|
});
|
|
981
963
|
export {
|
|
982
964
|
Po as ConsumerGroupConfigCard,
|
|
983
|
-
|
|
984
|
-
|
|
965
|
+
To as ConsumerGroupForm,
|
|
966
|
+
So as ConsumerGroupList
|
|
985
967
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(B,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/entities-shared"],e):(B=typeof globalThis<"u"?globalThis:B||self,e(B["kong-ui-public-entities-consumer-groups"]={},B.Vue,B.VueRouter,B.KongIcons,B["kong-ui-public-i18n"],B["kong-ui-public-entities-shared"]))})(this,function(B,e,me,Ce,pe,f){"use strict";const _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"},toolbar_actions:{new_consumer_group:"New Consumer Group"}},title:"Consumer Groups",search:{placeholder:"Filter by exact name or ID"},actions:{add_to_group:"Add to Consumer Group",create:"New Consumer Group",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",exit:"Exit",view:"View Details"},delete:{title:"Delete a Consumer Group",description:"Deleting this group will remove this group from all plugins and its rate limit configuration. This action cannot be reversed."},consumers:{add:{title:"Add To Consumer Groups",ctaText:"Add this consumer to consumer groups",consumer_groups_label:"Consumer Groups",consumer_group_placeholder:"Add to consumer groups",footer:"Search by exact name or ID to find consumer groups not included in the list"},exit:{title:"Exit from a Consumer Group",confirmation:"Are you sure you want to remove consumer {consumer} from consumer group {consumerGroup}?",confirmationNoUsername:"Are you sure you want this consumer to exit from consumer group {consumerGroup}?",description:"Exiting from the group could change the rate limit policy applied to this consumer."}},errors:{general:"Consumer Groups could not be retrieved",delete:"The consumer group could not be deleted at this time.",copy:"Failed to copy to clipboard",add:"The consumer could not be added to some groups at this time.",already_added:"The consumer is already in this consumer group",add_consumer:"An unexpected error occurred while adding consumers. Please try again.",remove_consumer:"An unexpected error occurred while removing consumers. Please try again."},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{general_info:{title:"General Information",description:"General information will help identify and manage this consumer group."},consumers:{title:"Consumers",description:"Add or remove consumers from this group"},fields:{name:{label:"Name",placeholder:"Enter a unique name for this consumer group "},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."},consumers:{label:"Consumers",placeholder:"Select one or more consumers"}}}}};function be(){const o=pe.createI18n("en-us",_e);return{i18n:o,i18nT:pe.i18nTComponent(o)}}const se={useI18n:be},M="/v2/control-planes/{controlPlaneId}/core-entities",G="/{workspace}",q={list:{konnect:{all:`${M}/consumer_groups`,forModal:`${M}/consumer_groups`,forConsumer:`${M}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${M}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`},kongManager:{all:`${G}/consumer_groups?counter=true`,forModal:`${G}/consumer_groups`,forConsumer:`${G}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${G}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`}},form:{konnect:{consumersList:`${M}/consumers`,create:`${M}/consumer_groups`,edit:`${M}/consumer_groups/{id}`,addConsumer:`${M}/consumer_groups/{id}/consumers`,removeConsumer:`${M}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${M}/consumer_groups/{id}/consumers`},kongManager:{consumersList:`${G}/consumers`,create:`${G}/consumer_groups`,edit:`${G}/consumer_groups/{id}`,addConsumer:`${G}/consumer_groups/{id}/consumers`,removeConsumer:`${G}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${G}/consumer_groups/{id}/consumers`}}},ke={class:"add-to-group-form-container"},we={class:"add-to-group-cta-text"},xe={key:0,class:"kong-ui-entity-add-to-groups-error"},Ie={key:0},Ee=e.defineComponent({__name:"AddToGroupModal",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||!o.consumerId)},visible:{type:Boolean,required:!0,default:!1}},emits:["cancel","add:success","add:partial-success","error"],setup(o,{emit:S}){var U;const{i18n:{t:c}}=se.useI18n(),r=o,g=S,{axiosInstance:i}=f.useAxios((U=r.config)==null?void 0:U.axiosRequestConfig),s=e.ref([]),{debouncedQueryChange:k,loading:R,allRecords:E,error:Z,loadItems:v,results:D}=f.useDebouncedFilter(r.config,q.list[r.config.app].forModal,"",{fetchedItemsKey:"data",searchKeys:["name","id"]}),T=e.computed(()=>Z.value?c("consumer_groups.errors.general"):""),ee=e.ref(0),Q=e.computed(()=>E.value===void 0),A=e.computed(()=>D.value.map(p=>({label:p.name,value:p.id,selected:s.value.includes(p.id),data:p}))),H=p=>{var d;const b=Q.value?D.value.find(h=>h.id===p):(d=E.value)==null?void 0:d.find(h=>h.id===p);return b?b.name:p},oe=()=>{w.value="",P.value=[],$.value=[],g("cancel")},P=e.ref([]),O=e.ref(!1),w=e.ref(""),te=async()=>{if(!s.value.length){w.value="",$.value=[],g("cancel");return}O.value=!0,w.value="",P.value=[],$.value=[];try{const p=s.value.map(h=>J(h)),b=await Promise.allSettled(p);let d=!0;b.forEach(h=>{h.status!=="fulfilled"&&(d=!1)}),d?(P.value=[],$.value=[],g("add:success",s.value),s.value=[]):(P.value.length&&g("add:partial-success",P.value),s.value=[],z(b))}catch{w.value=c("consumer_groups.errors.add"),g("error",w.value)}finally{O.value=!1}},j=e.computed(()=>{var b,d,h,N;let p=`${r.config.apiBaseUrl}${q.list[r.config.app].forConsumer}`;return r.config.app==="konnect"?p=p.replace(/{controlPlaneId}/gi,((b=r.config)==null?void 0:b.controlPlaneId)||"").replace(/{consumerId}/gi,((d=r.config)==null?void 0:d.consumerId)||""):r.config.app==="kongManager"&&(p=p.replace(/\/{workspace}/gi,(h=r.config)!=null&&h.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((N=r.config)==null?void 0:N.consumerId)||"")),p}),J=async p=>{const b={group:p};try{const d=await i.post(j.value,b);return P.value.push(p),d}catch(d){let h=`${H(p)} - ${d.message}`;return d.response.status===409&&(h=`${H(p)} - ${c("consumer_groups.errors.already_added")}`),Promise.reject(Error(h))}},$=e.ref([]),z=p=>{$.value=p.map(b=>{var d;return(d=b.reason)==null?void 0:d.message}).filter(Boolean)};return e.watch(A,()=>{ee.value++},{immediate:!0,deep:!0}),e.watch(()=>r.visible,()=>{r.visible&&v()},{immediate:!0}),(p,b)=>{const d=e.resolveComponent("KMultiselect"),h=e.resolveComponent("KAlert"),N=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(N,{"action-button-disabled":O.value,class:"kong-ui-entities-add-to-groups-modal","data-testid":"add-to-group-modal",title:e.unref(c)("consumer_groups.consumers.add.title"),visible:o.visible,onCancel:oe,onProceed:te},{default:e.withCtx(()=>[e.createElementVNode("div",ke,[e.createElementVNode("p",we,e.toDisplayString(e.unref(c)("consumer_groups.consumers.add.ctaText")),1),e.createVNode(d,{modelValue:s.value,"onUpdate:modelValue":b[0]||(b[0]=L=>s.value=L),autosuggest:"","data-testid":"add-to-groups-multiselect","dropdown-footer-text":Q.value?e.unref(c)("consumer_groups.consumers.add.footer"):void 0,items:A.value,label:e.unref(c)("consumer_groups.consumers.add.consumer_groups_label"),loading:e.unref(R),placeholder:e.unref(c)("consumer_groups.consumers.add.consumer_group_placeholder"),readonly:O.value,required:"",width:"100%",onQueryChange:e.unref(k)},null,8,["modelValue","dropdown-footer-text","items","label","loading","placeholder","readonly","onQueryChange"]),w.value||T.value||$.value.length?(e.openBlock(),e.createElementBlock("div",xe,[e.createVNode(h,{appearance:"danger"},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(e.unref(c)("consumer_groups.errors.add")),1),$.value.length?(e.openBlock(),e.createElementBlock("ul",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(L,re)=>(e.openBlock(),e.createElementBlock("li",{key:re},e.toDisplayString(L),1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(w.value||T.value),1)]),_:1})])):e.createCommentVNode("",!0)])]),_:1},8,["action-button-disabled","title","visible"])}}}),ie=(o,S)=>{const c=o.__vccOpts||o;for(const[r,g]of S)c[r]=g;return c},Ve=ie(Ee,[["__scopeId","data-v-4260ce03"]]),Be={class:"kong-ui-entities-consumer-groups-list"},Ne={key:1},$e=ie(e.defineComponent({__name:"ConsumerGroupList",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||!o.createRoute||!o.getViewRoute||!o.getEditRoute||o.app==="kongManager"&&!o.isExactMatch&&!o.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","add:success","remove:success"],setup(o,{emit:S}){var ye;const c=S,r=o,{i18nT:g,i18n:{t:i}}=se.useI18n(),s=me.useRouter(),{axiosInstance:k}=f.useAxios((ye=r.config)==null?void 0:ye.axiosRequestConfig),R=e.ref(1),E=e.computed(()=>!!r.config.consumerId),Z=e.computed(()=>E.value?"kong-ui-entities-consumer-groups-list-in-consumer-page":"kong-ui-entities-consumer-groups-list"),v=e.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),D={name:{label:i("consumer_groups.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1}};r.config.app==="kongManager"&&(D.consumers_count={label:i("consumer_groups.list.table_headers.consumers_count"),searchable:!1,sortable:!1}),D.tags={label:i("consumer_groups.list.table_headers.tags"),sortable:!1};const T=D,ee=n=>({"data-testid":n.username??n.custom_id??n.id}),Q=e.computed(()=>{var m,_,V,K;let n=`${r.config.apiBaseUrl}${q.list[r.config.app][E.value?"forConsumer":"all"]}`;return r.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||"").replace(/{consumerId}/gi,((_=r.config)==null?void 0:_.consumerId)||""):r.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(V=r.config)!=null&&V.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((K=r.config)==null?void 0:K.consumerId)||"")),n}),A=e.ref(""),H=e.computed(()=>{const n=r.config.app==="konnect"||r.config.isExactMatch;return n?{isExactMatch:n,fields:{username:D.name,id:{label:i("consumer_groups.list.table_headers.id")}},placeholder:i("consumer_groups.search.placeholder")}:{isExactMatch:n,fields:{name:D.name},schema:r.config.filterSchema}}),oe=e.computed(()=>r.config.app==="konnect"&&A.value?"consumer_group":E.value&&!r.config.paginatedEndpoint?"consumer_groups":void 0),{fetcher:P,fetcherState:O}=f.useFetcher(r.config,Q.value,oe),w=()=>{A.value=""},te=()=>{R.value++},j=e.ref(null),J=e.ref(!1),$=(n,m)=>{const _=n.id;if(!m(_)){c("copy:error",{entity:n,field:"id",message:i("consumer_groups.errors.copy")});return}c("copy:success",{entity:n,field:"id",message:i("consumer_groups.copy.success",{val:_})})},z=(n,m)=>{const _=JSON.stringify(n);if(!m(_)){c("copy:error",{entity:n,message:i("consumer_groups.errors.copy")});return}c("copy:success",{entity:n,message:i("consumer_groups.copy.success_brief")})},U=async n=>{var _;await((_=r.canRetrieve)==null?void 0:_.call(r,n))&&s.push(r.config.getViewRoute(n.id))},p=n=>({label:i("consumer_groups.actions.view"),to:r.config.getViewRoute(n)}),b=n=>({label:i("consumer_groups.actions.edit"),to:r.config.getEditRoute(n)}),d=e.ref(void 0),h=e.ref(!1),N=e.ref(!1),L=e.ref(""),re=f.useDeleteUrlBuilder(r.config,Q.value),ue=n=>{d.value=n,h.value=!0},ae=()=>{h.value=!1},ce=async()=>{var n,m,_;if((n=d.value)!=null&&n.id){N.value=!0;try{await k.delete(re(d.value.id)),N.value=!1,h.value=!1,R.value++,c("delete:success",d.value)}catch(V){L.value=((_=(m=V.response)==null?void 0:m.data)==null?void 0:_.message)||V.message||i("consumer_groups.errors.delete"),c("error",V)}finally{N.value=!1}}},X=e.ref(!1),t=()=>{X.value=!0},a=()=>{X.value=!1},C=(n,m)=>{m||a(),R.value++,c("add:success",n)},u=()=>{E.value&&t()},l=e.ref(void 0),x=e.ref(!1),F=e.ref(""),I=n=>{l.value=n,x.value=!0},W=()=>{x.value=!1,l.value=void 0},le=e.computed(()=>{var m,_,V,K;let n=`${r.config.apiBaseUrl}${q.list[r.config.app].oneForConsumer}`;return r.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||"").replace(/{consumerId}/gi,((_=r.config)==null?void 0:_.consumerId)||""):r.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(V=r.config)!=null&&V.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((K=r.config)==null?void 0:K.consumerId)||"")),n}),fe=e.ref(!1),Ke=async()=>{if(l.value){fe.value=!0;try{const n=le.value.replace(/{consumerGroupId}/gi,l.value.id);await k.delete(n),c("remove:success",l.value),W(),R.value++}catch(n){F.value=n.message||i("consumer_groups.errors.delete"),c("error",n)}finally{fe.value=!1}}},ge=e.ref(!1);e.watch(O,n=>{var m,_,V,K;if(Array.isArray((m=n==null?void 0:n.response)==null?void 0:m.data)&&(ge.value=n.response.data.length>0),n.status===f.FetcherStatus.NoRecords?J.value=!0:J.value=!1,n.status===f.FetcherStatus.Error){j.value={title:i("consumer_groups.errors.general")},(K=(V=(_=n.error)==null?void 0:_.response)==null?void 0:V.data)!=null&&K.message&&(j.value.message=n.error.response.data.message),c("error",n.error);return}j.value=null});const de=e.ref({ctaPath:E.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=E.value?i("consumer_groups.list.empty_state.title_for_consumer"):i("consumer_groups.list.empty_state.title"),de.value.ctaText=E.value?i("consumer_groups.actions.add_to_group"):i("consumer_groups.actions.create"))}),(n,m)=>{const _=e.resolveComponent("KButton"),V=e.resolveComponent("KBadge"),K=e.resolveComponent("KTruncate"),ne=e.resolveComponent("KDropdownItem"),he=e.resolveComponent("KClipboardProvider"),Se=e.resolveComponent("KPrompt");return e.openBlock(),e.createElementBlock("div",Be,[e.createVNode(e.unref(f.EntityBaseTable),{"cache-identifier":o.cacheIdentifier,"disable-pagination":E.value&&!o.config.paginatedEndpoint,"disable-sorting":v.value,"empty-state-options":de.value,"enable-entity-actions":"","error-message":j.value,fetcher:e.unref(P),"fetcher-cache-key":R.value,"hide-toolbar":J.value,"pagination-type":"offset","preferences-storage-key":Z.value,query:A.value,"row-attributes":ee,"table-headers":e.unref(T),onClearSearchInput:w,"onClick:row":m[3]||(m[3]=y=>U(y)),onEmptyStateCtaClicked:u,onSort:te},{"toolbar-filter":e.withCtx(()=>[E.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(f.EntityFilter),{key:0,modelValue:A.value,"onUpdate:modelValue":m[0]||(m[0]=y=>A.value=y),config:H.value},null,8,["modelValue","config"]))]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!o.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>o.canCreate()},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(_,{appearance:"primary","data-testid":"toolbar-add-consumer-group",size:o.useActionOutside?"medium":"large",to:o.config.consumerId?void 0:o.config.createRoute,onClick:m[1]||(m[1]=()=>o.config.consumerId?t():void 0)},{default:e.withCtx(()=>[e.createVNode(e.unref(Ce.AddIcon)),e.createTextVNode(" "+e.toDisplayString(o.config.consumerId?e.unref(i)("consumer_groups.actions.add_to_group"):e.unref(i)("consumer_groups.list.toolbar_actions.new_consumer_group")),1)]),_:1},8,["size","to"]),[[e.vShow,ge.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:e.withCtx(({rowValue:y})=>[e.createElementVNode("b",null,e.toDisplayString(y??"-"),1)]),consumers_count:e.withCtx(({rowValue:y})=>[e.createTextVNode(e.toDisplayString(y??"-"),1)]),tags:e.withCtx(({rowValue:y})=>[(y==null?void 0:y.length)>0?(e.openBlock(),e.createBlock(K,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y,Y=>(e.openBlock(),e.createBlock(V,{key:Y,onClick:m[2]||(m[2]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Y),1)]),_:2},1024))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",Ne,"-"))]),actions:e.withCtx(({row:y})=>[e.createVNode(he,null,{default:e.withCtx(({copyToClipboard:Y})=>[e.createVNode(ne,{"data-testid":"action-entity-copy-id",onClick:Re=>$(y,Y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("consumer_groups.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(he,null,{default:e.withCtx(({copyToClipboard:Y})=>[e.createVNode(ne,{"data-testid":"action-entity-copy-json",onClick:Re=>z(y,Y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("consumer_groups.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>o.canRetrieve(y)},{default:e.withCtx(()=>[e.createVNode(ne,{"data-testid":"action-entity-view","has-divider":"",item:p(y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>o.canEdit(y)},{default:e.withCtx(()=>[e.createVNode(ne,{"data-testid":"action-entity-edit",item:b(y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>o.canDelete(y)},{default:e.withCtx(()=>[e.createVNode(ne,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:()=>o.config.consumerId?I(y):ue(y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.config.consumerId?e.unref(i)("consumer_groups.actions.exit"):e.unref(i)("consumer_groups.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-pagination","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","hide-toolbar","preferences-storage-key","query","table-headers"]),e.createVNode(e.unref(f.EntityDeleteModal),{"action-pending":N.value,"data-testid":"delete-consumer-group-modal",description:e.unref(i)("consumer_groups.delete.description"),"entity-name":d.value&&(d.value.name||d.value.id),"entity-type":e.unref(f.EntityTypes).ConsumerGroup,error:L.value,title:e.unref(i)("consumer_groups.delete.title"),visible:h.value,onCancel:ae,onProceed:ce},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"]),o.config.consumerId?(e.openBlock(),e.createBlock(Ve,{key:0,config:o.config,"data-testid":"add-to-group-modal",visible:X.value,"onAdd:partialSuccess":m[4]||(m[4]=y=>C(y,!0)),"onAdd:success":m[5]||(m[5]=y=>C(y)),onCancel:a},null,8,["config","visible"])):e.createCommentVNode("",!0),o.config.consumerId&&l.value?(e.openBlock(),e.createBlock(Se,{key:1,"action-button-appearance":"danger","data-testid":"exit-group-modal",title:e.unref(i)("consumer_groups.consumers.exit.title"),visible:x.value,onCancel:W,onProceed:Ke},{default:e.withCtx(()=>[e.createVNode(e.unref(g),{class:"exit-modal-message",keypath:o.config.consumerUsername?"consumer_groups.consumers.exit.confirmation":"consumer_groups.consumers.exit.confirmationNoUsername",tag:"p"},e.createSlots({consumerGroup:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(l.value.name||l.value.id),1)]),_:2},[o.config.consumerUsername?{name:"consumer",fn:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(o.config.consumerUsername),1)]),key:"0"}:void 0]),1032,["keypath"]),e.createElementVNode("p",null,e.toDisplayString(e.unref(i)("consumer_groups.consumers.exit.description")),1)]),_:1},8,["title","visible"])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-8bb72c5a"]]),Te={class:"kong-ui-entities-consumer-group-form"},Me={class:"select-item-container"},Ge={class:"select-item-label"},De={key:0,class:"select-item-description"},Ae=ie(e.defineComponent({__name:"ConsumerGroupForm",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||(o==null?void 0:o.app)==="konnect"&&!(o!=null&&o.controlPlaneId)||(o==null?void 0:o.app)==="kongManager"&&typeof(o==null?void 0:o.workspace)!="string"||!(o!=null&&o.cancelRoute))},consumerGroupId:{type:String,required:!1,default:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(o,{emit:S}){var ae,ce,X;const c=o,r=S,{i18n:{t:g}}=se.useI18n(),i=me.useRouter(),s=e.reactive({fields:{name:"",tags:"",consumers:[]},errorMessage:"",readonly:!1}),k=e.reactive({name:"",tags:"",consumers:[]}),{debouncedQueryChange:R,loading:E,error:Z,loadItems:v,results:D}=f.useDebouncedFilter(c.config,(ce=q.form[(ae=c.config)==null?void 0:ae.app])==null?void 0:ce.consumersList,"",{fetchedItemsKey:"data",searchKeys:["username","custom_id","id"]}),{axiosInstance:T}=f.useAxios((X=c.config)==null?void 0:X.axiosRequestConfig),{getMessageFromError:ee}=f.useErrors(),Q=f.useValidators(),A=e.computed(()=>D.value.map(t=>({label:t.username||t.custom_id,value:t.id,selected:s.fields.consumers.includes(t.id),data:t}))),H=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?f.EntityBaseFormType.Edit:f.EntityBaseFormType.Create),P=e.computed(()=>!!s.fields.name&&!z.value),O=e.computed(()=>JSON.stringify(s.fields)!==JSON.stringify(k)),w=(t,a="",C="")=>{var l,x,F,I,W,le;let u=`${(l=c.config)==null?void 0:l.apiBaseUrl}${q.form[(x=c.config)==null?void 0:x.app][t]}`;return((F=c.config)==null?void 0:F.app)==="konnect"?u=u.replace(/{controlPlaneId}/gi,((I=c.config)==null?void 0:I.controlPlaneId)||""):((W=c.config)==null?void 0:W.app)==="kongManager"&&(u=u.replace(/\/{workspace}/gi,(le=c.config)!=null&&le.workspace?`/${c.config.workspace}`:"")),u=u.replace(/{id}/gi,a||c.consumerGroupId),(t==="addConsumer"||t==="removeConsumer")&&(u=u.replace(/{consumerId}/gi,C)),u},te=()=>{var t;i.push(((t=c.config)==null?void 0:t.cancelRoute)||{name:"consumer-group-list"})},j=t=>{r("error",t)},J=t=>{r("loading",t)},$=async t=>{var C,u,l,x,F;s.fields.name=((C=t==null?void 0:t.item)==null?void 0:C.name)||((u=t==null?void 0:t.consumer_group)==null?void 0:u.name)||(t==null?void 0:t.name)||"";const a=((l=t==null?void 0:t.item)==null?void 0:l.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=((x=t==null?void 0:t.consumers)==null?void 0:x.map(I=>I.id))||[];else try{const{data:I}=await T.get(w("getConsumers"));s.fields.consumers="consumers"in I?(F=I==null?void 0:I.consumers)==null?void 0:F.map(W=>W.id):[]}catch(I){d(I)}Object.assign(k,s.fields)},z=e.computed(()=>Q.utf8Name(s.fields.name)),U=e.computed(()=>{var t,a;return{name:s.fields.name,tags:(a=(t=s.fields.tags.split(","))==null?void 0:t.map(C=>String(C||"").trim()))==null?void 0:a.filter(C=>C!=="")}}),p=async(t,a="")=>await T.post(w("addConsumer",a,t),{consumer:t}),b=async(t,a="")=>await T.delete(w("removeConsumer",a,t)),d=t=>{s.errorMessage=ee(t),r("error",t)},h=(t=c.consumerGroupId)=>{Object.assign(k,s.fields),r("update",{...s.fields,id:t})},N=(t,a,C=c.consumerGroupId)=>{const u=t==null?void 0:t.find(l=>l.status!=="fulfilled");u?d({code:u.status,message:a}):h(C)},L=async()=>{let t="";try{const{data:a}=await T.post(w("create"),U.value);t="item"in a?a.item.id:a.id}catch(a){d(a)}if(s.fields.consumers.length>0&&t)try{const a=s.fields.consumers.map(u=>p(u,t)),C=await Promise.allSettled(a);N(C,g("consumer_groups.errors.add_consumer"),t)}catch(a){d(a)}else s.fields.consumers.length===0&&t&&h(t)},re=async()=>{var C;try{((C=c.config)==null?void 0:C.app)==="konnect"?await T.put(w("edit"),U.value):await T.patch(w("edit"),U.value)}catch(u){d(u)}const t=s.fields.consumers.filter(u=>!k.consumers.includes(u)),a=k.consumers.filter(u=>!s.fields.consumers.includes(u));if(a.length===0&&t.length===0)h();else{if(a.length>0)try{const u=a.map(x=>b(x)),l=await Promise.allSettled(u);N(l,g("consumer_groups.errors.remove_consumer"))}catch(u){d(u)}if(t.length>0)try{const u=t.map(x=>p(x)),l=await Promise.allSettled(u);N(l,g("consumer_groups.errors.add_consumer"))}catch(u){d(u)}}},ue=async()=>{try{s.readonly=!0,oe.value===f.EntityBaseFormType.Create?await L():await re()}finally{s.readonly=!1}};return e.onBeforeMount(async()=>{await v()}),(t,a)=>{const C=e.resolveComponent("KInput"),u=e.resolveComponent("KMultiselect");return e.openBlock(),e.createElementBlock("div",Te,[e.createVNode(e.unref(f.EntityBaseForm),{"can-submit":P.value&&O.value,config:o.config,"edit-id":o.consumerGroupId,"enable-terraform":o.enableTerraform,"entity-type":e.unref(f.SupportedEntityType).ConsumerGroup,"error-message":s.errorMessage||e.unref(Z)||z.value,"fetch-url":H.value,"form-fields":U.value,"is-readonly":s.readonly,onCancel:te,"onFetch:error":a[3]||(a[3]=l=>j(l)),"onFetch:success":$,onLoading:a[4]||(a[4]=l=>J(l)),onSubmit:ue},{default:e.withCtx(()=>[e.createVNode(e.unref(f.EntityFormSection),{description:e.unref(g)("consumer_groups.form.general_info.description"),title:e.unref(g)("consumer_groups.form.general_info.title")},{default:e.withCtx(()=>[e.createVNode(C,{modelValue:s.fields.name,"onUpdate:modelValue":a[0]||(a[0]=l=>s.fields.name=l),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-group-form-name",label:e.unref(g)("consumer_groups.form.fields.name.label"),placeholder:e.unref(g)("consumer_groups.form.fields.name.placeholder"),required:"",type:"text"},null,8,["modelValue","label","placeholder"]),e.createVNode(C,{modelValue:s.fields.tags,"onUpdate:modelValue":a[1]||(a[1]=l=>s.fields.tags=l),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-group-form-tags",help:e.unref(g)("consumer_groups.form.fields.tags.help"),label:e.unref(g)("consumer_groups.form.fields.tags.label"),"label-attributes":{info:e.unref(g)("consumer_groups.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(g)("consumer_groups.form.fields.tags.placeholder"),type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder"])]),_:1},8,["description","title"]),e.createVNode(e.unref(f.EntityFormSection),{description:e.unref(g)("consumer_groups.form.consumers.description"),"has-divider":"",title:e.unref(g)("consumer_groups.form.consumers.title")},{default:e.withCtx(()=>[e.createVNode(u,{modelValue:s.fields.consumers,"onUpdate:modelValue":a[2]||(a[2]=l=>s.fields.consumers=l),appearance:"select",autosuggest:"",items:A.value,label:e.unref(g)("consumer_groups.form.fields.consumers.label"),loading:e.unref(E),placeholder:e.unref(g)("consumer_groups.form.fields.consumers.placeholder"),width:"auto",onQueryChange:e.unref(R)},{"item-template":e.withCtx(({item:l})=>{var x,F,I;return[e.createElementVNode("div",Me,[e.createElementVNode("div",Ge,e.toDisplayString(l.label),1),(x=l==null?void 0:l.data)!=null&&x.username&&((F=l==null?void 0:l.data)!=null&&F.custom_id)?(e.openBlock(),e.createElementBlock("div",De,e.toDisplayString((I=l==null?void 0:l.data)==null?void 0:I.custom_id),1)):e.createCommentVNode("",!0)])]}),_:1},8,["modelValue","items","label","loading","placeholder","onQueryChange"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-6b48d0fc"]]),Pe={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},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(o){const S=o,{i18n:{t:c}}=se.useI18n(),r=e.computed(()=>q.form[S.config.app].edit),g=e.ref({id:{},name:{},created_at:{},updated_at:{},tags:{tooltip:c("consumer_groups.form.fields.tags.tooltip")}});return(i,s)=>(e.openBlock(),e.createElementBlock("div",Pe,[e.createVNode(e.unref(f.EntityBaseConfigCard),{config:o.config,"config-card-doc":o.configCardDoc,"config-schema":g.value,"data-key":"consumer_group","enable-terraform":o.enableTerraform,"entity-type":e.unref(f.SupportedEntityType).ConsumerGroup,"fetch-url":r.value,"hide-title":o.hideTitle,"onFetch:error":s[0]||(s[0]=k=>i.$emit("fetch:error",k)),"onFetch:success":s[1]||(s[1]=k=>i.$emit("fetch:success",k)),onLoading:s[2]||(s[2]=k=>i.$emit("loading",k))},null,8,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])]))}});B.ConsumerGroupConfigCard=Fe,B.ConsumerGroupForm=Ae,B.ConsumerGroupList=$e,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(N,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):(N=typeof globalThis<"u"?globalThis:N||self,e(N["kong-ui-public-entities-consumer-groups"]={},N.Vue,N.VueRouter,N.KongIcons,N["kong-ui-public-i18n"],N["kong-ui-public-entities-shared"]))})(this,function(N,e,me,_e,pe,f){"use strict";const Ce={consumer_groups:{list:{table_headers:{name:"Name",consumers_count:"Consumers",tags:"Tags",id:"ID"},empty_state:{title:"Configure a New Consumer Group",description:"Use consumer groups to manage custom rate limiting configuration for subsets of consumers.",title_for_consumer:"Add to a Consumer Group"},toolbar_actions:{new_consumer_group:"New Consumer Group"}},title:"Consumer Groups",search:{placeholder:"Filter by exact name or ID"},actions:{add_to_group:"Add to Consumer Group",create:"New Consumer Group",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",exit:"Exit",view:"View Details"},delete:{title:"Delete a Consumer Group",description:"Deleting this group will remove this group from all plugins and its rate limit configuration. This action cannot be reversed."},consumers:{add:{title:"Add To Consumer Groups",ctaText:"Add this consumer to consumer groups",consumer_groups_label:"Consumer Groups",consumer_group_placeholder:"Add to consumer groups",footer:"Search by exact name or ID to find consumer groups not included in the list"},exit:{title:"Exit from a Consumer Group",confirmation:"Are you sure you want to remove consumer {consumer} from consumer group {consumerGroup}?",confirmationNoUsername:"Are you sure you want this consumer to exit from consumer group {consumerGroup}?",description:"Exiting from the group could change the rate limit policy applied to this consumer."}},errors:{general:"Consumer Groups could not be retrieved",delete:"The consumer group could not be deleted at this time.",copy:"Failed to copy to clipboard",add:"The consumer could not be added to some groups at this time.",already_added:"The consumer is already in this consumer group",add_consumer:"An unexpected error occurred while adding consumers. Please try again.",remove_consumer:"An unexpected error occurred while removing consumers. Please try again."},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{general_info:{title:"General Information",description:"General information will help identify and manage this consumer group."},consumers:{title:"Consumers",description:"Add or remove consumers from this group"},fields:{name:{label:"Name",placeholder:"Enter a unique name for this consumer group "},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."},consumers:{label:"Consumers",placeholder:"Select one or more consumers"}}}}};function ke(){const o=pe.createI18n("en-us",Ce);return{i18n:o,i18nT:pe.i18nTComponent(o)}}const se={useI18n:ke},G="/v2/control-planes/{controlPlaneId}/core-entities",T="/{workspace}",q={list:{konnect:{all:`${G}/consumer_groups`,forModal:`${G}/consumer_groups`,forConsumer:`${G}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${G}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`},kongManager:{all:`${T}/consumer_groups?counter=true`,forModal:`${T}/consumer_groups`,forConsumer:`${T}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${T}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`}},form:{konnect:{consumersList:`${G}/consumers`,create:`${G}/consumer_groups`,edit:`${G}/consumer_groups/{id}`,addConsumer:`${G}/consumer_groups/{id}/consumers`,removeConsumer:`${G}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${G}/consumer_groups/{id}/consumers`},kongManager:{consumersList:`${T}/consumers`,create:`${T}/consumer_groups`,edit:`${T}/consumer_groups/{id}`,addConsumer:`${T}/consumer_groups/{id}/consumers`,removeConsumer:`${T}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${T}/consumer_groups/{id}/consumers`}}},be={class:"add-to-group-form-container"},we={class:"add-to-group-cta-text"},xe={key:0,class:"kong-ui-entity-add-to-groups-error"},Ie={key:0},Ee=e.defineComponent({__name:"AddToGroupModal",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||!o.consumerId)},visible:{type:Boolean,required:!0,default:!1}},emits:["cancel","add:success","add:partial-success","error"],setup(o,{emit:S}){var U;const{i18n:{t:c}}=se.useI18n(),r=o,g=S,{axiosInstance:i}=f.useAxios((U=r.config)==null?void 0:U.axiosRequestConfig),s=e.ref([]),{debouncedQueryChange:b,loading:R,allRecords:E,error:Z,loadItems:v,results:D}=f.useDebouncedFilter(r.config,q.list[r.config.app].forModal,"",{fetchedItemsKey:"data",searchKeys:["name","id"]}),M=e.computed(()=>Z.value?c("consumer_groups.errors.general"):""),ee=e.ref(0),Q=e.computed(()=>E.value===void 0),A=e.computed(()=>D.value.map(p=>({label:p.name,value:p.id,selected:s.value.includes(p.id),data:p}))),H=p=>{var d;const k=Q.value?D.value.find(h=>h.id===p):(d=E.value)==null?void 0:d.find(h=>h.id===p);return k?k.name:p},oe=()=>{w.value="",P.value=[],$.value=[],g("cancel")},P=e.ref([]),O=e.ref(!1),w=e.ref(""),te=async()=>{if(!s.value.length){w.value="",$.value=[],g("cancel");return}O.value=!0,w.value="",P.value=[],$.value=[];try{const p=s.value.map(h=>J(h)),k=await Promise.allSettled(p);let d=!0;k.forEach(h=>{h.status!=="fulfilled"&&(d=!1)}),d?(P.value=[],$.value=[],g("add:success",s.value),s.value=[]):(P.value.length&&g("add:partial-success",P.value),s.value=[],z(k))}catch{w.value=c("consumer_groups.errors.add"),g("error",w.value)}finally{O.value=!1}},j=e.computed(()=>{var k,d,h,B;let p=`${r.config.apiBaseUrl}${q.list[r.config.app].forConsumer}`;return r.config.app==="konnect"?p=p.replace(/{controlPlaneId}/gi,((k=r.config)==null?void 0:k.controlPlaneId)||"").replace(/{consumerId}/gi,((d=r.config)==null?void 0:d.consumerId)||""):r.config.app==="kongManager"&&(p=p.replace(/\/{workspace}/gi,(h=r.config)!=null&&h.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((B=r.config)==null?void 0:B.consumerId)||"")),p}),J=async p=>{const k={group:p};try{const d=await i.post(j.value,k);return P.value.push(p),d}catch(d){let h=`${H(p)} - ${d.message}`;return d.response.status===409&&(h=`${H(p)} - ${c("consumer_groups.errors.already_added")}`),Promise.reject(Error(h))}},$=e.ref([]),z=p=>{$.value=p.map(k=>{var d;return(d=k.reason)==null?void 0:d.message}).filter(Boolean)};return e.watch(A,()=>{ee.value++},{immediate:!0,deep:!0}),e.watch(()=>r.visible,()=>{r.visible&&v()},{immediate:!0}),(p,k)=>{const d=e.resolveComponent("KMultiselect"),h=e.resolveComponent("KAlert"),B=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(B,{"action-button-disabled":O.value,class:"kong-ui-entities-add-to-groups-modal","data-testid":"add-to-group-modal",title:e.unref(c)("consumer_groups.consumers.add.title"),visible:o.visible,onCancel: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(d,{modelValue:s.value,"onUpdate:modelValue":k[0]||(k[0]=L=>s.value=L),autosuggest:"","data-testid":"add-to-groups-multiselect","dropdown-footer-text":Q.value?e.unref(c)("consumer_groups.consumers.add.footer"):void 0,items:A.value,label:e.unref(c)("consumer_groups.consumers.add.consumer_groups_label"),loading:e.unref(R),placeholder:e.unref(c)("consumer_groups.consumers.add.consumer_group_placeholder"),readonly:O.value,required:"",width:"100%",onQueryChange:e.unref(b)},null,8,["modelValue","dropdown-footer-text","items","label","loading","placeholder","readonly","onQueryChange"]),w.value||M.value||$.value.length?(e.openBlock(),e.createElementBlock("div",xe,[e.createVNode(h,{appearance:"danger"},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(e.unref(c)("consumer_groups.errors.add")),1),$.value.length?(e.openBlock(),e.createElementBlock("ul",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(L,re)=>(e.openBlock(),e.createElementBlock("li",{key:re},e.toDisplayString(L),1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(w.value||M.value),1)]),_:1})])):e.createCommentVNode("",!0)])]),_:1},8,["action-button-disabled","title","visible"])}}}),ie=(o,S)=>{const c=o.__vccOpts||o;for(const[r,g]of S)c[r]=g;return c},Ve=ie(Ee,[["__scopeId","data-v-4260ce03"]]),Ne={class:"kong-ui-entities-consumer-groups-list"},Be={key:1},$e=ie(e.defineComponent({__name:"ConsumerGroupList",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||!o.createRoute||!o.getViewRoute||!o.getEditRoute||o.app==="kongManager"&&!o.isExactMatch&&!o.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","add:success","remove:success"],setup(o,{emit:S}){var ye;const c=S,r=o,{i18nT:g,i18n:{t:i}}=se.useI18n(),s=me.useRouter(),{axiosInstance:b}=f.useAxios((ye=r.config)==null?void 0:ye.axiosRequestConfig),R=e.ref(1),E=e.computed(()=>!!r.config.consumerId),Z=e.computed(()=>E.value?"kong-ui-entities-consumer-groups-list-in-consumer-page":"kong-ui-entities-consumer-groups-list"),v=e.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),D={name:{label:i("consumer_groups.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1}};r.config.app==="kongManager"&&(D.consumers_count={label:i("consumer_groups.list.table_headers.consumers_count"),searchable:!1,sortable:!1}),D.tags={label:i("consumer_groups.list.table_headers.tags"),sortable:!1};const M=D,ee=n=>({"data-testid":n.username??n.custom_id??n.id}),Q=e.computed(()=>{var m,C,V,K;let n=`${r.config.apiBaseUrl}${q.list[r.config.app][E.value?"forConsumer":"all"]}`;return r.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||"").replace(/{consumerId}/gi,((C=r.config)==null?void 0:C.consumerId)||""):r.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(V=r.config)!=null&&V.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((K=r.config)==null?void 0:K.consumerId)||"")),n}),A=e.ref(""),H=e.computed(()=>{const n=r.config.app==="konnect"||r.config.isExactMatch;return n?{isExactMatch:n,fields:{username:D.name,id:{label:i("consumer_groups.list.table_headers.id")}},placeholder:i("consumer_groups.search.placeholder")}:{isExactMatch:n,fields:{name:D.name},schema:r.config.filterSchema}}),oe=e.computed(()=>r.config.app==="konnect"&&A.value?"consumer_group":E.value&&!r.config.paginatedEndpoint?"consumer_groups":void 0),{fetcher:P,fetcherState:O}=f.useFetcher(r.config,Q.value,oe),w=()=>{A.value=""},te=()=>{R.value++},j=e.ref(null),J=e.ref(!1),$=(n,m)=>{const C=n.id;if(!m(C)){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:C})})},z=(n,m)=>{const C=JSON.stringify(n);if(!m(C)){c("copy:error",{entity:n,message:i("consumer_groups.errors.copy")});return}c("copy:success",{entity:n,message:i("consumer_groups.copy.success_brief")})},U=async n=>{var C;await((C=r.canRetrieve)==null?void 0:C.call(r,n))&&s.push(r.config.getViewRoute(n.id))},p=n=>({label:i("consumer_groups.actions.view"),to:r.config.getViewRoute(n)}),k=n=>({label:i("consumer_groups.actions.edit"),to:r.config.getEditRoute(n)}),d=e.ref(void 0),h=e.ref(!1),B=e.ref(!1),L=e.ref(""),re=f.useDeleteUrlBuilder(r.config,Q.value),ue=n=>{d.value=n,h.value=!0},ae=()=>{h.value=!1},ce=async()=>{var n,m,C;if((n=d.value)!=null&&n.id){B.value=!0;try{await b.delete(re(d.value.id)),B.value=!1,h.value=!1,R.value++,c("delete:success",d.value)}catch(V){L.value=((C=(m=V.response)==null?void 0:m.data)==null?void 0:C.message)||V.message||i("consumer_groups.errors.delete"),c("error",V)}finally{B.value=!1}}},X=e.ref(!1),t=()=>{X.value=!0},a=()=>{X.value=!1},_=(n,m)=>{m||a(),R.value++,c("add:success",n)},u=()=>{E.value&&t()},l=e.ref(void 0),x=e.ref(!1),F=e.ref(""),I=n=>{l.value=n,x.value=!0},W=()=>{x.value=!1,l.value=void 0},le=e.computed(()=>{var m,C,V,K;let n=`${r.config.apiBaseUrl}${q.list[r.config.app].oneForConsumer}`;return r.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||"").replace(/{consumerId}/gi,((C=r.config)==null?void 0:C.consumerId)||""):r.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(V=r.config)!=null&&V.workspace?`/${r.config.workspace}`:"").replace(/{consumerId}/gi,((K=r.config)==null?void 0:K.consumerId)||"")),n}),fe=e.ref(!1),Ke=async()=>{if(l.value){fe.value=!0;try{const n=le.value.replace(/{consumerGroupId}/gi,l.value.id);await b.delete(n),c("remove:success",l.value),W(),R.value++}catch(n){F.value=n.message||i("consumer_groups.errors.delete"),c("error",n)}finally{fe.value=!1}}},ge=e.ref(!1);e.watch(O,n=>{var m,C,V,K;if(Array.isArray((m=n==null?void 0:n.response)==null?void 0:m.data)&&(ge.value=n.response.data.length>0),n.status===f.FetcherStatus.NoRecords?J.value=!0:J.value=!1,n.status===f.FetcherStatus.Error){j.value={title:i("consumer_groups.errors.general")},(K=(V=(C=n.error)==null?void 0:C.response)==null?void 0:V.data)!=null&&K.message&&(j.value.message=n.error.response.data.message),c("error",n.error);return}j.value=null});const de=e.ref({ctaPath:E.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=E.value?i("consumer_groups.list.empty_state.title_for_consumer"):i("consumer_groups.list.empty_state.title"),de.value.ctaText=E.value?i("consumer_groups.actions.add_to_group"):i("consumer_groups.actions.create"))}),(n,m)=>{const C=e.resolveComponent("KButton"),V=e.resolveComponent("KBadge"),K=e.resolveComponent("KTruncate"),ne=e.resolveComponent("KDropdownItem"),he=e.resolveComponent("KClipboardProvider"),Se=e.resolveComponent("KPrompt");return e.openBlock(),e.createElementBlock("div",Ne,[e.createVNode(e.unref(f.EntityBaseTable),{"cache-identifier":o.cacheIdentifier,"disable-pagination":E.value&&!o.config.paginatedEndpoint,"disable-sorting":v.value,"empty-state-options":de.value,"enable-entity-actions":"","error-message":j.value,fetcher:e.unref(P),"fetcher-cache-key":R.value,"hide-toolbar":J.value,"pagination-type":"offset","preferences-storage-key":Z.value,query:A.value,"row-attributes":ee,"table-headers":e.unref(M),onClearSearchInput:w,"onClick:row":m[3]||(m[3]=y=>U(y)),onEmptyStateCtaClicked:u,onSort:te},{"toolbar-filter":e.withCtx(()=>[E.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(f.EntityFilter),{key:0,modelValue:A.value,"onUpdate:modelValue":m[0]||(m[0]=y=>A.value=y),config:H.value},null,8,["modelValue","config"]))]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!o.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>o.canCreate()},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(C,{appearance:"primary","data-testid":"toolbar-add-consumer-group",size:o.useActionOutside?"medium":"large",to:o.config.consumerId?void 0:o.config.createRoute,onClick:m[1]||(m[1]=()=>o.config.consumerId?t():void 0)},{default:e.withCtx(()=>[e.createVNode(e.unref(_e.AddIcon)),e.createTextVNode(" "+e.toDisplayString(o.config.consumerId?e.unref(i)("consumer_groups.actions.add_to_group"):e.unref(i)("consumer_groups.list.toolbar_actions.new_consumer_group")),1)]),_:1},8,["size","to"]),[[e.vShow,ge.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:e.withCtx(({rowValue:y})=>[e.createElementVNode("b",null,e.toDisplayString(y??"-"),1)]),consumers_count:e.withCtx(({rowValue:y})=>[e.createTextVNode(e.toDisplayString(y??"-"),1)]),tags:e.withCtx(({rowValue:y})=>[(y==null?void 0:y.length)>0?(e.openBlock(),e.createBlock(K,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y,Y=>(e.openBlock(),e.createBlock(V,{key:Y,onClick:m[2]||(m[2]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Y),1)]),_:2},1024))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",Be,"-"))]),actions:e.withCtx(({row:y})=>[e.createVNode(he,null,{default:e.withCtx(({copyToClipboard:Y})=>[e.createVNode(ne,{"data-testid":"action-entity-copy-id",onClick:Re=>$(y,Y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("consumer_groups.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(he,null,{default:e.withCtx(({copyToClipboard:Y})=>[e.createVNode(ne,{"data-testid":"action-entity-copy-json",onClick:Re=>z(y,Y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("consumer_groups.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>o.canRetrieve(y)},{default:e.withCtx(()=>[e.createVNode(ne,{"data-testid":"action-entity-view","has-divider":"",item:p(y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>o.canEdit(y)},{default:e.withCtx(()=>[e.createVNode(ne,{"data-testid":"action-entity-edit",item:k(y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>o.canDelete(y)},{default:e.withCtx(()=>[e.createVNode(ne,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:()=>o.config.consumerId?I(y):ue(y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.config.consumerId?e.unref(i)("consumer_groups.actions.exit"):e.unref(i)("consumer_groups.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-pagination","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","hide-toolbar","preferences-storage-key","query","table-headers"]),e.createVNode(e.unref(f.EntityDeleteModal),{"action-pending":B.value,"data-testid":"delete-consumer-group-modal",description:e.unref(i)("consumer_groups.delete.description"),"entity-name":d.value&&(d.value.name||d.value.id),"entity-type":e.unref(f.EntityTypes).ConsumerGroup,error:L.value,title:e.unref(i)("consumer_groups.delete.title"),visible:h.value,onCancel:ae,onProceed:ce},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"]),o.config.consumerId?(e.openBlock(),e.createBlock(Ve,{key:0,config:o.config,"data-testid":"add-to-group-modal",visible:X.value,"onAdd:partialSuccess":m[4]||(m[4]=y=>_(y,!0)),"onAdd:success":m[5]||(m[5]=y=>_(y)),onCancel:a},null,8,["config","visible"])):e.createCommentVNode("",!0),o.config.consumerId&&l.value?(e.openBlock(),e.createBlock(Se,{key:1,"action-button-appearance":"danger","data-testid":"exit-group-modal",title:e.unref(i)("consumer_groups.consumers.exit.title"),visible:x.value,onCancel:W,onProceed:Ke},{default:e.withCtx(()=>[e.createVNode(e.unref(g),{class:"exit-modal-message",keypath:o.config.consumerUsername?"consumer_groups.consumers.exit.confirmation":"consumer_groups.consumers.exit.confirmationNoUsername",tag:"p"},e.createSlots({consumerGroup:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(l.value.name||l.value.id),1)]),_:2},[o.config.consumerUsername?{name:"consumer",fn:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(o.config.consumerUsername),1)]),key:"0"}:void 0]),1032,["keypath"]),e.createElementVNode("p",null,e.toDisplayString(e.unref(i)("consumer_groups.consumers.exit.description")),1)]),_:1},8,["title","visible"])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-8bb72c5a"]]),Me={class:"kong-ui-entities-consumer-group-form"},Ge={class:"select-item-container"},Te={class:"select-item-label"},De={key:0,class:"select-item-description"},Ae=ie(e.defineComponent({__name:"ConsumerGroupForm",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||(o==null?void 0:o.app)==="konnect"&&!(o!=null&&o.controlPlaneId)||(o==null?void 0:o.app)==="kongManager"&&typeof(o==null?void 0:o.workspace)!="string"||!(o!=null&&o.cancelRoute))},consumerGroupId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(o,{emit:S}){var ae,ce,X;const c=o,r=S,{i18n:{t:g}}=se.useI18n(),i=me.useRouter(),s=e.reactive({fields:{name:"",tags:"",consumers:[]},errorMessage:"",readonly:!1}),b=e.reactive({name:"",tags:"",consumers:[]}),{debouncedQueryChange:R,loading:E,error:Z,loadItems:v,results:D}=f.useDebouncedFilter(c.config,(ce=q.form[(ae=c.config)==null?void 0:ae.app])==null?void 0:ce.consumersList,"",{fetchedItemsKey:"data",searchKeys:["username","custom_id","id"]}),{axiosInstance:M}=f.useAxios((X=c.config)==null?void 0:X.axiosRequestConfig),{getMessageFromError:ee}=f.useErrors(),Q=f.useValidators(),A=e.computed(()=>D.value.map(t=>({label:t.username||t.custom_id,value:t.id,selected:s.fields.consumers.includes(t.id),data:t}))),H=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?f.EntityBaseFormType.Edit:f.EntityBaseFormType.Create),P=e.computed(()=>!!s.fields.name&&!z.value),O=e.computed(()=>JSON.stringify(s.fields)!==JSON.stringify(b)),w=(t,a="",_="")=>{var l,x,F,I,W,le;let u=`${(l=c.config)==null?void 0:l.apiBaseUrl}${q.form[(x=c.config)==null?void 0:x.app][t]}`;return((F=c.config)==null?void 0:F.app)==="konnect"?u=u.replace(/{controlPlaneId}/gi,((I=c.config)==null?void 0:I.controlPlaneId)||""):((W=c.config)==null?void 0:W.app)==="kongManager"&&(u=u.replace(/\/{workspace}/gi,(le=c.config)!=null&&le.workspace?`/${c.config.workspace}`:"")),u=u.replace(/{id}/gi,a||c.consumerGroupId),(t==="addConsumer"||t==="removeConsumer")&&(u=u.replace(/{consumerId}/gi,_)),u},te=()=>{var t;i.push(((t=c.config)==null?void 0:t.cancelRoute)||{name:"consumer-group-list"})},j=t=>{r("error",t)},J=t=>{r("loading",t)},$=async t=>{var _,u,l,x,F;s.fields.name=((_=t==null?void 0:t.item)==null?void 0:_.name)||((u=t==null?void 0:t.consumer_group)==null?void 0:u.name)||(t==null?void 0:t.name)||"";const a=((l=t==null?void 0:t.item)==null?void 0:l.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=((x=t==null?void 0:t.consumers)==null?void 0:x.map(I=>I.id))||[];else try{const{data:I}=await M.get(w("getConsumers"));s.fields.consumers="consumers"in I?(F=I==null?void 0:I.consumers)==null?void 0:F.map(W=>W.id):[]}catch(I){d(I)}Object.assign(b,s.fields)},z=e.computed(()=>Q.utf8Name(s.fields.name)),U=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(_=>_!=="")}}),p=async(t,a="")=>await M.post(w("addConsumer",a,t),{consumer:t}),k=async(t,a="")=>await M.delete(w("removeConsumer",a,t)),d=t=>{s.errorMessage=ee(t),r("error",t)},h=(t=c.consumerGroupId)=>{Object.assign(b,s.fields),r("update",{...s.fields,id:t})},B=(t,a,_=c.consumerGroupId)=>{const u=t==null?void 0:t.find(l=>l.status!=="fulfilled");u?d({code:u.status,message:a}):h(_)},L=async()=>{let t="";try{const{data:a}=await M.post(w("create"),U.value);t="item"in a?a.item.id:a.id}catch(a){d(a)}if(s.fields.consumers.length>0&&t)try{const a=s.fields.consumers.map(u=>p(u,t)),_=await Promise.allSettled(a);B(_,g("consumer_groups.errors.add_consumer"),t)}catch(a){d(a)}else s.fields.consumers.length===0&&t&&h(t)},re=async()=>{var _;try{((_=c.config)==null?void 0:_.app)==="konnect"?await M.put(w("edit"),U.value):await M.patch(w("edit"),U.value)}catch(u){d(u)}const t=s.fields.consumers.filter(u=>!b.consumers.includes(u)),a=b.consumers.filter(u=>!s.fields.consumers.includes(u));if(a.length===0&&t.length===0)h();else{if(a.length>0)try{const u=a.map(x=>k(x)),l=await Promise.allSettled(u);B(l,g("consumer_groups.errors.remove_consumer"))}catch(u){d(u)}if(t.length>0)try{const u=t.map(x=>p(x)),l=await Promise.allSettled(u);B(l,g("consumer_groups.errors.add_consumer"))}catch(u){d(u)}}},ue=async()=>{try{s.readonly=!0,oe.value===f.EntityBaseFormType.Create?await L():await re()}finally{s.readonly=!1}};return e.onBeforeMount(async()=>{await v()}),(t,a)=>{const _=e.resolveComponent("KInput"),u=e.resolveComponent("KMultiselect");return e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(e.unref(f.EntityBaseForm),{"can-submit":P.value&&O.value,config:o.config,"edit-id":o.consumerGroupId,"entity-type":e.unref(f.SupportedEntityType).ConsumerGroup,"error-message":s.errorMessage||e.unref(Z)||z.value,"fetch-url":H.value,"form-fields":U.value,"is-readonly":s.readonly,onCancel:te,"onFetch:error":a[3]||(a[3]=l=>j(l)),"onFetch:success":$,onLoading:a[4]||(a[4]=l=>J(l)),onSubmit:ue},{default:e.withCtx(()=>[e.createVNode(e.unref(f.EntityFormSection),{description:e.unref(g)("consumer_groups.form.general_info.description"),title:e.unref(g)("consumer_groups.form.general_info.title")},{default:e.withCtx(()=>[e.createVNode(_,{modelValue:s.fields.name,"onUpdate:modelValue":a[0]||(a[0]=l=>s.fields.name=l),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-group-form-name",label:e.unref(g)("consumer_groups.form.fields.name.label"),placeholder:e.unref(g)("consumer_groups.form.fields.name.placeholder"),required:"",type:"text"},null,8,["modelValue","label","placeholder"]),e.createVNode(_,{modelValue:s.fields.tags,"onUpdate:modelValue":a[1]||(a[1]=l=>s.fields.tags=l),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-group-form-tags",help:e.unref(g)("consumer_groups.form.fields.tags.help"),label:e.unref(g)("consumer_groups.form.fields.tags.label"),"label-attributes":{info:e.unref(g)("consumer_groups.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(g)("consumer_groups.form.fields.tags.placeholder"),type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder"])]),_:1},8,["description","title"]),e.createVNode(e.unref(f.EntityFormSection),{description:e.unref(g)("consumer_groups.form.consumers.description"),"has-divider":"",title:e.unref(g)("consumer_groups.form.consumers.title")},{default:e.withCtx(()=>[e.createVNode(u,{modelValue:s.fields.consumers,"onUpdate:modelValue":a[2]||(a[2]=l=>s.fields.consumers=l),appearance:"select",autosuggest:"",items:A.value,label:e.unref(g)("consumer_groups.form.fields.consumers.label"),loading:e.unref(E),placeholder:e.unref(g)("consumer_groups.form.fields.consumers.placeholder"),width:"auto",onQueryChange:e.unref(R)},{"item-template":e.withCtx(({item:l})=>{var x,F,I;return[e.createElementVNode("div",Ge,[e.createElementVNode("div",Te,e.toDisplayString(l.label),1),(x=l==null?void 0:l.data)!=null&&x.username&&((F=l==null?void 0:l.data)!=null&&F.custom_id)?(e.openBlock(),e.createElementBlock("div",De,e.toDisplayString((I=l==null?void 0:l.data)==null?void 0:I.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-dfa56d62"]]),Pe={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 S=o,{i18n:{t:c}}=se.useI18n(),r=e.computed(()=>q.form[S.config.app].edit),g=e.ref({id:{},name:{},created_at:{},updated_at:{},tags:{tooltip:c("consumer_groups.form.fields.tags.tooltip")}});return(i,s)=>(e.openBlock(),e.createElementBlock("div",Pe,[e.createVNode(e.unref(f.EntityBaseConfigCard),{config:o.config,"config-card-doc":o.configCardDoc,"config-schema":g.value,"data-key":"consumer_group","entity-type":e.unref(f.SupportedEntityType).ConsumerGroup,"fetch-url":r.value,"hide-title":o.hideTitle,"onFetch:error":s[0]||(s[0]=b=>i.$emit("fetch:error",b)),"onFetch:success":s[1]||(s[1]=b=>i.$emit("fetch:success",b)),onLoading:s[2]||(s[2]=b=>i.$emit("loading",b))},null,8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])]))}});N.ConsumerGroupConfigCard=Fe,N.ConsumerGroupForm=Ae,N.ConsumerGroupList=$e,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.config-card-fieldset[data-v-68ca83ec]{border:solid 1px #e0e4ea;border-radius:4px;margin-bottom:8px;margin-top:4px}.config-card-fieldset-title[data-v-68ca83ec]{font-size:14px;padding:0 8px;width:auto}fieldset.config-card-fieldset .config-card-details-row{width:unset}.config-card-json-item .config-card-details-row,fieldset.config-card-fieldset .config-card-details-row{margin:0 16px}.config-card-json-item .config-card-details-row:last-of-type,fieldset.config-card-fieldset .config-card-details-row:last-of-type{border-bottom:none}[data-v-c96811e5] .k-button.navigation-button{font-size:14px;font-weight:400}.config-card-details-row[data-v-711ebcf2]{align-items:center;border-bottom:var(--2f5b0492);display:var(--5d59c22c);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-711ebcf2]{width:var(--aa41a894)}.config-card-details-row .config-card-details-label label[data-v-711ebcf2]{color:#3a3f51}.config-card-details-row .config-card-details-value[data-v-711ebcf2]{width:var(--aa3d1cde)}.config-card-details-row .config-card-details-value .truncated[data-v-711ebcf2]{display:inline-block;line-height:initial;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-value span.attrs-data-text[data-v-711ebcf2]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-711ebcf2] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-711ebcf2]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-711ebcf2]{margin-right:4px}.config-card-details-row[data-v-711ebcf2] .k-label{margin-bottom:0}.config-card-details-row[data-v-711ebcf2] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-711ebcf2] .config-card-details-row{width:auto}.json-content.k-code-block{border-top-left-radius:0;border-top-right-radius:0}.json-endpoint{align-items:baseline;background-color:#000933;border-bottom:1px solid rgba(255,255,255,.2);border-top-left-radius:8px;border-top-right-radius:8px;display:flex;padding:8px 0 8px 12px}.json-endpoint .k-code-block{flex:auto;z-index:2}.json-endpoint .k-code-block .code-block-content{padding-bottom:0;padding-top:0}.json-endpoint .k-code-block .code-block-secondary-actions{margin-top:0!important}.json-endpoint code{direction:rtl;max-width:var(--454fa8c4);overflow:hidden!important;text-align:left;text-overflow:ellipsis;white-space:nowrap}.config-card-prop-section-title[data-v-d15be7fe]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card .config-card-actions[data-v-85381f68]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-85381f68]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-85381f68]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-85381f68] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-85381f68]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-94d27e50]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form .form-actions[data-v-94d27e50]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.kong-ui-entity-base-form .form-actions[data-v-94d27e50] .k-button:last-of-type,.kong-ui-entity-base-form .form-actions[data-v-94d27e50] .k-button:nth-last-of-type(2){margin-left:16px}.kong-ui-entity-base-form[data-v-94d27e50] .k-slideout-title{color:#000933!important;font-size:24px!important;font-weight:700!important;line-height:32px!important;margin-bottom:16px!important}.kong-ui-entity-base-form[data-v-94d27e50] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-94d27e50] .tab-item>div.tab-link.has-panels{color:#6c7489!important;font-size:14px!important;font-weight:700!important;line-height:24px!important}.kong-ui-entity-base-form[data-v-94d27e50] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.content-wrapper[data-v-b252463e] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-765e475b]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-765e475b]{margin-left:auto}.kong-ui-entity-base-table :deep(.k-table){table-layout:fixed}.kong-ui-entity-delete-modal .message[data-v-4361d622],.kong-ui-entity-delete-modal .description[data-v-4361d622]{line-height:24px;margin:0}.kong-ui-entity-delete-modal .message strong[data-v-4361d622]{font-weight:600}.kong-ui-entity-delete-modal .description[data-v-4361d622]{margin-top:32px}.kong-ui-entity-delete-error[data-v-4361d622]{margin-bottom:16px}.kong-ui-entity-filter-input[data-v-10fa27a5]{width:100%}.kong-ui-entity-filter-clear[data-v-10fa27a5]{cursor:pointer}.kong-ui-entity-filter[data-v-10fa27a5]{display:flex;position:relative}.kong-ui-entity-filter[data-v-10fa27a5] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-10fa27a5] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-10fa27a5]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-10fa27a5]{background-color:#fff;border:1px solid #afb7c5;border-radius:4px;box-shadow:0 4px 20px #e0e4ea;left:0;margin-top:16px;padding:8px 0 12px;position:absolute;top:100%;width:300px;z-index:1060}.kong-ui-entity-filter-menu-item[data-v-10fa27a5]{border-bottom:1px solid #e0e4ea;color:#6c7489;font-size:12px;font-weight:400;line-height:16px;list-style:none;margin:0 20px;padding:16px 0;position:relative;white-space:nowrap}.menu-item-title[data-v-10fa27a5]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-10fa27a5]{color:#232633}.menu-item-expand-icon[data-v-10fa27a5]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-10fa27a5]{transform:rotate(180deg)}.menu-item-indicator[data-v-10fa27a5]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-10fa27a5]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-10fa27a5] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-10fa27a5] .k-input{width:100%}.menu-item-body[data-v-10fa27a5] .k-select-input .input{font-size:12px}.menu-item-body[data-v-10fa27a5] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-10fa27a5]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-10fa27a5]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-10fa27a5]{padding:12px 20px 0}fieldset[data-v-b1f74200]{margin:0;min-width:0;padding:0}.kong-ui-entity-form-section[data-v-b1f74200]{border:0}.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{column-gap:16px;display:flex;flex-direction:column;padding-bottom:64px;row-gap:12px;width:100%}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{flex-direction:row}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{flex:1}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{max-width:350px}.kong-ui-entity-form-section .form-section-wrapper .form-section-info.sticky[data-v-b1f74200]{height:fit-content;margin-bottom:16px;position:sticky;top:16px}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-title[data-v-b1f74200]{color:#000933;font-size:16px;font-weight:700;line-height:20px;margin-bottom:8px;margin-top:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description p[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200] p{color:#000933;font-size:14px;font-weight:400;line-height:20px;margin:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-footer[data-v-b1f74200]{margin-top:32px}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]{flex:1}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]>*:not(:first-child){margin-top:24px}.kong-ui-entity-form-section.has-divider .form-section-wrapper[data-v-b1f74200]{border-bottom:1px solid #e0e4ea}.kong-ui-public-entity-link[data-v-60e3ef7c]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-60e3ef7c]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c]{display:flex}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-60e3ef7c]{display:inline-block;font-weight:400;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kong-ui-public-entity-link .copy-uuid-tooltip[data-v-60e3ef7c]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-60e3ef7c]{margin-left:2px}.kong-ui-entities-add-to-groups-modal .add-to-group-cta-text[data-v-4260ce03]{margin-top:0}.kong-ui-entities-add-to-groups-modal .add-to-group-form-container[data-v-4260ce03]{margin-bottom:20px}.kong-ui-entities-add-to-groups-modal .add-to-group-form-container .kong-ui-entity-add-to-groups-error[data-v-4260ce03]{margin-top:16px}.kong-ui-entities-consumer-groups-list[data-v-8bb72c5a]{width:100%}.kong-ui-entities-consumer-groups-list .kong-ui-entity-filter-input[data-v-8bb72c5a]{margin-right:12px}.kong-ui-entities-consumer-groups-list .exit-modal-message[data-v-8bb72c5a]{margin-top:0}.kong-ui-entities-consumer-group-form[data-v-6b48d0fc]{width:100%}@media screen and (min-width: 1280px){.kong-ui-entities-consumer-group-form[data-v-6b48d0fc] .form-section-wrapper{column-gap:64px}}.kong-ui-entities-consumer-group-form .select-item-container .select-item-label[data-v-6b48d0fc]{font-weight:600}.kong-ui-entities-consumer-group-form .select-item-container .select-item-description[data-v-6b48d0fc]{color:#6c7489;font-size:12px}
|
|
1
|
+
.config-card-fieldset[data-v-68ca83ec]{border:solid 1px #e0e4ea;border-radius:4px;margin-bottom:8px;margin-top:4px}.config-card-fieldset-title[data-v-68ca83ec]{font-size:14px;padding:0 8px;width:auto}fieldset.config-card-fieldset .config-card-details-row{width:unset}.config-card-json-item .config-card-details-row,fieldset.config-card-fieldset .config-card-details-row{margin:0 16px}.config-card-json-item .config-card-details-row:last-of-type,fieldset.config-card-fieldset .config-card-details-row:last-of-type{border-bottom:none}[data-v-c96811e5] .k-button.navigation-button{font-size:14px;font-weight:400}.config-card-details-row[data-v-711ebcf2]{align-items:center;border-bottom:var(--2f5b0492);display:var(--5d59c22c);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-711ebcf2]{width:var(--aa41a894)}.config-card-details-row .config-card-details-label label[data-v-711ebcf2]{color:#3a3f51}.config-card-details-row .config-card-details-value[data-v-711ebcf2]{width:var(--aa3d1cde)}.config-card-details-row .config-card-details-value .truncated[data-v-711ebcf2]{display:inline-block;line-height:initial;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-value span.attrs-data-text[data-v-711ebcf2]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-711ebcf2] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-711ebcf2]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-711ebcf2]{margin-right:4px}.config-card-details-row[data-v-711ebcf2] .k-label{margin-bottom:0}.config-card-details-row[data-v-711ebcf2] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-711ebcf2] .config-card-details-row{width:auto}.json-content.k-code-block{border-top-left-radius:0;border-top-right-radius:0}.json-endpoint{align-items:baseline;background-color:#000933;border-bottom:1px solid rgba(255,255,255,.2);border-top-left-radius:8px;border-top-right-radius:8px;display:flex;padding:8px 0 8px 12px}.json-endpoint .k-code-block{flex:auto;z-index:2}.json-endpoint .k-code-block .code-block-content{padding-bottom:0;padding-top:0}.json-endpoint .k-code-block .code-block-secondary-actions{margin-top:0!important}.json-endpoint code{direction:rtl;max-width:var(--454fa8c4);overflow:hidden!important;text-align:left;text-overflow:ellipsis;white-space:nowrap}.config-card-prop-section-title[data-v-d15be7fe]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card .config-card-actions[data-v-d957ab89]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-d957ab89]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-d957ab89]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-d957ab89] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-d957ab89]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-6210a67a]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form .form-actions[data-v-6210a67a]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.kong-ui-entity-base-form .form-actions[data-v-6210a67a] .k-button:last-of-type,.kong-ui-entity-base-form .form-actions[data-v-6210a67a] .k-button:nth-last-of-type(2){margin-left:16px}.kong-ui-entity-base-form[data-v-6210a67a] .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-6210a67a] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-6210a67a] .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-6210a67a] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.content-wrapper[data-v-b252463e] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-765e475b]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-765e475b]{margin-left:auto}.kong-ui-entity-base-table :deep(.k-table){table-layout:fixed}.kong-ui-entity-delete-modal .message[data-v-4361d622],.kong-ui-entity-delete-modal .description[data-v-4361d622]{line-height:24px;margin:0}.kong-ui-entity-delete-modal .message strong[data-v-4361d622]{font-weight:600}.kong-ui-entity-delete-modal .description[data-v-4361d622]{margin-top:32px}.kong-ui-entity-delete-error[data-v-4361d622]{margin-bottom:16px}.kong-ui-entity-filter-input[data-v-10fa27a5]{width:100%}.kong-ui-entity-filter-clear[data-v-10fa27a5]{cursor:pointer}.kong-ui-entity-filter[data-v-10fa27a5]{display:flex;position:relative}.kong-ui-entity-filter[data-v-10fa27a5] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-10fa27a5] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-10fa27a5]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-10fa27a5]{background-color:#fff;border:1px solid #afb7c5;border-radius:4px;box-shadow:0 4px 20px #e0e4ea;left:0;margin-top:16px;padding:8px 0 12px;position:absolute;top:100%;width:300px;z-index:1060}.kong-ui-entity-filter-menu-item[data-v-10fa27a5]{border-bottom:1px solid #e0e4ea;color:#6c7489;font-size:12px;font-weight:400;line-height:16px;list-style:none;margin:0 20px;padding:16px 0;position:relative;white-space:nowrap}.menu-item-title[data-v-10fa27a5]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-10fa27a5]{color:#232633}.menu-item-expand-icon[data-v-10fa27a5]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-10fa27a5]{transform:rotate(180deg)}.menu-item-indicator[data-v-10fa27a5]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-10fa27a5]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-10fa27a5] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-10fa27a5] .k-input{width:100%}.menu-item-body[data-v-10fa27a5] .k-select-input .input{font-size:12px}.menu-item-body[data-v-10fa27a5] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-10fa27a5]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-10fa27a5]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-10fa27a5]{padding:12px 20px 0}fieldset[data-v-b1f74200]{margin:0;min-width:0;padding:0}.kong-ui-entity-form-section[data-v-b1f74200]{border:0}.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{column-gap:16px;display:flex;flex-direction:column;padding-bottom:64px;row-gap:12px;width:100%}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{flex-direction:row}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{flex:1}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{max-width:350px}.kong-ui-entity-form-section .form-section-wrapper .form-section-info.sticky[data-v-b1f74200]{height:fit-content;margin-bottom:16px;position:sticky;top:16px}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-title[data-v-b1f74200]{color:#000933;font-size:16px;font-weight:700;line-height:20px;margin-bottom:8px;margin-top:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description p[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200] p{color:#000933;font-size:14px;font-weight:400;line-height:20px;margin:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-footer[data-v-b1f74200]{margin-top:32px}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]{flex:1}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]>*:not(:first-child){margin-top:24px}.kong-ui-entity-form-section.has-divider .form-section-wrapper[data-v-b1f74200]{border-bottom:1px solid #e0e4ea}.kong-ui-public-entity-link[data-v-60e3ef7c]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-60e3ef7c]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c]{display:flex}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-60e3ef7c]{display:inline-block;font-weight:400;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kong-ui-public-entity-link .copy-uuid-tooltip[data-v-60e3ef7c]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-60e3ef7c]{margin-left:2px}.kong-ui-entities-add-to-groups-modal .add-to-group-cta-text[data-v-4260ce03]{margin-top:0}.kong-ui-entities-add-to-groups-modal .add-to-group-form-container[data-v-4260ce03]{margin-bottom:20px}.kong-ui-entities-add-to-groups-modal .add-to-group-form-container .kong-ui-entity-add-to-groups-error[data-v-4260ce03]{margin-top:16px}.kong-ui-entities-consumer-groups-list[data-v-8bb72c5a]{width:100%}.kong-ui-entities-consumer-groups-list .kong-ui-entity-filter-input[data-v-8bb72c5a]{margin-right:12px}.kong-ui-entities-consumer-groups-list .exit-modal-message[data-v-8bb72c5a]{margin-top:0}.kong-ui-entities-consumer-group-form[data-v-dfa56d62]{width:100%}@media screen and (min-width: 1280px){.kong-ui-entities-consumer-group-form[data-v-dfa56d62] .form-section-wrapper{column-gap:64px}}.kong-ui-entities-consumer-group-form .select-item-container .select-item-label[data-v-dfa56d62]{font-weight:600}.kong-ui-entities-consumer-group-form .select-item-container .select-item-description[data-v-dfa56d62]{color:#6c7489;font-size:12px}
|
|
@@ -24,14 +24,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
24
24
|
type: BooleanConstructor;
|
|
25
25
|
default: boolean;
|
|
26
26
|
};
|
|
27
|
-
/**
|
|
28
|
-
* Enable display of Terraform code
|
|
29
|
-
* Guarded by FF: khcp-12445-terraform-config-details
|
|
30
|
-
*/
|
|
31
|
-
enableTerraform: {
|
|
32
|
-
type: BooleanConstructor;
|
|
33
|
-
default: boolean;
|
|
34
|
-
};
|
|
35
27
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
28
|
loading: (isLoading: boolean) => void;
|
|
37
29
|
"fetch:error": (error: AxiosError<unknown, any>) => void;
|
|
@@ -58,20 +50,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
58
50
|
type: BooleanConstructor;
|
|
59
51
|
default: boolean;
|
|
60
52
|
};
|
|
61
|
-
/**
|
|
62
|
-
* Enable display of Terraform code
|
|
63
|
-
* Guarded by FF: khcp-12445-terraform-config-details
|
|
64
|
-
*/
|
|
65
|
-
enableTerraform: {
|
|
66
|
-
type: BooleanConstructor;
|
|
67
|
-
default: boolean;
|
|
68
|
-
};
|
|
69
53
|
}>> & {
|
|
70
54
|
onLoading?: ((isLoading: boolean) => any) | undefined;
|
|
71
55
|
"onFetch:success"?: ((data: Record<string, any>) => any) | undefined;
|
|
72
56
|
"onFetch:error"?: ((error: AxiosError<unknown, any>) => any) | undefined;
|
|
73
57
|
}, {
|
|
74
|
-
enableTerraform: boolean;
|
|
75
58
|
configCardDoc: string;
|
|
76
59
|
hideTitle: boolean;
|
|
77
60
|
}, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsumerGroupConfigCard.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ConsumerGroupConfigCard.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConsumerGroupConfigCard.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ConsumerGroupConfigCard.vue"],"names":[],"mappings":"AA+EA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAEnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,KAAK,EAAE,oCAAoC,EAAE,gCAAgC,EAAoC,MAAM,UAAU,CAAA;AAIxI,OAAO,gDAAgD,CAAA;;IAuNrD,oHAAoH;;cAElG,QAAQ,CAAC,gCAAgC,GAAG,oCAAoC,CAAC;;4BAE7E,gCAAgC,GAAG,oCAAoC,KAAG,OAAO;;IAQvG;;OAEG;;;;;;IAMH;;OAEG;;;;;;;;;;IAtBH,oHAAoH;;cAElG,QAAQ,CAAC,gCAAgC,GAAG,oCAAoC,CAAC;;4BAE7E,gCAAgC,GAAG,oCAAoC,KAAG,OAAO;;IAQvG;;OAEG;;;;;;IAMH;;OAEG;;;;;;;;;;;;;AA7BL,wBAmCG"}
|
|
@@ -15,14 +15,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
15
15
|
required: false;
|
|
16
16
|
default: string;
|
|
17
17
|
};
|
|
18
|
-
/**
|
|
19
|
-
* Enable display of Terraform code
|
|
20
|
-
* Guarded by FF: khcp-12445-terraform-config-details
|
|
21
|
-
*/
|
|
22
|
-
enableTerraform: {
|
|
23
|
-
type: BooleanConstructor;
|
|
24
|
-
default: boolean;
|
|
25
|
-
};
|
|
26
18
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
27
19
|
update: (data: ConsumerGroupData) => void;
|
|
28
20
|
error: (error: AxiosError<unknown, any>) => void;
|
|
@@ -40,21 +32,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
40
32
|
required: false;
|
|
41
33
|
default: string;
|
|
42
34
|
};
|
|
43
|
-
/**
|
|
44
|
-
* Enable display of Terraform code
|
|
45
|
-
* Guarded by FF: khcp-12445-terraform-config-details
|
|
46
|
-
*/
|
|
47
|
-
enableTerraform: {
|
|
48
|
-
type: BooleanConstructor;
|
|
49
|
-
default: boolean;
|
|
50
|
-
};
|
|
51
35
|
}>> & {
|
|
52
36
|
onError?: ((error: AxiosError<unknown, any>) => any) | undefined;
|
|
53
37
|
onLoading?: ((isLoading: boolean) => any) | undefined;
|
|
54
38
|
onUpdate?: ((data: ConsumerGroupData) => any) | undefined;
|
|
55
39
|
}, {
|
|
56
40
|
consumerGroupId: string;
|
|
57
|
-
enableTerraform: boolean;
|
|
58
41
|
}, {}>;
|
|
59
42
|
export default _default;
|
|
60
43
|
//# sourceMappingURL=ConsumerGroupForm.vue.d.ts.map
|
|
@@ -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":"AA8YA,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;;IAygBrC,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;;;;;;;;;;;;;AAnBpG,wBA0BG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-consumer-groups",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.33",
|
|
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.6.8",
|
|
27
27
|
"vue": ">= 3.3.13 < 4",
|
|
28
28
|
"vue-router": "^4.3.3",
|
|
29
|
-
"@kong-ui-public/
|
|
30
|
-
"@kong-ui-public/
|
|
29
|
+
"@kong-ui-public/entities-shared": "^3.9.19",
|
|
30
|
+
"@kong-ui-public/i18n": "^2.2.3"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@kong/design-tokens": "1.17.2",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"axios": "^1.7.7",
|
|
37
37
|
"vue": "^3.4.38",
|
|
38
38
|
"vue-router": "^4.4.5",
|
|
39
|
-
"@kong-ui-public/entities-shared": "^3.9.
|
|
39
|
+
"@kong-ui-public/entities-shared": "^3.9.19",
|
|
40
40
|
"@kong-ui-public/i18n": "^2.2.3"
|
|
41
41
|
},
|
|
42
42
|
"repository": {
|