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

theme.keycloak.v2.admin.resources.assets.RoleForm-a2b5b324.js Maven / Gradle / Ivy

There is a newer version: 25.0.1
Show newest version
import{u as f,Q as h,j as e,P as j,F as n,V as t,B as l,L as v}from"./index-831988f6.js";import{F as g}from"./FormAccess-589a8032.js";import{K as k}from"./KeycloakTextArea-3e2614e3.js";import{K as y}from"./KeycloakTextInput-ead44014.js";import{V as F}from"./ViewHeader-2b1ad3ef.js";import{A as R}from"./Form-bd3cf98e.js";const A=({form:{register:o,control:m,handleSubmit:d,formState:{errors:i}},onSubmit:c,cancelLink:u,role:p,editMode:r})=>{const{t:a}=f("roles"),x=h({control:m,defaultValue:void 0,name:"name"});return e.jsxs(e.Fragment,{children:[!r&&e.jsx(F,{titleKey:a("createRole")}),e.jsx(j,{variant:"light",children:e.jsxs(g,{isHorizontal:!0,onSubmit:d(c),role:p,className:"pf-u-mt-lg",children:[e.jsx(n,{label:a("roleName"),fieldId:"kc-name",validated:i.name?t.error:t.default,helperTextInvalid:a("common:required"),isRequired:!r,children:e.jsx(y,{id:"kc-name",isReadOnly:r,...o("name",{required:!r,validate:s=>{if(!s?.trim())return a("common:required").toString()}})})}),e.jsx(n,{label:a("common:description"),fieldId:"kc-description",validated:i.description?t.error:t.default,helperTextInvalid:i.description?.message,children:e.jsx(k,{id:"kc-description",validated:i.description?t.error:t.default,isDisabled:x?.includes("default-roles"),...o("description",{maxLength:{value:255,message:a("common:maxLength",{length:255})}})})}),e.jsxs(R,{children:[e.jsx(l,{"data-testid":"save",type:"submit",variant:"primary",children:a("common:save")}),e.jsx(l,{"data-testid":"cancel",variant:"link",component:s=>e.jsx(v,{...s,to:u}),children:a("common:cancel")})]})]})})]})};export{A as R};
//# sourceMappingURL=RoleForm-a2b5b324.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy