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

theme.keycloak.v2.admin.resources.assets.CustomProviderSettings-B0gEaLvT.js Maven / Gradle / Ivy

There is a newer version: 26.0.7
Show newest version
import{jsxs as l,jsx as e}from"react/jsx-runtime";import{a as I,aj as V,F as U,ac as v,ad as b,ae as P,a4 as C,y as f,u as x,d as E,g as H,f as j,c as D,b as O,w as _,P as L,A as z,i as F,L as G,dY as k,S as R,k as q,Q as B}from"./main-C7ps2lmX.js";import{D as Q}from"./DynamicComponents-DvaX3FJx.js";import{F as W}from"./FormAccess-DyLNkc18.js";import{u as Y}from"./useParams-B67lSY02.js";import{E as J}from"./ExtendedHeader-BcI8Gfaz.js";import{S as K}from"./SettingsCache-BECJJhg-.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";import"./ViewHeader-B7eeFzFA.js";import"./isEqual-BWOcMitS.js";const M=()=>{const{t:r}=I(),a=V(),{control:o,watch:t}=a,d=t("config.fullSyncPeriod","-1"),c=t("config.changedSyncPeriod","-1");return l(U,{...a,children:[e(v,{label:r("periodicFullSync"),labelIcon:e(b,{helpText:r("periodicFullSyncHelp"),fieldLabelId:"periodicFullSync"}),fieldId:"kc-periodic-full-sync",hasNoPaddingTop:!0,children:e(P,{name:"config.fullSyncPeriod",defaultValue:"-1",control:o,render:({field:n})=>e(C,{id:"kc-periodic-full-sync","data-testid":"periodic-full-sync",onChange:(m,s)=>{n.onChange(s?"604800":"-1")},isChecked:n.value!=="-1",label:r("on"),labelOff:r("off"),"aria-label":r("periodicFullSync")})})}),d!=="-1"&&e(f,{name:"config.fullSyncPeriod",label:r("fullSyncPeriod"),labelIcon:r("fullSyncPeriodHelp"),type:"number",min:-1,defaultValue:"604800"}),e(v,{label:r("periodicChangedUsersSync"),labelIcon:e(b,{helpText:r("periodicChangedUsersSyncHelp"),fieldLabelId:"periodicChangedUsersSync"}),fieldId:"kc-periodic-changed-users-sync",hasNoPaddingTop:!0,children:e(P,{name:"config.changedSyncPeriod",defaultValue:"-1",control:o,render:({field:n})=>e(C,{id:"kc-periodic-changed-users-sync","data-testid":"periodic-changed-users-sync",onChange:(m,s)=>{n.onChange(s?"86400":"-1")},isChecked:n.value!=="-1",label:r("on"),labelOff:r("off"),"aria-label":r("periodicChangedUsersSync")})})}),c!=="-1"&&e(f,{name:"config.changedSyncPeriod",label:r("changedUsersSyncPeriod"),labelIcon:r("changedUsersSyncHelp"),type:"number",min:-1,defaultValue:"86400"})]})};function Ae(){const{adminClient:r}=x(),{t:a}=I(),{id:o,providerId:t}=Y(),d=E(),c=H({mode:"onChange"}),{reset:n,setValue:m,handleSubmit:s,formState:{isDirty:w}}=c,{addAlert:A,addError:T}=j(),{realm:y,realmRepresentation:N}=D(),g=(O().componentTypes?.["org.keycloak.storage.UserStorageProvider"]||[]).find(i=>i.id===t);_(async()=>{if(o)return await r.components.findOne({id:o})},i=>{if(i)B(i,m);else if(o)throw new Error(a("notFound"))},[]);const h=async i=>{const S=R({...i,config:Object.fromEntries(Object.entries(i.config||{}).map(([p,u])=>[p,Array.isArray(u)?u:[u]])),providerId:t,providerType:"org.keycloak.storage.UserStorageProvider",parentId:N?.id});try{o?await r.components.update({id:o},S):(await r.components.create(S),d(k({realm:y}))),n({...i}),A(a(o?"userProviderSaveSuccess":"createUserProviderSuccess"),q.success)}catch(p){T(o?"userProviderSaveError":"createUserProviderError",p)}};return l(U,{...c,children:[e(J,{provider:t,save:()=>s(h)()}),e(L,{variant:"light",children:l(W,{role:"manage-realm",isHorizontal:!0,className:"keycloak__user-federation__custom-form",onSubmit:s(h),children:[e(f,{name:"name",label:a("uiDisplayName"),labelIcon:a("uiDisplayNameHelp"),rules:{required:a("validateName")}}),e(Q,{properties:g?.properties||[]}),g?.metadata.synchronizable&&e(M,{}),e(K,{form:c,unWrap:!0}),l(z,{children:[e(F,{isDisabled:!w,variant:"primary",type:"submit","data-testid":"custom-save",children:a("save")}),e(F,{variant:"link",component:i=>e(G,{...i,to:k({realm:y})}),"data-testid":"custom-cancel",children:a("cancel")})]})]})})]})}export{Ae as default};
//# sourceMappingURL=CustomProviderSettings-B0gEaLvT.js.map




© 2015 - 2025 Weber Informatics LLC | Privacy Policy