All Downloads are FREE. Search and download functionalities are using the official Maven repository.

theme.keycloak.v2.admin.resources.assets.KeyProviderForm-BJnAxavo.js Maven / Gradle / Ivy

There is a newer version: 26.0.7
Show newest version
import{jsxs as p,Fragment as I,jsx as i}from"react/jsx-runtime";import{a as y,d as K,P as C,dJ as E,u as S,f as T,b as w,dK as d,g as V,w as k,F as q,y as u,A as H,i as v,k as f}from"./main-C7ps2lmX.js";import{D as O}from"./DynamicComponents-DvaX3FJx.js";import{F as j}from"./FormAccess-DyLNkc18.js";import{V as x}from"./ViewHeader-B7eeFzFA.js";import{u as P}from"./useParams-B67lSY02.js";import"react";import"react-dom";import"./ClientSelect-B9UqjyP6.js";import"./FileUpload-CumNwlWc.js";import"./CodeEditor-C-nZkUJx.js";import"./copy-icon-ACZmDH8e.js";import"./EmptyStateFooter-DqmBOP2I.js";import"./EmptyStateActions-DWNUFByn.js";import"./GroupPickerDialog-C09EjRTA.js";import"./PaginatingTableToolbar-Cjsz5Jh4.js";import"./DataListItemRow-BC0LurDd.js";import"./FlexItem-BzZfUnQ1.js";import"./KeySelect-jKxsKqdI.js";import"./useToggle-K3Kx99tM.js";import"./MultiLineInput-DiPNQ1LE.js";import"./AddRoleMappingModal-DW8o4W0z.js";import"./KeycloakDataTable-DbY4la1D.js";import"./Td-D2hVFK0Z.js";import"./grip-vertical-icon-BxF7V59o.js";import"./_baseFlatten-eIEJR-AJ.js";import"./ConfirmDialog-hx7XKLbN.js";import"./filter-icon-DO0QNij3.js";const D=({providerType:t,onClose:o})=>{const{adminClient:a}=S(),{t:r}=y(),{id:s}=P(),{addAlert:c,addError:b}=T(),h=w().componentTypes?.[d]??[],l=V({mode:"onChange"}),{handleSubmit:g,reset:A}=l,F=async e=>{e.config&&Object.entries(e.config).forEach(([n,m])=>e.config[n]=Array.isArray(m)?m:[m]);try{s?(await a.components.update({id:s},{...e,providerType:d}),c(r("saveProviderSuccess"),f.success)):(await a.components.create({...e,providerId:t,providerType:d}),c(r("saveProviderSuccess"),f.success),o?.())}catch(n){b("saveProviderError",n)}};return k(async()=>{if(s)return await a.components.findOne({id:s})},e=>{e&&A({...e})},[]),i(j,{isHorizontal:!0,role:"manage-realm",onSubmit:g(F),children:p(q,{...l,children:[s&&i(u,{name:"id",label:r("providerId"),labelIcon:r("providerIdHelp"),rules:{required:r("required")},readOnly:!0}),i(u,{name:"name",defaultValue:t,label:r("name"),labelIcon:r("keyProviderMapperNameHelp"),rules:{required:r("required")}}),i(O,{properties:h.find(e=>e.id===t)?.properties||[]}),p(H,{children:[i(v,{"data-testid":"add-provider-button",variant:"primary",type:"submit",children:r("save")}),i(v,{onClick:()=>o?.(),variant:"link",children:r("cancel")})]})]})})};function ur(){const{t}=y(),o=P(),a=K();return p(I,{children:[i(x,{titleKey:t("editProvider"),subKey:o.providerType}),i(C,{variant:"light",children:i(D,{...o,onClose:()=>a(E({realm:o.realm,tab:"providers"}))})})]})}export{D as KeyProviderForm,ur as default};
//# sourceMappingURL=KeyProviderForm-BJnAxavo.js.map




© 2015 - 2025 Weber Informatics LLC | Privacy Policy