Browse Source

feat(saas): added edition available for tenants

pull/523/head
cKey 4 years ago
parent
commit
cc5ddd33dc
  1. 2
      apps/vue/src/views/saas/editions/components/EditionTable.vue
  2. 17
      apps/vue/src/views/saas/tenant/datas/ModalData.ts
  3. 12
      aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN/Abp/Saas/Tenants/TenantAppService.cs

2
apps/vue/src/views/saas/editions/components/EditionTable.vue

@ -62,7 +62,7 @@
const { registerModal: registerFeatureModal, handleManageFeature } = useFeatureModal();
const [registerTable, { reload }] = useTable({
rowKey: 'id',
title: L('Tenants'),
title: L('Editions'),
columns: getDataColumns(),
api: getList,
beforeFetch: formatPagedRequest,

17
apps/vue/src/views/saas/tenant/datas/ModalData.ts

@ -1,5 +1,6 @@
import { useLocalization } from '/@/hooks/abp/useLocalization';
import { FormProps, FormSchema } from '/@/components/Form';
import { getList as getEditions } from '/@/api/saas/editions';
const { L } = useLocalization('AbpSaas');
@ -48,6 +49,22 @@ export function getModalFormSchemas(): FormSchema[] {
colProps: { span: 24 },
required: true,
},
{
field: 'editionId',
component: 'ApiSelect',
label: L('DisplayName:EditionName'),
colProps: { span: 24 },
componentProps: {
api: getEditions,
params: {
skipCount: 0,
maxResultCount: 100,
},
resultField: 'items',
labelField: 'displayName',
valueField: 'id',
},
},
{
field: 'enableTime',
component: 'DatePicker',

12
aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN/Abp/Saas/Tenants/TenantAppService.cs

@ -99,6 +99,8 @@ public class TenantAppService : AbpSaasAppServiceBase, ITenantAppService
await EventBus.PublishAsync(createEventData);
});
await CurrentUnitOfWork.SaveChangesAsync();
return ObjectMapper.Map<Tenant, TenantDto>(tenant);
}
@ -120,6 +122,8 @@ public class TenantAppService : AbpSaasAppServiceBase, ITenantAppService
input.MapExtraPropertiesTo(tenant);
await TenantRepository.UpdateAsync(tenant);
await CurrentUnitOfWork.SaveChangesAsync();
return ObjectMapper.Map<Tenant, TenantDto>(tenant);
}
@ -132,6 +136,8 @@ public class TenantAppService : AbpSaasAppServiceBase, ITenantAppService
return;
}
await TenantRepository.DeleteAsync(tenant);
await CurrentUnitOfWork.SaveChangesAsync();
}
[Authorize(AbpSaasPermissions.Tenants.ManageConnectionStrings)]
@ -177,6 +183,10 @@ public class TenantAppService : AbpSaasAppServiceBase, ITenantAppService
}
tenant.SetConnectionString(input.Name, input.Value);
await TenantRepository.UpdateAsync(tenant);
await CurrentUnitOfWork.SaveChangesAsync();
return new TenantConnectionStringDto
{
Name = input.Name,
@ -204,5 +214,7 @@ public class TenantAppService : AbpSaasAppServiceBase, ITenantAppService
});
await TenantRepository.UpdateAsync(tenant);
await CurrentUnitOfWork.SaveChangesAsync();
}
}

Loading…
Cancel
Save