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

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

import{jsxs as p,Fragment as F,jsx as o}from"react/jsx-runtime";import{a as y,d as C,P as E,dI as K,u as S,f as T,b as V,dJ as d,g as j,v as q,F as w,x as u,A as x,h as v,j as f}from"./index-C1LIsRX7.js";import{D as H}from"./DynamicComponents-CIZcko9u.js";import{F as O}from"./FormAccess-BcY70QlP.js";import{V as k}from"./ViewHeader-qjLr6U82.js";import{u as h}from"./useParams-n_2fXkN1.js";import"react";import"react-dom";import"./ClientSelect-BTkwOwGP.js";import"./FileUpload-T43Q4AfB.js";import"./CodeEditor-CIeIZGz7.js";import"./copy-icon-DOS8MmN7.js";import"./EmptyStateFooter-Cm2IMTi1.js";import"./EmptyStateActions-DBSnfkAA.js";import"./GroupPickerDialog-DmX3SBxL.js";import"./PaginatingTableToolbar-CpMLQtqt.js";import"./DataListItemRow-COCiEHyF.js";import"./FlexItem-DCAd8FXq.js";import"./KeySelect-B2uWUd6C.js";import"./useToggle-K3Kx99tM.js";import"./MultiLineInput-AcwuO_FT.js";import"./AddRoleMappingModal-Ds4yp8lg.js";import"./KeycloakDataTable-jyvvxdb8.js";import"./Td-BwjBKSkH.js";import"./grip-vertical-icon-Bnn0MebT.js";import"./_baseFlatten-BHAcGTxk.js";import"./ConfirmDialog-B5qjiAuo.js";import"./filter-icon-BVyMUArZ.js";const D=({providerType:t,onClose:i})=>{const{adminClient:a}=S(),{t:r}=y(),{id:s}=h(),{addAlert:c,addError:P}=T(),b=V().componentTypes?.[d]??[],l=j({mode:"onChange"}),{handleSubmit:g,reset:I}=l,A=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),i?.())}catch(n){P("saveProviderError",n)}};return q(async()=>{if(s)return await a.components.findOne({id:s})},e=>{e&&I({...e})},[]),o(O,{isHorizontal:!0,role:"manage-realm",onSubmit:g(A),children:p(w,{...l,children:[s&&o(u,{name:"id",label:r("providerId"),labelIcon:r("providerIdHelp"),rules:{required:r("required")},readOnly:!0}),o(u,{name:"name",defaultValue:t,label:r("name"),labelIcon:r("keyProviderMapperNameHelp"),rules:{required:r("required")}}),o(H,{properties:b.find(e=>e.id===t)?.properties||[]}),p(x,{children:[o(v,{"data-testid":"add-provider-button",variant:"primary",type:"submit",children:r("save")}),o(v,{onClick:()=>i?.(),variant:"link",children:r("cancel")})]})]})})};function ur(){const{t}=y(),i=h(),a=C();return p(F,{children:[o(k,{titleKey:t("editProvider"),subKey:i.providerType}),o(E,{variant:"light",children:o(D,{...i,onClose:()=>a(K({realm:i.realm,tab:"providers"}))})})]})}export{D as KeyProviderForm,ur as default};
//# sourceMappingURL=KeyProviderForm-D1PF08X3.js.map




© 2015 - 2025 Weber Informatics LLC | Privacy Policy