Refactor code formatting and fix indentation

Update error message for user limit reached in free plan

Remove unused import statement

Fix indentation in Home/Index.ts

Fix indentation and add line breaks in HardDeleteItemsInDatabase.ts
This commit is contained in:
Simon Larsen
2023-12-20 12:37:55 +00:00
parent 3208e99469
commit c8a23df5b6
4 changed files with 20 additions and 9 deletions

View File

@@ -16,7 +16,9 @@ import { IsBillingEnabled } from '../EnvironmentConfig';
import { AccountsRoute } from 'Common/ServiceRoute';
import DatabaseConfig from '../DatabaseConfig';
import BillingService from './BillingService';
import SubscriptionPlan, { PlanSelect } from 'Common/Types/Billing/SubscriptionPlan';
import SubscriptionPlan, {
PlanSelect,
} from 'Common/Types/Billing/SubscriptionPlan';
import Project from 'Model/Models/Project';
import MailService from './MailService';
import EmailTemplateType from 'Common/Types/Email/EmailTemplateType';
@@ -63,8 +65,12 @@ export class TeamMemberService extends DatabaseService<TeamMember> {
);
}
if(createBy.props.currentPlan === PlanSelect.Free && project && project.paymentProviderSubscriptionSeats && project.paymentProviderSubscriptionSeats >= 1){
if (
createBy.props.currentPlan === PlanSelect.Free &&
project &&
project.paymentProviderSubscriptionSeats &&
project.paymentProviderSubscriptionSeats >= 1
) {
throw new BadDataException(
Errors.TeamMemberService.LIMIT_REACHED_FOR_FREE_PLAN
);

View File

@@ -19,6 +19,7 @@ export default {
'This team should have at least 1 member who has accepted the invitation.',
LIMIT_REACHED:
'You have reached the user limit. You cannot invite any more users to this project. Please contact billing@oneuptime.com to increase your user limit.',
LIMIT_REACHED_FOR_FREE_PLAN: 'You have reached the user limit for the free plan. Please upgrade your plan to Growth to invite more users.',
LIMIT_REACHED_FOR_FREE_PLAN:
'You have reached the user limit for the free plan. Please upgrade your plan to Growth to invite more users.',
},
};

View File

@@ -348,7 +348,7 @@ app.get('/pricing', (_req: ExpressRequest, res: ExpressResponse) => {
enterprise: 'Coming Soon',
},
},
{
name: 'Vacation and OOO Policy',
plans: {

View File

@@ -1,4 +1,7 @@
import { IsBillingEnabled, IsDevelopment } from 'CommonServer/EnvironmentConfig';
import {
IsBillingEnabled,
IsDevelopment,
} from 'CommonServer/EnvironmentConfig';
import RunCron from '../../Utils/Cron';
import { EVERY_DAY, EVERY_MINUTE } from 'Common/Utils/CronTime';
import Services from 'CommonServer/Services/Index';
@@ -12,9 +15,10 @@ RunCron(
'HardDelete:HardDeleteItemsInDatabase',
{ schedule: IsDevelopment ? EVERY_MINUTE : EVERY_DAY, runOnStartup: false },
async () => {
if(!IsBillingEnabled){
logger.info('HardDelete:HardDeleteItemsInDatabase: Billing is not enabled. Skipping hard delete.');
if (!IsBillingEnabled) {
logger.info(
'HardDelete:HardDeleteItemsInDatabase: Billing is not enabled. Skipping hard delete.'
);
return;
}