theme.keycloak.v2.admin.resources.assets.ExtendedHeader-BcI8Gfaz.js Maven / Gradle / Ivy
import{jsxs as D,Fragment as E,jsx as n}from"react/jsx-runtime";import{u as $,a as w,e as b,f as A,aj as x,ab as F,k as a,D as c,ar as P}from"./main-C7ps2lmX.js";import{u}from"./ConfirmDialog-hx7XKLbN.js";import{H as K}from"./SettingsCache-BECJJhg-.js";const N=({provider:m,editMode:d,save:U,noDivider:g=!1})=>{const{adminClient:i}=$(),{t:s}=w(),{id:r}=b(),{addAlert:o,addError:t}=A(),{control:y}=x(),l=F({name:"config.importEnabled",control:y,defaultValue:["true"]})[0],[f,p]=u({titleKey:"userFedUnlinkUsersConfirmTitle",messageKey:"userFedUnlinkUsersConfirm",continueButtonLabel:"unlinkUsers",onConfirm:()=>S()}),[v,C]=u({titleKey:s("removeImportedUsers"),messageKey:s("removeImportedUsersMessage"),continueButtonLabel:"remove",onConfirm:async()=>{try{k(),o(s("removeImportedUsersSuccess"),a.success)}catch(e){t("removeImportedUsersError",e)}}}),k=async()=>{try{r&&await i.userStorageProvider.removeImportedUsers({id:r}),o(s("removeImportedUsersSuccess"),a.success)}catch(e){t("removeImportedUsersError",e)}},h=async()=>{try{if(r){const e=await i.userStorageProvider.sync({id:r,action:"triggerChangedUsersSync"});e.ignored?o(`${e.status}.`,a.warning):o(s("syncUsersSuccess")+`${e.added} users added, ${e.updated} users updated, ${e.removed} users removed, ${e.failed} users failed.`,a.success)}}catch(e){t("syncUsersError",e)}},I=async()=>{try{if(r){const e=await i.userStorageProvider.sync({id:r,action:"triggerFullSync"});e.ignored?o(`${e.status}.`,a.warning):o(s("syncUsersSuccess")+`${e.added} users added, ${e.updated} users updated, ${e.removed} users removed, ${e.failed} users failed.`,a.success)}}catch(e){t("syncUsersError",e)}},S=async()=>{try{r&&await i.userStorageProvider.unlinkUsers({id:r}),o(s("unlinkUsersSuccess"),a.success)}catch(e){t("unlinkUsersError",e)}};return D(E,{children:[n(p,{}),n(C,{}),n(K,{provider:m,noDivider:g,save:U,dropdownItems:[n(c,{onClick:h,isDisabled:l==="false",children:s("syncChangedUsers")},"sync"),n(c,{onClick:I,isDisabled:l==="false",children:s("syncAllUsers")},"syncall"),n(c,{isDisabled:d?d.includes("UNSYNCED"):!1,onClick:f,children:s("unlinkUsers")},"unlink"),n(c,{onClick:v,children:s("removeImported")},"remove"),n(P,{},"separator")]})]})};export{N as E};
//# sourceMappingURL=ExtendedHeader-BcI8Gfaz.js.map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy