Merge branch 'feature-67041/CIS4_Profilupdate_bugfixes'

This commit is contained in:
Harald Bamberger
2025-09-16 13:55:16 +02:00
6 changed files with 122 additions and 16 deletions
@@ -1,6 +1,6 @@
import { replaceRelativeLegacyLink } from "../../../../helpers/LegacyLinkReplaceHelper.js"
export default {
name: "GeneralComponent",
name: "NewsContentType",
props:{
content:{
type:String,
@@ -88,6 +88,18 @@ export default {
if (isMitarbeiter) {
content["isMitarbeiter"] = isMitarbeiter;
}
const filesFromDatabase =
await this.$api
.call(ApiProfilUpdate.getProfilRequestFiles(
updateRequest.profil_update_id
))
.then((res) => {
return res.data;
});
files = filesFromDatabase;
content["files"] = files;
}
//? adds the status information if the profil update request was rejected or accepted
@@ -1,8 +1,11 @@
import Dms from "../../../../Form/Upload/Dms.js";
import ApiProfil from '../../../../../api/factory/profil.js';
export default {
components: {
AutoComplete: primevue.autocomplete,
Dms: Dms
},
props: {
@@ -11,9 +14,13 @@ export default {
type: Boolean,
default: false,
},
files: {
type: Array,
default: []
},
},
inject: ["getZustelladressenCount"],
inject: ["getZustelladressenCount", "updateFileID"],
data() {
return {
@@ -23,6 +30,8 @@ export default {
nationenList: [],
originalValue: null,
zustellAdressenCount: null,
dmsData: [],
fileschanged: false
};
},
@@ -83,6 +92,11 @@ export default {
//? sets the value of a property to null when an empty string is entered to keep the isChanged function valid
if (bind === "zustelladresse") {
this.data[bind] = event.target.checked;
} else if(bind === 'files') {
if(this.dmsData.length > 0 && this.dmsData[0].type !== 'application/x.fhc-dms+json') {
this.fileschanged = true;
}
this.updateFileID(this.dmsData);
} else {
this.data[bind] = event.target.value === "" ? null : event.target.value;
}
@@ -91,6 +105,11 @@ export default {
// update the zustellAdressen count
this.zustellAdressenCount = this.getZustelladressenCount();
},
deleteDmsData: function() {
this.dmsData = [];
this.updateValue(null, 'files');
}
},
computed: {
@@ -111,12 +130,14 @@ export default {
!this.data.strasse ||
!this.data.plz ||
!this.data.ort ||
!this.data.typ
!this.data.typ ||
this.dmsData.length === 0
) {
return false;
}
return this.originalValue !== JSON.stringify(this.data);
const datachanged = this.originalValue !== JSON.stringify(this.data);
return datachanged || this.fileschanged;
},
},
@@ -133,6 +154,12 @@ export default {
this.zustellAdressenCount = this.getZustelladressenCount();
},
mounted() {
if (this.files) {
this.dmsData = this.files;
}
},
template: /*html*/ `
<div class="gy-3 row justify-content-center align-items-center">
<!-- warning message for too many zustellungs Adressen -->
@@ -212,9 +239,28 @@ export default {
</div>
</div>
<div class="row g-2">
<div class="col">
<div class="form-underline-titel">{{$p.t('profilUpdate','meldebestaetigung')}}*</div>
<dms
ref="update"
id="files"
name="files"
:multiple="false"
v-model="dmsData"
@update:model-value="updateValue($event,'files')"
></dms>
</div>
<div class="col-auto">
<div>&nbsp;</div>
<button
@click="deleteDmsData"
class="btn btn-danger"
:aria-label="$p.t('profilUpdate','deleteAttachment')"
:title="$p.t('profilUpdate','deleteAttachment')"
><i style="color:white" class="fa fa-trash" aria-hidden="true"></i></button>
</div>
</div>
</div>
`,
@@ -112,14 +112,17 @@ export default {
<div class="form-underline-titel">{{topic}}</div>
<span class="form-underline-content">{{data.value}} </span>
</div>
<div v-if="files?.length" class="ms-2">
<a target="_blank" :href="getDocumentLink(file.dms_id)" v-for="file in files">{{file.name}}</a>
</div>
</template>
<component v-else :is="getComponentView" :data="data"></component>
</div>
</div>
<div v-if="files?.length" class="card mt-4">
<div class="card-header">{{$p.t('profilUpdate','nachweisdokumente')}}</div>
<div class="card-body">
<a target="_blank" :href="getDocumentLink(file.dms_id)" v-for="file in files">{{file.name}}</a>
</div>
</div>
`,
};
@@ -188,16 +188,21 @@ export default {
<span class="form-underline-content" >{{data.requested_change.value}}</span>
</div>
<div v-if="files?.length" class="ms-2">
<a v-for="file in files" target="_blank" :href="getDocumentLink(file.dms_id)" >{{file.name}}</a>
</div>
</template>
<component v-else :is="getComponentView" :withZustelladresse="getComponentView==='adresse'?true:false" :data="data.requested_change"></component>
</div>
</div>
<div v-if="files?.length" class="card mt-3">
<div class="card-header">{{$p.t('profilUpdate','nachweisdokumente')}}</div>
<div class="card-body">
<a v-for="file in files" target="_blank" :href="getDocumentLink(file.dms_id)" >{{file.name}}</a>
</div>
</div>
</div>
</div>
+41 -1
View File
@@ -29149,7 +29149,7 @@ array(
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Erneuern Sie ihr {0} und laden Sie die passenden Beweisdokumente hoch',
'text' => 'Aktualisieren Sie ihren {0} und laden Sie die passenden Nachweisdokumente hoch',
'description' => '',
'insertvon' => 'system'
),
@@ -48370,6 +48370,46 @@ and represent the current state of research on the topic. The prescribed citatio
)
)
),
array(
'app' => 'core',
'category' => 'profilUpdate',
'phrase' => 'meldebestaetigung',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Meldebestätigung',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Confirmation of registration',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'profilUpdate',
'phrase' => 'nachweisdokumente',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Nachweisdokumente',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Confirmation documents',
'description' => '',
'insertvon' => 'system'
)
)
),
);