Skip to content

Commit

Permalink
upgrade: upgrade abp framework to 8.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
colinin committed Dec 22, 2023
1 parent ee9f2ff commit d930a57
Show file tree
Hide file tree
Showing 251 changed files with 6,049 additions and 442 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- "**.csproj"

env:
DOTNET_VERSION: "7.0.401"
DOTNET_VERSION: "8.0.100"

jobs:
build:
Expand Down
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.4.0 ]
branches: [ rel-8.0.0 ]

jobs:
tagged-release:
Expand All @@ -14,4 +14,4 @@ jobs:
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
automatic_release_tag: "7.4.0"
automatic_release_tag: "8.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ export interface OpenIddictApplicationGetListInput extends PagedAndSortedResultR
filter?: string;
}

export interface OpenIddictApplicationCreateDto extends OpenIddictApplicationCreateOrUpdateDto {
}
export type OpenIddictApplicationCreateDto = OpenIddictApplicationCreateOrUpdateDto;

export interface OpenIddictApplicationUpdateDto extends OpenIddictApplicationCreateOrUpdateDto {
}
export type OpenIddictApplicationUpdateDto = OpenIddictApplicationCreateOrUpdateDto;

export interface OpenIddictApplicationDto extends ExtensibleAuditedEntityDto<string> {
clientId: string;
clientSecret?: string;
clientType?: string;
applicationType?: string;
consentType?: string;
displayName?: string;
displayNames?: Dictionary<string, string>;
Expand All @@ -22,14 +22,15 @@ export interface OpenIddictApplicationDto extends ExtensibleAuditedEntityDto<str
properties?: Dictionary<string, string>;
redirectUris?: string[];
requirements?: string[];
type?: string;
clientUri?: string;
logoUri?: string;
}

export interface OpenIddictApplicationCreateOrUpdateDto extends ExtensibleObject {
clientId: string;
clientSecret?: string;
clientType?: string;
applicationType?: string;
consentType?: string;
displayName?: string;
displayNames?: Dictionary<string, string>;
Expand All @@ -41,8 +42,6 @@ export interface OpenIddictApplicationCreateOrUpdateDto extends ExtensibleObject
properties?: Dictionary<string, string>;
redirectUris?: string[];
requirements?: string[];
type?: string;
clientUri?: string;
logoUri?: string;
}

Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,23 @@
<Tabs v-model:active-key="state.activeTab" @change="handleTabChange">
<!-- Basic -->
<TabPane key="basic" :tab="L('BasicInfo')">
<FormItem name="applicationType" :label="L('DisplayName:ApplicationType')">
<Select
default-value="web"
:options="applicationTypes"
v-model:value="state.application.applicationType"
/>
</FormItem>
<FormItem name="clientId" :label="L('DisplayName:ClientId')">
<Input :disabled="state.isEdit" v-model:value="state.application.clientId" />
</FormItem>
<FormItem name="type" :label="L('DisplayName:Type')">
<Select :disabled="state.isEdit" default-value="public" :options="clientTypes" v-model:value="state.application.type" />
<FormItem name="clientType" :label="L('DisplayName:ClientType')">
<Select
:disabled="state.isEdit"
default-value="public"
:options="clientTypes"
v-model:value="state.application.clientType"
/>
</FormItem>
<FormItem v-if="getShowSecret" name="clientSecret" :label="L('DisplayName:ClientSecret')">
<Input v-model:value="state.application.clientSecret" />
Expand All @@ -39,7 +51,11 @@
:label-col="{ span: 4 }"
:wrapper-col="{ span: 20 }"
>
<Select :options="consentTypes" default-value="explicit" v-model:value="state.application.consentType" />
<Select
:options="consentTypes"
default-value="explicit"
v-model:value="state.application.consentType"
/>
</FormItem>
</TabPane>
<!-- DisplayName -->
Expand All @@ -63,14 +79,10 @@
</span>
<template #overlay>
<Menu @click="handleClickUrisMenu">
<MenuItem
key="redirectUris"
>
<MenuItem key="redirectUris">
{{ L('DisplayName:RedirectUris') }}
</MenuItem>
<MenuItem
key="postLogoutRedirectUris"
>
<MenuItem key="postLogoutRedirectUris">
{{ L('DisplayName:PostLogoutRedirectUris') }}
</MenuItem>
</Menu>
Expand Down Expand Up @@ -111,15 +123,23 @@
:label-col="{ span: 4 }"
:wrapper-col="{ span: 20 }"
>
<Select :options="grantTypes" mode="tags" v-model:value="state.application.grantTypes" />
<Select
:options="grantTypes"
mode="tags"
v-model:value="state.application.grantTypes"
/>
</FormItem>
<FormItem
name="responseTypes"
:label="L('DisplayName:ResponseTypes')"
:label-col="{ span: 4 }"
:wrapper-col="{ span: 20 }"
>
<Select :options="responseTypes" mode="tags" v-model:value="state.application.responseTypes" />
<Select
:options="responseTypes"
mode="tags"
v-model:value="state.application.responseTypes"
/>
</FormItem>
</TabPane>
<!-- Propertites -->
Expand All @@ -146,7 +166,11 @@
import { useValidation } from '/@/hooks/abp/useValidation';
import { useLocalization } from '/@/hooks/abp/useLocalization';
import { ApplicationState } from '../types/props';
import { GetAsyncById, CreateAsyncByInput, UpdateAsyncByIdAndInput } from '/@/api/openiddict/open-iddict-application';
import {
GetAsyncById,
CreateAsyncByInput,
UpdateAsyncByIdAndInput,
} from '/@/api/openiddict/open-iddict-application';
import { OpenIddictApplicationDto } from '/@/api/openiddict/open-iddict-application/model';
import { discovery } from '/@/api/identity-server/identityServer';
import RedirectUri from './RedirectUri.vue';
Expand All @@ -164,8 +188,8 @@
const { ruleCreator } = useValidation();
const { createMessage, createConfirm } = useMessage();
const componentsRef = shallowRef({
'redirectUris': RedirectUri,
'postLogoutRedirectUris': PostLogoutRedirectUri,
redirectUris: RedirectUri,
postLogoutRedirectUris: PostLogoutRedirectUri,
});
const formRef = ref<FormInstance>();
const state = reactive<ApplicationState>({
Expand Down Expand Up @@ -211,6 +235,10 @@
{ label: 'public', value: 'public' },
{ label: 'confidential', value: 'confidential' },
]);
const applicationTypes = reactive([
{ label: 'Web', value: 'web' },
{ label: 'Native', value: 'native' },
]);
const consentTypes = reactive([
{ label: 'explicit', value: 'explicit' },
{ label: 'external', value: 'external' },
Expand All @@ -226,10 +254,10 @@
{ label: 'introspection', value: 'introspection' },
]);
const getShowSecret = computed(() => {
return !state.isEdit && state.application.type === 'confidential';
return !state.isEdit && state.application.clientType === 'confidential';
});
const grantTypes = computed(() => {
if (!state.openIdConfiguration) return[];
if (!state.openIdConfiguration) return [];
const types = state.openIdConfiguration.grant_types_supported;
return types.map((type) => {
return {
Expand All @@ -239,7 +267,7 @@
});
});
const responseTypes = computed(() => {
if (!state.openIdConfiguration) return[];
if (!state.openIdConfiguration) return [];
const types = state.openIdConfiguration.response_types_supported;
return types.map((type) => {
return {
Expand Down Expand Up @@ -278,15 +306,17 @@
return;
}
changeLoading(true);
GetAsyncById(id).then((application) => {
state.application = application;
nextTick(() => {
state.isEdit = true;
state.entityChanged = false;
GetAsyncById(id)
.then((application) => {
state.application = application;
nextTick(() => {
state.isEdit = true;
state.entityChanged = false;
});
})
.finally(() => {
changeLoading(false);
});
}).finally(() => {
changeLoading(false);
});
}
function handleTabChange(activeKey) {
Expand All @@ -295,7 +325,7 @@
case 'endpoints':
if (!state.endPoint.component) {
state.endPoint = {
component : 'redirectUris',
component: 'redirectUris',
uris: state.application?.redirectUris,
};
}
Expand All @@ -315,7 +345,9 @@
if (!state.application || !state.application.postLogoutRedirectUris) {
return;
}
const index = state.application.postLogoutRedirectUris.findIndex(logoutUri => logoutUri === uri);
const index = state.application.postLogoutRedirectUris.findIndex(
(logoutUri) => logoutUri === uri,
);
index && state.application.postLogoutRedirectUris.splice(index);
}
Expand All @@ -331,7 +363,7 @@
if (!state.application || !state.application.redirectUris) {
return;
}
const index = state.application.redirectUris.findIndex(redirectUri => redirectUri === uri);
const index = state.application.redirectUris.findIndex((redirectUri) => redirectUri === uri);
index && state.application.redirectUris.splice(index);
}
Expand All @@ -357,7 +389,7 @@
state.application.properties ??= {};
state.application.properties[record.key] = record.value;
}
function handleDelProperty(record) {
if (!state.application || !state.application.properties) {
return;
Expand All @@ -382,7 +414,7 @@
function handleClickUrisMenu(e) {
state.endPoint = {
component : e.key,
component: e.key,
uris: state.application[e.key],
};
state.activeTab = 'endpoints';
Expand All @@ -406,7 +438,7 @@
},
onCancel: () => {
resolve(false);
}
},
});
});
}
Expand All @@ -418,13 +450,15 @@
const api = state.application.id
? UpdateAsyncByIdAndInput(state.application.id, cloneDeep(state.application))
: CreateAsyncByInput(cloneDeep(state.application));
api.then((res) => {
createMessage.success(L('Successful'));
emits('change', res);
closeModal();
}).finally(() => {
changeOkLoading(false);
})
api
.then((res) => {
createMessage.success(L('Successful'));
emits('change', res);
closeModal();
})
.finally(() => {
changeOkLoading(false);
});
});
}
</script>
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<template>
<PermissionForm :resources="getSupportScopes" :targetResources="targetResources" @change="handleChange" />
<PermissionForm
:resources="getSupportScopes"
:targetResources="targetResources"
@change="handleChange"
/>
</template>

<script lang="ts" setup>
Expand All @@ -14,7 +18,7 @@
},
supportScopes: {
type: [Array] as PropType<string[]>,
}
},
});
const resourcesRef = ref<{ key: string; title: string }[]>([]);
Expand All @@ -29,11 +33,11 @@
const getSupportScopes = computed(() => {
const resources = unref(resourcesRef);
if (props.supportScopes) {
const supportScopes = props.supportScopes.map(scope => {
const supportScopes = props.supportScopes.map((scope) => {
return {
key: scope,
title: scope,
}
};
});
resources.forEach((resource) => {
if (!supportScopes.find((scope) => scope.key === resource.key)) {
Expand Down Expand Up @@ -65,7 +69,7 @@
emits('delete', moveKeys);
break;
case 'right':
emits('create', moveKeys);
emits('create', moveKeys);
break;
}
}
Expand Down
Loading

0 comments on commit d930a57

Please sign in to comment.