Unverified Commit 86f2534a authored by Alberto Nale's avatar Alberto Nale Committed by GitHub
Browse files

Sprint 15 bugfix

Changed GDPR Metadata for Business Models to show checkboxes for the old models. This won't do anything to them because they don't have those properties and BE needs to be fixed.
Possible bugfix for document execution/document browser
parents 79ec746a 5d5edb31
......@@ -17,16 +17,7 @@
</TabPanel>
</TabView>
<DocumentBrowserTab
v-show="selectedItem && selectedItem.mode"
:item="selectedItem?.item"
:mode="selectedItem?.mode"
:functionalityId="selectedItem?.functionalityId"
@close="closeDocument('current')"
@iframeCreated="onIFrameCreated"
@closeIframe="closeIframe"
@documentSaved="onDocumentSaved"
></DocumentBrowserTab>
<DocumentBrowserTab v-show="selectedItem && selectedItem.mode" :item="selectedItem?.item" :functionalityId="selectedItem?.functionalityId" @close="closeDocument('current')" @iframeCreated="onIFrameCreated" @closeIframe="closeIframe" @documentSaved="onDocumentSaved"></DocumentBrowserTab>
<div v-for="(iframe, index) in iFrameContainers" :key="index">
<iframe v-show="iframe.item?.routerId === selectedItem?.item.routerId" ref="iframe" class="document-browser-cockpit-iframe" :src="iframe.iframe"></iframe>
</div>
......@@ -73,7 +64,14 @@ export default defineComponent({
let tempDocument = {} as any
await this.$http.get(process.env.VUE_APP_RESTFUL_SERVICES_PATH + `2.0/documents/${this.$router.currentRoute.value.params.id}`).then((response: AxiosResponse<any>) => (tempDocument = response.data))
const tempItem = {
item: { name: tempDocument.name, label: this.$router.currentRoute.value.params.id, mode: this.$router.currentRoute.value.params.mode, routerId: crypto.randomBytes(16).toString('hex'), id: this.$router.currentRoute.value.params.id },
item: {
name: tempDocument.name,
label: this.$router.currentRoute.value.params.id,
mode: this.$router.currentRoute.value.params.mode,
routerId: crypto.randomBytes(16).toString('hex'),
id: this.$router.currentRoute.value.params.id,
showMode: this.$router.currentRoute.value.name === 'document-browser-document-execution' ? 'execute' : 'documentDetail'
},
mode: this.$router.currentRoute.value.name === 'document-browser-document-execution' ? 'execute' : 'documentDetail'
}
this.tabs.push(tempItem)
......@@ -116,14 +114,17 @@ export default defineComponent({
if (payload.mode === 'documentDetail') {
const path = payload.functionalityId ? `/document-browser/document-details/new/${payload.functionalityId}` : `/document-browser/document-details/${payload.item.id}`
this.selectedItem.item.showMode = 'documentDetail'
this.$router.push(path)
} else {
const id = payload.item ? payload.item.label : 'new-dashboard'
if (payload.item) {
let routeDocumentType = this.getRouteDocumentType(payload.item)
this.selectedItem.item.showMode = 'execute'
this.$router.push(`/document-browser/${routeDocumentType}/` + id)
} else {
this.selectedItem.item = { routerId: crypto.randomBytes(16).toString('hex') }
this.selectedItem.item.showMode = 'createCockpit'
this.$router.push(`/document-browser/new-dashboard`)
}
}
......@@ -233,7 +234,7 @@ export default defineComponent({
},
loadSavedCockpit(cockpit: any) {
this.closeIframe()
this.selectedItem = { item: { ...cockpit, routerId: crypto.randomBytes(16).toString('hex'), name: cockpit.DOCUMENT_NAME, label: cockpit.DOCUMENT_LABEL, mode: 'document-composite' } }
this.selectedItem = { item: { ...cockpit, routerId: crypto.randomBytes(16).toString('hex'), name: cockpit.DOCUMENT_NAME, label: cockpit.DOCUMENT_LABEL, showMode: 'createCockpit' } }
this.tabs[this.activeIndex - 1] = this.selectedItem
this.$router.push(`/document-browser/document-composite/${cockpit.DOCUMENT_LABEL}`)
},
......
......@@ -32,7 +32,7 @@ export default defineComponent({
DocumentExecution,
DocumentDetails
},
props: { id: { type: String }, functionalityId: { type: String }, item: { type: Object }, parameterValuesMap: { type: Object }, tabKey: { type: String }, propMode: { type: String } },
props: { id: { type: String }, functionalityId: { type: String }, item: { type: Object }, parameterValuesMap: { type: Object }, tabKey: { type: String } },
emits: ['iframeCreated', 'closeIframe', 'parametersChanged', 'closeDetails', 'documentSaved'],
data() {
return {
......@@ -46,9 +46,6 @@ export default defineComponent({
id() {
this.name = this.id as string
this.setMode()
},
propMode() {
this.setMode()
}
},
created() {
......@@ -72,11 +69,13 @@ export default defineComponent({
this.url = process.env.VUE_APP_HOST_URL + `/knowagecockpitengine/api/1.0/pages/edit?NEW_SESSION=TRUE&SBI_LANGUAGE=${language}&user_id=${uniqueID}&SBI_COUNTRY=${country}&SBI_ENVIRONMENT=DOCBROWSER&IS_TECHNICAL_USER=true&documentMode=EDIT&FUNCTIONALITY_ID=${this.functionalityId}`
},
setMode() {
if (this.propMode === 'documentDetail') {
if (!this.item) return
if (this.item.showMode === 'documentDetail') {
this.mode = 'document-detail'
} else if (this.propMode === 'execute') {
} else if (this.item.showMode === 'execute') {
this.mode = 'document-execution'
} else if (this.propMode === 'createCockpit') {
} else if (this.item.showMode === 'createCockpit') {
this.mode = 'cockpit'
this.$emit('iframeCreated', { iframe: this.url, item: this.item })
}
......
......@@ -6,7 +6,6 @@
:item="item"
:parameterValuesMap="parameterValuesMap"
:tabKey="key"
:propMode="mode"
@close="$emit('close', item)"
@parametersChanged="onParametersChange"
@iframeCreated="onIframeCreated"
......@@ -27,7 +26,7 @@ export default defineComponent({
name: 'document-browser-tab',
components: {},
emits: ['close', 'iframeCreated', 'closeIframe', 'documentSaved'],
props: { item: { type: Object }, mode: { type: String }, functionalityId: { type: String } },
props: { item: { type: Object }, functionalityId: { type: String } },
data() {
return {
parameterValuesMap: {} as any
......
......@@ -2,21 +2,19 @@
<div>
<DataTable v-if="businessModel" class="p-datatable-sm kn-table p-m-2" :value="businessModel.columns" :loading="loading" responsiveLayout="stack" breakpoint="960px" @rowReorder="onRowReorder">
<Column :rowReorder="true" :headerStyle="metawebAttributesTabDescriptor.reorderColumnStyle" :reorderableColumn="false" />
<template v-for="(column, index) in metawebAttributesTabDescriptor.columns" :key="index">
<Column class="kn-truncated" v-if="columnIsVisible(column)" :field="column.field" :header="$t(column.header)">
<template #body="slotProps">
<div class="p-d-flex p-flex-row">
<Checkbox v-if="column.field === 'identifier'" v-model="slotProps.data[slotProps.column.props.field]" :binary="true" @change="$emit('metaUpdated')"></Checkbox>
<Checkbox v-else-if="column.field === 'visible'" v-model="columnsVisibility[slotProps.data.uniqueName]" :binary="true" @change="onChange(slotProps.data, 'visibility')"></Checkbox>
<Checkbox v-else-if="column.field === 'personal' && columnsPersonal[slotProps.data.uniqueName] !== undefined" v-model="columnsPersonal[slotProps.data.uniqueName]" :binary="true" @change="onChange(slotProps.data, 'personal')"></Checkbox>
<Checkbox v-else-if="column.field === 'decrypt' && columnsDecrypt[slotProps.data.uniqueName] !== undefined" v-model="columnsDecrypt[slotProps.data.uniqueName]" :binary="true" @change="onChange(slotProps.data, 'decrypt')"></Checkbox>
<Checkbox v-else-if="column.field === 'subjectId' && columnsSubjectId[slotProps.data.uniqueName] !== undefined" v-model="columnsSubjectId[slotProps.data.uniqueName]" :binary="true" @change="onChange(slotProps.data, 'subjectId')"></Checkbox>
<span v-else-if="column.field === 'type'">{{ columnsType[slotProps.data.uniqueName] }}</span>
<span v-else>{{ slotProps.data[slotProps.column.props.field] }}</span>
</div>
</template>
</Column>
</template>
<Column class="kn-truncated" v-for="(column, index) in metawebAttributesTabDescriptor.columns" :key="index" :field="column.field" :header="$t(column.header)">
<template #body="slotProps">
<div class="p-d-flex p-flex-row">
<Checkbox v-if="column.field === 'identifier'" v-model="slotProps.data[slotProps.column.props.field]" :binary="true" @change="$emit('metaUpdated')"></Checkbox>
<Checkbox v-else-if="column.field === 'visible'" v-model="columnsVisibility[slotProps.data.uniqueName]" :binary="true" @change="onChange(slotProps.data, 'visibility')"></Checkbox>
<Checkbox v-else-if="column.field === 'personal'" v-model="columnsPersonal[slotProps.data.uniqueName]" :binary="true" @change="onChange(slotProps.data, 'personal')"></Checkbox>
<Checkbox v-else-if="column.field === 'decrypt'" v-model="columnsDecrypt[slotProps.data.uniqueName]" :binary="true" @change="onChange(slotProps.data, 'decrypt')"></Checkbox>
<Checkbox v-else-if="column.field === 'subjectId'" v-model="columnsSubjectId[slotProps.data.uniqueName]" :binary="true" @change="onChange(slotProps.data, 'subjectId')"></Checkbox>
<span v-else-if="column.field === 'type'">{{ columnsType[slotProps.data.uniqueName] }}</span>
<span v-else>{{ slotProps.data[slotProps.column.props.field] }}</span>
</div>
</template>
</Column>
<Column :style="metawebAttributesTabDescriptor.iconColumnStyle">
<template #header>
<Button class="kn-button kn-button--primary p-button-link p-jc-center" @click="openUnusedFieldsDialog" data-test="add-button"> {{ $t('common.add') }}</Button>
......@@ -226,11 +224,6 @@ export default defineComponent({
.catch(() => {})
.finally(() => generate(this.observer))
this.loading = false
},
columnIsVisible(column: any) {
if ((column.field === 'personal' && !this.propertyKeys.includes('structural.personal')) || (column.field === 'decrypt' && !this.propertyKeys.includes('structural.decrypt')) || (column.field === 'subjectId' && !this.propertyKeys.includes('structural.subjectId'))) return false
return true
}
}
})
......
......@@ -229,8 +229,10 @@ export default defineComponent({
event.dataTransfer.effectAllowed = 'move'
},
setFilteredWords(words: any) {
this.loading = true
this.nodes = []
words.forEach((el: any) => this.nodes.push(this.createNode(el)))
this.loading = false
},
setLoading(value: boolean) {
this.loading = value
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment