add reseller change plan button

This commit is contained in:
Simon Larsen 2023-09-07 20:21:42 +05:30
parent bd6486ca58
commit 911424c505
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
2 changed files with 39 additions and 2 deletions

View File

@ -97,6 +97,7 @@ const Settings: FunctionComponent<ComponentProps> = (
monitorLimit: true,
teamMemberLimit: true,
planType: true,
changePlanLink: true,
},
}
);
@ -393,6 +394,21 @@ const Settings: FunctionComponent<ComponentProps> = (
<Card
title={`You have purchased this project from ${reseller.name}`}
description={`If you would like to change the plan, please contact ${reseller.name} at ${reseller.description}`}
buttons={
reseller.changePlanLink
? [
{
title: `Change Plan`,
onClick: () => {
Navigation.navigate(
reseller.changePlanLink!
);
},
icon: IconProp.Edit,
},
]
: []
}
>
<div className="space-y-2">
<div className="text-sm font-medium text-gray-500">

View File

@ -13,6 +13,7 @@ import TableMetadata from 'Common/Types/Database/TableMetadata';
import IconProp from 'Common/Types/Icon/IconProp';
import BaseModel from 'Common/Models/BaseModel';
import Permission from 'Common/Types/Permission';
import URL from 'Common/Types/API/URL';
@TableAccessControl({
create: [],
@ -98,7 +99,7 @@ export default class Reseller extends BaseModel {
@TableColumn({
required: true,
type: TableColumnType.ShortText,
canReadOnRelationQuery: true,
canReadOnRelationQuery: false,
title: 'Username',
description: 'Username of the reseller',
})
@ -117,7 +118,7 @@ export default class Reseller extends BaseModel {
@TableColumn({
required: true,
type: TableColumnType.ShortText,
canReadOnRelationQuery: true,
canReadOnRelationQuery: false,
title: 'Password',
description: 'Password for reseller to login',
})
@ -217,4 +218,24 @@ export default class Reseller extends BaseModel {
transformer: ObjectID.getDatabaseTransformer(),
})
public deletedByUserId?: ObjectID = undefined;
@ColumnAccessControl({
create: [],
read: [],
update: [],
})
@TableColumn({
required: false,
type: TableColumnType.ShortURL,
canReadOnRelationQuery: true,
title: 'Change Plan Link',
description: 'Reseller Change plan Link',
})
@Column({
nullable: true,
type: ColumnType.ShortURL,
length: ColumnLength.ShortURL,
transformer: URL.getDatabaseTransformer(),
})
public changePlanLink?: URL = undefined;
}