mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
Merge branch 'main' into fix-s9-bugs
This commit is contained in:
commit
1202750d4c
13 changed files with 36 additions and 23 deletions
2
.github/workflows/cypress-appbuilder.yml
vendored
2
.github/workflows/cypress-appbuilder.yml
vendored
|
|
@ -52,7 +52,7 @@ jobs:
|
|||
run: |
|
||||
git submodule update --init --recursive
|
||||
git submodule foreach --recursive '
|
||||
git checkout ${{ env.BRANCH_NAME }} 2>/dev/null || git checkout modularisation/v3'
|
||||
git checkout ${{ env.BRANCH_NAME }} 2>/dev/null || git checkout main'
|
||||
|
||||
|
||||
- name: Set up Docker
|
||||
|
|
|
|||
2
.github/workflows/cypress-platform.yml
vendored
2
.github/workflows/cypress-platform.yml
vendored
|
|
@ -50,7 +50,7 @@ jobs:
|
|||
run: |
|
||||
git submodule update --init --recursive
|
||||
git submodule foreach --recursive '
|
||||
git checkout ${{ env.BRANCH_NAME }} 2>/dev/null || git checkout modularisation/v3'
|
||||
git checkout ${{ env.BRANCH_NAME }} 2>/dev/null || git checkout main'
|
||||
|
||||
- name: Set up Docker
|
||||
uses: docker-practice/actions-setup-docker@master
|
||||
|
|
|
|||
4
.gitmodules
vendored
4
.gitmodules
vendored
|
|
@ -1,8 +1,8 @@
|
|||
[submodule "frontend/ee"]
|
||||
path = frontend/ee
|
||||
url = https://github.com/ToolJet/ee-frontend.git
|
||||
branch = modularisation/v3
|
||||
branch = main
|
||||
[submodule "server/ee"]
|
||||
path = server/ee
|
||||
url = https://github.com/ToolJet/ee-server.git
|
||||
branch = modularisation/v3
|
||||
branch = main
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ RUN mkdir -p /app
|
|||
WORKDIR /app
|
||||
|
||||
ARG CUSTOM_GITHUB_TOKEN
|
||||
ARG BRANCH_NAME=modularisation/v3
|
||||
ARG BRANCH_NAME=main
|
||||
|
||||
# Clone and checkout the frontend repository
|
||||
RUN git config --global url."https://x-access-token:${CUSTOM_GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ WORKDIR /app
|
|||
|
||||
# Set GitHub token and branch as build arguments
|
||||
ARG CUSTOM_GITHUB_TOKEN
|
||||
ARG BRANCH_NAME=modularisation/v3
|
||||
ARG BRANCH_NAME=main
|
||||
|
||||
# Clone and checkout the frontend repository
|
||||
RUN git config --global url."https://x-access-token:${CUSTOM_GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
|
||||
|
|
@ -21,7 +21,7 @@ RUN git config --global http.postBuffer 524288000
|
|||
RUN git clone https://github.com/ToolJet/ToolJet.git .
|
||||
|
||||
# The branch name needs to be changed the branch with modularisation in CE repo
|
||||
RUN git checkout modularisation/v3
|
||||
RUN git checkout main
|
||||
|
||||
RUN git submodule update --init --recursive
|
||||
|
||||
|
|
|
|||
|
|
@ -628,7 +628,6 @@ button {
|
|||
|
||||
|
||||
.inspector {
|
||||
padding: 0px !important;
|
||||
.form-control-plaintext {
|
||||
padding: 0;
|
||||
color: var(--slate12);
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 26447ec13d91119d001319ac940264bbc39a3b54
|
||||
Subproject commit 1da04eef696345ce9f35d42af92e5d6de992cd85
|
||||
|
|
@ -176,7 +176,7 @@ export class OauthService implements IOAuthService {
|
|||
const { name, slug } = generateNextNameAndSlug('My workspace');
|
||||
defaultOrganization = await this.setupOrganizationsUtilService.create(name, slug, null, manager);
|
||||
|
||||
userDetails = await this.userRepository.createOne(
|
||||
userDetails = await this.userRepository.createOrUpdate(
|
||||
{
|
||||
firstName: userResponse.firstName,
|
||||
lastName: userResponse.lastName,
|
||||
|
|
@ -187,6 +187,12 @@ export class OauthService implements IOAuthService {
|
|||
manager
|
||||
);
|
||||
await this.organizationUsersRepository.createOne(userDetails, defaultOrganization, false, manager);
|
||||
await this.organizationUsersUtilService.attachUserGroup(
|
||||
[USER_ROLE.ADMIN],
|
||||
defaultOrganization.id,
|
||||
userDetails.id,
|
||||
manager
|
||||
);
|
||||
|
||||
organizationDetails = defaultOrganization;
|
||||
} else if (userDetails) {
|
||||
|
|
|
|||
|
|
@ -150,11 +150,11 @@ export class AuthUtilService implements IAuthUtilService {
|
|||
defaultOrganization = await this.organizationRepository.createOne(name, slug, manager);
|
||||
}
|
||||
|
||||
const { source, status } = getUserStatusAndSource(lifecycleEvents.USER_SSO_VERIFY, sso);
|
||||
const { source, status } = getUserStatusAndSource(lifecycleEvents.USER_SSO_ACTIVATE, sso);
|
||||
/* Default password for sso-signed workspace user */
|
||||
|
||||
const password = uuid.v4();
|
||||
user = await this.userRepository.createOne(
|
||||
user = await this.userRepository.createOrUpdate(
|
||||
{
|
||||
firstName,
|
||||
lastName,
|
||||
|
|
@ -162,9 +162,8 @@ export class AuthUtilService implements IAuthUtilService {
|
|||
source,
|
||||
status,
|
||||
password,
|
||||
organizationId: organization.id,
|
||||
role: USER_ROLE.END_USER,
|
||||
defaultOrganizationId: defaultOrganization?.id,
|
||||
defaultOrganizationId: defaultOrganization?.id || organization.id,
|
||||
},
|
||||
manager
|
||||
);
|
||||
|
|
@ -191,6 +190,7 @@ export class AuthUtilService implements IAuthUtilService {
|
|||
// Setting up default organization
|
||||
await this.organizationUsersRepository.createOne(user, defaultOrganization, true, manager);
|
||||
}
|
||||
await this.organizationUsersUtilService.attachUserGroup([USER_ROLE.END_USER], organization.id, user.id, manager); //localhost:8082/login/tooljets-workspace?redirectTo=/
|
||||
return user;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,8 +52,9 @@ export class GroupPermissionsUtilService implements IGroupPermissionsUtilService
|
|||
|
||||
validateAddGroupUserOperation(group: GroupPermissions) {
|
||||
if (!group || Object.keys(group)?.length === 0) throw new BadRequestException(ERROR_HANDLER.GROUP_NOT_EXIST);
|
||||
if (group.type == GROUP_PERMISSIONS_TYPE.DEFAULT)
|
||||
throw new MethodNotAllowedException(ERROR_HANDLER.ADD_GROUP_USER_DEFAULT_GROUP);
|
||||
//commented out the default group check because for enable signup cases, user is added to default admin group
|
||||
// if (group.type == GROUP_PERMISSIONS_TYPE.DEFAULT)
|
||||
// throw new MethodNotAllowedException(ERROR_HANDLER.ADD_GROUP_USER_DEFAULT_GROUP);
|
||||
}
|
||||
|
||||
validateDeleteGroupUserOperation(group: GroupPermissions, organizationId: string) {
|
||||
|
|
|
|||
|
|
@ -575,7 +575,7 @@ export class OnboardingUtilService implements IOnboardingUtilService {
|
|||
): Promise<User> {
|
||||
return dbTransactionWrap(async (manager: EntityManager) => {
|
||||
// Create the user
|
||||
const user = await this.userRepository.createOne(userParams, manager);
|
||||
const user = await this.userRepository.createOrUpdate(userParams, manager);
|
||||
|
||||
// Add the role for the user in the specified organization
|
||||
await this.rolesUtilService.addUserRole(organizationId, { role, userId: user.id }, manager);
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ import { SessionUtilService } from '@modules/session/util.service';
|
|||
import { SetupOrganizationsUtilService } from '@modules/setup-organization/util.service';
|
||||
import { IOrganizationUsersUtilService } from './interfaces/IUtilService';
|
||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||
import { GroupPermissions } from '@entities/group_permissions.entity';
|
||||
import { GroupUsers } from '@entities/group_users.entity';
|
||||
@Injectable()
|
||||
export class OrganizationUsersUtilService implements IOrganizationUsersUtilService {
|
||||
constructor(
|
||||
|
|
@ -234,7 +232,7 @@ export class OrganizationUsersUtilService implements IOrganizationUsersUtilServi
|
|||
return await dbTransactionWrap(async (manager: EntityManager) => {
|
||||
const userType = (await manager.count(User)) === 0 ? USER_TYPE.INSTANCE : USER_TYPE.WORKSPACE;
|
||||
|
||||
return await this.userRepository.createOne(
|
||||
return await this.userRepository.createOrUpdate(
|
||||
{
|
||||
email,
|
||||
firstName,
|
||||
|
|
|
|||
|
|
@ -86,9 +86,18 @@ export class UserRepository extends Repository<User> {
|
|||
};
|
||||
}
|
||||
|
||||
createOne(user: Partial<User>, manager?: EntityManager): Promise<User> {
|
||||
return dbTransactionWrap((manager: EntityManager) => {
|
||||
return manager.save(manager.create(User, user));
|
||||
async createOrUpdate(user: Partial<User>, manager?: EntityManager): Promise<User> {
|
||||
//not using upsert because hook is not supported for password digest
|
||||
return dbTransactionWrap(async (manager: EntityManager) => {
|
||||
const existingUser = await manager.findOne(User, { where: { email: user.email } });
|
||||
|
||||
if (existingUser) {
|
||||
Object.assign(existingUser, user);
|
||||
return manager.save(User, existingUser);
|
||||
} else {
|
||||
const newUser = manager.create(User, user);
|
||||
return manager.save(User, newUser);
|
||||
}
|
||||
}, manager || this.manager);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue