mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 15:20:34 +00:00
fix: cloud subscription flag
This commit is contained in:
5
packages/server/src/common/config/cloud.ts
Normal file
5
packages/server/src/common/config/cloud.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import { registerAs } from '@nestjs/config';
|
||||||
|
|
||||||
|
export default registerAs('cloud', () => ({
|
||||||
|
hostedOnCloud: process.env.HOSTED_ON_BIGCAPITAL_CLOUD === 'true',
|
||||||
|
}));
|
||||||
@@ -15,9 +15,11 @@ import mail from './mail';
|
|||||||
import loops from './loops';
|
import loops from './loops';
|
||||||
import bankfeed from './bankfeed';
|
import bankfeed from './bankfeed';
|
||||||
import throttle from './throttle';
|
import throttle from './throttle';
|
||||||
|
import cloud from './cloud';
|
||||||
|
|
||||||
export const config = [
|
export const config = [
|
||||||
systemDatabase,
|
systemDatabase,
|
||||||
|
cloud,
|
||||||
tenantDatabase,
|
tenantDatabase,
|
||||||
signup,
|
signup,
|
||||||
gotenberg,
|
gotenberg,
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {
|
|||||||
import { defaultTo } from 'ramda';
|
import { defaultTo } from 'ramda';
|
||||||
import { ERRORS } from '../Auth.constants';
|
import { ERRORS } from '../Auth.constants';
|
||||||
import { hashPassword } from '../Auth.utils';
|
import { hashPassword } from '../Auth.utils';
|
||||||
|
import { ClsService } from 'nestjs-cls';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AuthSignupService {
|
export class AuthSignupService {
|
||||||
@@ -29,6 +30,7 @@ export class AuthSignupService {
|
|||||||
private readonly configService: ConfigService,
|
private readonly configService: ConfigService,
|
||||||
private readonly eventEmitter: EventEmitter2,
|
private readonly eventEmitter: EventEmitter2,
|
||||||
private readonly tenantsManager: TenantsManagerService,
|
private readonly tenantsManager: TenantsManagerService,
|
||||||
|
private readonly clsService: ClsService,
|
||||||
|
|
||||||
@Inject(SystemUser.name)
|
@Inject(SystemUser.name)
|
||||||
private readonly systemUserModel: typeof SystemUser,
|
private readonly systemUserModel: typeof SystemUser,
|
||||||
@@ -70,6 +72,11 @@ export class AuthSignupService {
|
|||||||
tenantId: tenant.id,
|
tenantId: tenant.id,
|
||||||
inviteAcceptedAt,
|
inviteAcceptedAt,
|
||||||
});
|
});
|
||||||
|
// Set the user in the cls service.
|
||||||
|
this.clsService.set('tenantId', user.tenantId);
|
||||||
|
this.clsService.set('userId', user.id);
|
||||||
|
this.clsService.set('organizationId', tenant.organizationId);
|
||||||
|
|
||||||
// Triggers signed up event.
|
// Triggers signed up event.
|
||||||
await this.eventEmitter.emitAsync(events.auth.signUp, {
|
await this.eventEmitter.emitAsync(events.auth.signUp, {
|
||||||
signupDTO,
|
signupDTO,
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ export class SubscribeFreeOnSignupCommunity {
|
|||||||
*/
|
*/
|
||||||
@OnEvent(events.auth.signUp)
|
@OnEvent(events.auth.signUp)
|
||||||
async subscribeFreeOnSigupCommunity({ signupDTO, tenant, user }) {
|
async subscribeFreeOnSigupCommunity({ signupDTO, tenant, user }) {
|
||||||
if (this.configService.get('hostedOnBigcapitalCloud')) return null;
|
if (this.configService.get('cloud.hostedOnCloud')) return null;
|
||||||
|
|
||||||
// await this.subscriptionApp.createNewSubscription('free');
|
await this.subscriptionApp.createNewSubscription('free');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,12 @@ export function FormTopbar({ className, children }) {
|
|||||||
const FormTopBarRoot = styled(Navbar)`
|
const FormTopBarRoot = styled(Navbar)`
|
||||||
--color-form-topbar-background: #fff;
|
--color-form-topbar-background: #fff;
|
||||||
--color-form-topbar-border: #c7d5db;
|
--color-form-topbar-border: #c7d5db;
|
||||||
|
--color-divider-color: #d2dce2;
|
||||||
|
|
||||||
.bp4-dark & {
|
.bp4-dark & {
|
||||||
--color-form-topbar-background: var(--color-dark-gray1);
|
--color-form-topbar-background: var(--color-dark-gray1);
|
||||||
--color-form-topbar-border: rgba(255, 255, 255, 0.15);
|
--color-form-topbar-border: rgba(255, 255, 255, 0.15);
|
||||||
|
--color-divider-color: rgba(255, 255, 255, 0.25);
|
||||||
}
|
}
|
||||||
height: 35px;
|
height: 35px;
|
||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
@@ -34,7 +36,7 @@ const FormTopBarRoot = styled(Navbar)`
|
|||||||
height: 35px;
|
height: 35px;
|
||||||
}
|
}
|
||||||
.bp4-navbar-divider {
|
.bp4-navbar-divider {
|
||||||
border-left-color: #d2dce2;
|
border-left-color: var(--color-divider-color);
|
||||||
}
|
}
|
||||||
.bp4-skeleton {
|
.bp4-skeleton {
|
||||||
max-height: 10px;
|
max-height: 10px;
|
||||||
|
|||||||
Reference in New Issue
Block a user