mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-21 21:47:17 +00:00
Archived workspace re-loading Fix (#14427)
This commit is contained in:
parent
a53d1eca69
commit
1b9e30d082
3 changed files with 11 additions and 5 deletions
|
|
@ -44,11 +44,13 @@ export class LoginConfigsUtilService implements ILoginConfigsUtilService {
|
|||
organizationIdOrSlug: string,
|
||||
statusList?: Array<boolean>,
|
||||
isHideSensitiveData?: boolean,
|
||||
addInstanceLevelSSO?: boolean
|
||||
addInstanceLevelSSO?: boolean,
|
||||
allowArchivedWorkspace: boolean = false
|
||||
): Promise<DeepPartial<Organization>> {
|
||||
const result: Organization = await this.organizationRepository.fetchOrganizationWithSSOConfigs(
|
||||
organizationIdOrSlug,
|
||||
statusList
|
||||
statusList,
|
||||
allowArchivedWorkspace
|
||||
);
|
||||
if (!result) return;
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,11 @@ export class OrganizationRepository extends Repository<Organization> {
|
|||
return await this.findOne({ where: { id }, relations: ['ssoConfigs'] });
|
||||
}
|
||||
|
||||
async fetchOrganizationWithSSOConfigs(slug: string, statusList?: Array<boolean>): Promise<Organization> {
|
||||
async fetchOrganizationWithSSOConfigs(
|
||||
slug: string,
|
||||
statusList?: Array<boolean>,
|
||||
allowArchivedWorkspace: boolean = false
|
||||
): Promise<Organization> {
|
||||
const conditions: any = {
|
||||
relations: ['ssoConfigs', 'ssoConfigs.oidcGroupSyncs'],
|
||||
where: {
|
||||
|
|
@ -40,7 +44,7 @@ export class OrganizationRepository extends Repository<Organization> {
|
|||
where: { ...conditions.where, id: slug },
|
||||
});
|
||||
}
|
||||
if (organization && organization.status !== WORKSPACE_STATUS.ACTIVE)
|
||||
if (organization && organization.status !== WORKSPACE_STATUS.ACTIVE && !allowArchivedWorkspace)
|
||||
throw new BadRequestException('Organization is Archived');
|
||||
return organization;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ export class UserRepository extends Repository<User> {
|
|||
organizationUsers: {
|
||||
organizationId: organizationId,
|
||||
status: In(statusList),
|
||||
organization: { status: WORKSPACE_STATUS.ACTIVE },
|
||||
organization: { status: In([WORKSPACE_STATUS.ACTIVE, WORKSPACE_STATUS.ARCHIVE]) },
|
||||
},
|
||||
},
|
||||
relations: ['organizationUsers', 'organizationUsers.organization'],
|
||||
|
|
|
|||
Loading…
Reference in a new issue