mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-22 16:38:21 +00:00
parent
4011863b97
commit
372cf41fb1
2 changed files with 18 additions and 3 deletions
|
|
@ -20,6 +20,7 @@ export const CreateOrganization = ({ showCreateOrg, setShowCreateOrg }) => {
|
|||
const { t } = useTranslation();
|
||||
const isSlugSet = useRef(false); // Flag to track if slug has been initially set
|
||||
const sluginput = useRef('');
|
||||
const [isDisabled, setIsDisabled] = useState(true);
|
||||
|
||||
const createOrganization = () => {
|
||||
let emptyError = false;
|
||||
|
|
@ -155,6 +156,7 @@ export const CreateOrganization = ({ showCreateOrg, setShowCreateOrg }) => {
|
|||
errorMsg: errResponse?.error,
|
||||
};
|
||||
setSlug({ value: defaultValue, error: error?.errorMsg });
|
||||
sluginput.current.value = defaultValue;
|
||||
}
|
||||
};
|
||||
checkWorkspaceUniqueness();
|
||||
|
|
@ -167,7 +169,17 @@ export const CreateOrganization = ({ showCreateOrg, setShowCreateOrg }) => {
|
|||
}
|
||||
}, [name.value, slug.value, slugProgress, workspaceNameProgress, isSlugSet]);
|
||||
|
||||
const isDisabled = isCreating || isNameDisabled || isSlugDisabled || slugProgress || workspaceNameProgress;
|
||||
useEffect(() => {
|
||||
const isDisabled =
|
||||
isCreating ||
|
||||
isNameDisabled ||
|
||||
isSlugDisabled ||
|
||||
slugProgress ||
|
||||
workspaceNameProgress ||
|
||||
slug?.error ||
|
||||
name?.error;
|
||||
setIsDisabled(isDisabled);
|
||||
}, [isCreating, isNameDisabled, isSlugDisabled, slugProgress, workspaceNameProgress, name, slug]);
|
||||
|
||||
return (
|
||||
<AlertDialog
|
||||
|
|
|
|||
|
|
@ -56,13 +56,16 @@ export const useCurrentStateStore = create(
|
|||
setEditorReady: (isEditorReady) => set({ isEditorReady }),
|
||||
initializeCurrentStateOnVersionSwitch: () => {
|
||||
//fetch user for current app
|
||||
const currentSession = authenticationService.currentSessionValue;
|
||||
const currentUser = useAppDataStore.getState().currentUser;
|
||||
const userVars = {
|
||||
email: currentUser?.email,
|
||||
firstName: currentUser?.first_name,
|
||||
lastName: currentUser?.last_name,
|
||||
groups: authenticationService.currentSessionValue.group_permissions?.map((group) => group.group),
|
||||
ssoUserInfo: currentUser?.sso_user_info,
|
||||
groups: currentSession?.group_permissions
|
||||
? ['all_users', ...currentSession.group_permissions.map((group) => group.name)]
|
||||
: ['all_users'],
|
||||
role: currentSession?.role?.name,
|
||||
};
|
||||
const newInitialState = {
|
||||
...initialState,
|
||||
|
|
|
|||
Loading…
Reference in a new issue