Skip to content

Commit

Permalink
Upgrade abp framework to 7.1.0
Browse files Browse the repository at this point in the history
* fix(user): If the user information request fails, go to the login page.
* feat(migrations): Add Backend-Admin、Identity、Webhooks migrations.
* fix(elsa): fix endpoints version of the integrated Elsa.Server.Api project.
* refactor(openiddict): refactor openiddict extension grant.
* feat(saas): Add EntityVersions to Editions and Tenants entity.
* fix(text-templating): fixed invalid page lookup for templates.
* fix(text-templating): the cache is not refreshed after template changes.
* feat(webhooks): added webhooks custom interface.
* feat(webhooks): webhooks send job Sets the maximum number of failed retry attempts.
* feat(account): add the user extension field.
* feat(common): Update common.props file.
* feat(build): Update Dicrectory.Build.props file.
* feat(ui): implements the template definitions.
  • Loading branch information
colinin committed Mar 24, 2023
1 parent dfe6d2c commit 6069db9
Show file tree
Hide file tree
Showing 146 changed files with 6,536 additions and 337 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Tagged Release"

on:
push:
branches: [ rel-7.0.3 ]
branches: [ rel-7.1.0 ]

jobs:
tagged-release:
Expand All @@ -14,4 +14,4 @@ jobs:
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
automatic_release_tag: "7.0.3"
automatic_release_tag: "7.1.0"
15 changes: 15 additions & 0 deletions apps/vue/src/api/sys/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import { useGlobSetting } from '/@/hooks/setting';
import { ContentTypeEnum } from '/@/enums/httpEnum';

import { ErrorMessageMode } from '/#/axios';
import { t } from '/@/hooks/web/useI18n';
import { useMessage } from '/@/hooks/web/useMessage';
import { useUserStoreWithOut } from '/@/store/modules/user';

const { createErrorModal } = useMessage();

enum Api {
Login = '/connect/token',
Expand Down Expand Up @@ -87,6 +92,16 @@ export function getUserInfo() {
{
errorMessageMode: 'none',
apiUrl: '/connect',
}).catch(() => {
const userStore = useUserStoreWithOut();
createErrorModal({
title: t('sys.api.errorTip'),
content: t('sys.api.getUserInfoErrorMessage'),
onOk: () => {
userStore.setToken(undefined);
userStore.logout(true);
}
});
});
}

Expand Down
6 changes: 4 additions & 2 deletions apps/vue/src/api/text-templating/definitions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const CreateAsyncByInput = (input: TextTemplateDefinitionCreateDto) => {
controller: controllerName,
action: 'CreateAsync',
uniqueName: 'CreateAsyncByInput',
params: input,
data: input,
});
};

Expand Down Expand Up @@ -49,7 +49,9 @@ export const GetListAsyncByInput = (input: TextTemplateDefinitionGetListInput) =
controller: controllerName,
action: 'GetListAsync',
uniqueName: 'GetListAsyncByInput',
params: input,
params: {
input: input,
},
});
};

Expand Down
4 changes: 3 additions & 1 deletion apps/vue/src/api/text-templating/definitions/model/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
export interface TextTemplateDefinitionDto {
name: string;
displayName: string;
formatedDisplayName?: string;
defaultCultureName?: string;
isInlineLocalized: boolean;
isLayout: boolean;
layout: string;
layout?: string;
layoutName?: string;
isStatic: boolean;
renderEngine?: string;
}
Expand Down
6 changes: 3 additions & 3 deletions apps/vue/src/locales/lang/en/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ export default {
apiTimeoutMessage: 'The interface request timed out, please refresh the page and try again!',
apiRequestFailed: 'The interface request failed, please try again later!',
networkException: 'network anomaly',
networkExceptionMsg:
'Please check if your network connection is normal! The network is abnormal',
networkExceptionMsg: 'Please check if your network connection is normal! The network is abnormal',
getUserInfoErrorMessage: 'Failed to obtain user information. Please log in again!',

errMsg401: 'The user does not have permission (token, user name, password error)!',
errMsg401: 'The request interface requires authentication. You failed authentication or the session timed out. Please log in again!',
errMsg403: 'The user is authorized, but access is forbidden!',
errMsg404: 'Network request error, the resource was not found!',
errMsg405: 'Network request error, request method not allowed!',
Expand Down
3 changes: 2 additions & 1 deletion apps/vue/src/locales/lang/zh-CN/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ export default {
apiRequestFailed: '请求出错,请稍候重试',
networkException: '网络异常',
networkExceptionMsg: '网络异常,请检查您的网络连接是否正常!',
getUserInfoErrorMessage: '获取用户信息失败, 请重新登录!',

errMsg401: '用户没有权限(令牌、用户名、密码错误)!',
errMsg401: '请求接口需要验证身份,您未通过认证或会话已超时, 请重新登录!',
errMsg403: '用户得到授权,但是访问是被禁止的。!',
errMsg404: '网络请求错误,未找到该资源!',
errMsg405: '网络请求错误,请求方法未允许!',
Expand Down
20 changes: 10 additions & 10 deletions apps/vue/src/utils/http/axios/checkStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ export function checkStatus(
errMessage = t('sys.api.errMsg505');
break;
default:
errMessage = t('sys.api.apiRequestFailed');
break;
}

if (errMessage) {
Expand All @@ -80,16 +82,6 @@ export function checkStatus(
}

export function checkResponse(response: any): string | undefined {
if (!response?.data) {
// 都没捕获到则提示默认错误信息
const { t } = useI18n();
const message = t('sys.api.apiRequestFailed');
checkStatus(response.status, message);
return message;
}

let errorJson = response.data.error;

// 会话超时
if (response.status === 401) {
const userStore = useUserStoreWithOut();
Expand All @@ -98,6 +90,14 @@ export function checkResponse(response: any): string | undefined {
const { t } = useI18n();
return t('sys.api.errMsg401');
}

if (!response?.data) {
// 都没捕获到则提示默认错误信息
checkStatus(response, '');
return undefined;
}

let errorJson = response.data.error;

// abp框架抛出异常信息
if (response.headers['_abperrorformat'] === 'true') {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<template>
<BasicModal
@register="registerModal"
:title="L('TextTemplates')"
:width="800"
:min-height="400"
@ok="handleSubmit"
>
<BasicForm @register="registerForm" />
</BasicModal>
</template>

<script lang="ts" setup>
import { reactive, nextTick } from 'vue';
import { BasicForm, useForm } from '/@/components/Form';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { useMessage } from '/@/hooks/web/useMessage';
import { useLocalization } from '/@/hooks/abp/useLocalization';
import { GetByNameAsyncByName, CreateAsyncByInput, UpdateAsyncByNameAndInput } from '/@/api/text-templating/definitions';
import { getModalFormSchemas } from '../datas/ModalData';
const emits = defineEmits(['register', 'change']);
const state = reactive({
isEdit: false
});
const { createMessage } = useMessage();
const { L } = useLocalization(['AbpTextTemplating']);
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] = useForm({
labelWidth: 150,
showActionButtonGroup: false,
schemas: getModalFormSchemas(),
});
const [registerModal, { changeLoading, changeOkLoading, closeModal }] = useModalInner((data) => {
nextTick(() => {
fetch(data?.name);
});
});
function fetch(name?: string) {
state.isEdit = false;
resetFields();
if (!name) {
updateSchema({
field: 'name',
dynamicDisabled: state.isEdit,
});
return;
}
changeLoading(true);
changeOkLoading(true);
GetByNameAsyncByName(name).then((res) => {
state.isEdit = true;
updateSchema({
field: 'name',
dynamicDisabled: state.isEdit,
});
setFieldsValue(res);
if (res.formatedDisplayName) {
// L:XXX,YYY
const splitChars = res.formatedDisplayName.split(',');
if (splitChars.length >= 2 && splitChars[0].startsWith('L:')) {
const resource = splitChars[0].substring(2);
setFieldsValue({
resource: resource,
text: splitChars[1],
});
}
}
}).finally(() => {
changeLoading(false);
changeOkLoading(false);
});
}
function handleSubmit() {
validate().then((input) => {
input.displayName = `L:${input.resource},${input.text}`;
changeLoading(true);
changeOkLoading(true);
const submitApi = state.isEdit
? UpdateAsyncByNameAndInput(input.name, input)
: CreateAsyncByInput(input);
submitApi.then((res) => {
setFieldsValue(res);
createMessage.success(L('Successful'));
emits('change', res);
closeModal();
}).finally(() => {
changeLoading(false);
changeOkLoading(false);
});
});
}
</script>

<style lang="less" scoped>
</style>
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<template>
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<Button
v-auth="['AbpTextTemplating.TextTemplateDefinitions.Create']"
type="primary"
@click="handleAddNew"
>{{ L('TextTemplates:AddNew') }}
</Button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'isStatic'">
<CheckOutlined v-if="record.isStatic" class="enable" />
Expand All @@ -16,12 +24,15 @@
</template>
<template v-else-if="column.key === 'action'">
<TableAction
v-auth="['AbpTextTemplating.TextTemplateDefinitions', 'AbpTextTemplating.TextTemplateDefinitions.Delete']"
v-auth="[
'AbpTextTemplating.TextTemplateDefinitions.Update',
'AbpTextTemplating.TextTemplateDefinitions.Delete',
'AbpTextTemplating.TextTemplateContents.Update']"
:stop-button-propagation="true"
:actions="[
{
auth: 'AbpTextTemplating.TextTemplateDefinitions.Update',
label: L('Update'),
label: L('Edit'),
icon: 'ant-design:edit-outlined',
onClick: handleEdit.bind(null, record),
},
Expand All @@ -35,7 +46,7 @@
]"
:dropDownActions="[
{
auth: 'AbpTextTemplating.TextTemplateContent.Update',
auth: 'AbpTextTemplating.TextTemplateContents.Update',
label: L('EditContents'),
icon: 'ant-design:edit-outlined',
onClick: handleEditContent.bind(null, record),
Expand All @@ -45,11 +56,13 @@
</template>
</template>
</BasicTable>
<TemplateContentModal @register="registerModal" />
<TemplateContentModal @register="registerContentModal" />
<TemplateDefinitionModal @register="registerEditModal" @change="reload" />
</div>
</template>

<script lang="ts" setup>
import { Button } from 'ant-design-vue';
import { CheckOutlined, CloseOutlined } from '@ant-design/icons-vue';
import { useModal } from '/@/components/Modal';
import { BasicTable, TableAction, useTable } from '/@/components/Table';
Expand All @@ -61,10 +74,12 @@
import { TextTemplateDefinitionDto } from '/@/api/text-templating/definitions/model';
import { formatPagedRequest } from '/@/utils/http/abp/helper';
import TemplateContentModal from './TemplateContentModal.vue';
import TemplateDefinitionModal from './TemplateDefinitionModal.vue';
const { L } = useLocalization(['AbpTextTemplating', 'AbpUi']);
const { createConfirm, createMessage } = useMessage();
const [registerModal, { openModal }] = useModal();
const [registerEditModal, { openModal: openEditModal }] = useModal();
const [registerContentModal, { openModal: openContentModal }] = useModal();
const [registerTable, { reload }] = useTable({
rowKey: 'name',
title: L('TextTemplates'),
Expand All @@ -87,12 +102,16 @@
},
});
function handleAddNew() {
openEditModal(true, {});
}
function handleEdit(record: TextTemplateDefinitionDto) {
console.log('This method is not implemented', record);
openEditModal(true, record);
}
function handleEditContent(record: TextTemplateDefinitionDto) {
openModal(true, record);
openContentModal(true, record);
}
function handleDelete(record: TextTemplateDefinitionDto) {
Expand Down
Loading

0 comments on commit 6069db9

Please sign in to comment.