Skip to content

Commit

Permalink
Feature/#884 set formfields over query parameter (#1083)
Browse files Browse the repository at this point in the history
* #884: implement variable merger

* #1061: add tests

* #1055: add type mapping for schema inputs

* #884: save json string to input parameter

* #884: add url query to formfields to start process

* #884: merged dev and updated package-lock.json
  • Loading branch information
StephanStrehlerCGI authored Jan 18, 2024
1 parent a53f00b commit 3829af5
Show file tree
Hide file tree
Showing 16 changed files with 328 additions and 77 deletions.
1 change: 0 additions & 1 deletion digiwf-apps/packages/apps/digiwf-tasklist/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ declare module 'vue' {
VListItemTitle: typeof import('vuetify/lib')['VListItemTitle']
VMain: typeof import('vuetify/lib')['VMain']
VMenu: typeof import('vuetify/lib')['VMenu']
VMessages: typeof import('vuetify/lib')['VMessages']
VMultiUserInput: typeof import('./src/components/schema/VMultiUserInput.vue')['default']
VNavigationDrawer: typeof import('vuetify/lib')['VNavigationDrawer']
VProgressCircular: typeof import('vuetify/lib')['VProgressCircular']
Expand Down
83 changes: 50 additions & 33 deletions digiwf-apps/packages/apps/digiwf-tasklist/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions digiwf-apps/packages/apps/digiwf-tasklist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
"@muenchen/digiwf-task-api-internal": "^1.6.0",
"@muenchen/vjsf": "^2.21.9",
"@tanstack/vue-query": "^4.19.1",
"ajv": "^8.12.0",
"core-js": "^3.8.3",
"debounce": "^1.2.1",
"easymde": "^2.15.0",
"lodash": "^4.17.21",
"luxon": "^1.25.0",
"marked": "^4.1.1",
"moment-timezone": "^0.5.43",
Expand All @@ -38,8 +40,10 @@
},
"devDependencies": {
"@mdi/font": "^5.9.55",
"@types/axios": "^0.14.0",
"@types/debounce": "^1.2.2",
"@types/jest": "^27.5.2",
"@types/lodash": "^4.14.202",
"@types/luxon": "^1.25.0",
"@types/node": "^16.9.1",
"@types/vue-markdown": "2.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,33 @@ import {ApiConfig} from "../ApiConfig";
import {
FetchUtils,
PageServiceDefinitionTO,
ServiceDefinitionControllerApiFactory
ServiceDefinitionControllerApiFactory, ServiceDefinitionDetailTO
} from "@muenchen/digiwf-engine-api-internal";
import {AxiosError} from "axios";


export const callGetProcessDefinitionsFromEngine = (page: number, size: number, query?: string): Promise<PageServiceDefinitionTO> => {
const cfg = ApiConfig.getAxiosConfig(FetchUtils.getGETConfig());

return ServiceDefinitionControllerApiFactory(cfg).getServiceDefinitions(page, size, query)
.then(res => Promise.resolve(res.data))
.catch(_ => Promise.reject("Die Vorgänge konnten nicht geladen werden. Bitte versuchen Sie es erneut."))
.catch(() => Promise.reject("Die Vorgänge konnten nicht geladen werden. Bitte versuchen Sie es erneut."));
};

export const callGetProcessDefinition = (processKey: string): Promise<ServiceDefinitionDetailTO> => {
const cfg = ApiConfig.getAxiosConfig(FetchUtils.getGETConfig());
return ServiceDefinitionControllerApiFactory(cfg)
.getServiceDefinition(processKey)
.then(res => Promise.resolve<ServiceDefinitionDetailTO>(res.data))
.catch((e: AxiosError) => {
const status = e.response?.status;
if(!status) {
return Promise.reject("Der Vorgang konnte nicht geladen werden.");
}
if(status === 403) {
return Promise.reject("Es liegt keine Berechtigung zum Starten dieses Vorgangs vor. " +
"Weitere Infos finden Sie in unseren FAQs in Wilma.");
}
return Promise.reject("Der Vorgang konnte nicht geladen werden. Status Code: " + status);
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

<script lang="ts">
import {Component, Emit, Prop, Vue} from "vue-property-decorator";
import {filterInputsWithValue} from "../../utils/dataTransformations";
@Component
export default class AppJsonForm extends Vue {
Expand All @@ -62,6 +63,7 @@ export default class AppJsonForm extends Vue {
@Prop()
isCompleting: boolean | undefined;
@Emit("complete-form")
completeForm(value: any): any {
return value;
Expand All @@ -70,6 +72,16 @@ export default class AppJsonForm extends Vue {
@Emit("input")
input(value: any): any {
this.currentValue = value;
const filteredValues = filterInputsWithValue(value);
const newInputsString = JSON.stringify(filteredValues);
const newQuery = {
...this.$router.currentRoute.query,
inputs: newInputsString
};
this.$router.replace({query:newQuery});
return value;
}
Expand All @@ -82,7 +94,6 @@ export default class AppJsonForm extends Vue {
created() {
this.currentValue = this.value;
}
}
</script>

Expand Down
Loading

0 comments on commit 3829af5

Please sign in to comment.