Skip to content

Commit

Permalink
Merge pull request #131 from ConductionNL/feature/PC108-144/bugfix
Browse files Browse the repository at this point in the history
feature/PC108-144/bugfix
  • Loading branch information
Sudo-Thijn authored Jan 3, 2025
2 parents d82ed2e + 2137849 commit eaf2cd6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 37 deletions.
50 changes: 18 additions & 32 deletions src/modals/contactMomenten/ContactMomentenForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -823,50 +823,36 @@ export default {
this.fetchLoading = false
},
async fetchMedewerkers(medewerkerEmail = null) {
async fetchMedewerkers(medewerkerId = null) {
return Promise.all([
medewerkerStore.refreshMedewerkersList(),
fetch('/ocs/v1.php/cloud/users/details', {
method: 'GET',
headers: {
Accept: 'application/json',
'OCS-APIRequest': 'true',
},
}).then(response => response.json()),
fetch('/index.php/apps/zaakafhandelapp/me').then(response => response.json()),
])
.then(([{ data }, { user }]) => {
const medewerkerToSelect = medewerkerEmail ?? data.find(medewerker => medewerker.email === user.email)?.email
const selectedMedewerker = data.find(medewerker => medewerker.email === medewerkerToSelect) || null
.then(([usersData, { user: currentUser }]) => {
const users = Object.values(usersData.ocs.data.users)
const medewerkerToSelect = medewerkerId ?? users.find(medewerker => medewerker.id === currentUser.id)?.id
const selectedMedewerker = users.find(medewerker => medewerker.id === medewerkerToSelect) || null
this.medewerkers = {
options: data.map(medewerker => ({
id: medewerker.id,
displayName: `${medewerker.voornaam} ${medewerker.tussenvoegsel} ${medewerker.achternaam}`,
options: Object.values(users).map((medewerker) => ({
id: medewerker.email,
displayName: medewerker.displayname,
subname: medewerker.email,
email: medewerker.email,
isNoUser: false,
icon: null,
user: medewerker.id,
// if it is the current user show online status, there is currently no way of knowing other user statuses
...(medewerker.email === user.email && {
preloadedUserStatus: {
icon: null,
status: 'online',
message: 'I am online',
},
}),
})),
values: [selectedMedewerker
? {
id: selectedMedewerker.id,
displayName: `${selectedMedewerker.voornaam} ${selectedMedewerker.tussenvoegsel} ${selectedMedewerker.achternaam}`,
id: selectedMedewerker?.email,
displayName: selectedMedewerker.displayname,
subname: selectedMedewerker.email,
email: selectedMedewerker.email,
isNoUser: false,
icon: null,
user: selectedMedewerker.id,
// if it is the current user show online status, there is currently no way of knowing other user statuses
...(selectedMedewerker.email === user.email && {
preloadedUserStatus: {
icon: null,
status: 'online',
message: 'I am online',
},
}),
}
: null],
}
Expand Down
10 changes: 5 additions & 5 deletions src/modals/klanten/SearchKlantModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,24 @@ import { klantStore } from '../../store/store.js'
<NcTextField :disabled="loading"
label="achternaam"
maxlength="255"
class="searchField"
class="klantSearchField"
:value.sync="searchQuery[1]" />
</div>
<div v-else-if="klantenSearchType === 'postcode_huisnummer'" class="flex">
<NcTextField :disabled="loading"
maxlength="255"
class="searchField"
class="klantSearchField"
:value.sync="searchQuery[0]" />

<NcTextField :disabled="loading"
maxlength="255"
class="searchField"
class="klantSearchField"
:value.sync="searchQuery[1]" />
</div>
<div v-else>
<NcTextField :disabled="loading"
maxlength="255"
class="searchField"
class="klantSearchField"
:value.sync="searchQuery[0]" />
</div>
</div>
Expand Down Expand Up @@ -409,7 +409,7 @@ export default {
margin-block-end: 3px;
}
.searchField {
.klantSearchField {
width: auto;
}
Expand Down

0 comments on commit eaf2cd6

Please sign in to comment.