Skip to content

Commit

Permalink
Default database name not set when creating a new user, fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikVerheul committed Aug 4, 2024
1 parent f9f1bb5 commit cbaf797
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
11 changes: 5 additions & 6 deletions src/components/admin/AdminTool.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<template>
<p>store.state.selectedDatabaseName = {{ store.state.selectedDatabaseName }}</p>
<div>
<app-header></app-header>
<BContainer>
Expand Down Expand Up @@ -186,16 +187,14 @@
</BCol>
<hr>
<BCol sm="12">
<BButton v-if="!credentialsReady" class="m-1" @click="checkCredentials" variant="primary">Continue
</BButton>
<BButton v-if="!credentialsReady" class="m-1" @click="checkCredentials" variant="primary">Continue</BButton>
<BButton class="m-1" @click="cancel">Cancel</BButton>
</BCol>
</BRow>
</div>
<div v-if="credentialsReady">
<div v-if="store.state.areProductsFound">
<h4>Creating user '{{ userName }}' with assigned products in database '{{
store.state.selectedDatabaseName }}'</h4>
<h4>Creating user '{{ userName }}' with assigned products in database '{{ store.state.selectedDatabaseName }}'</h4>
<h5 v-if="store.state.isUserRemoved">[Note that user '{{ userName }}' existed, but was removed. The old
assignments are loaded]</h5>
<h5>Make this user an 'admin'?</h5>
Expand Down Expand Up @@ -285,9 +284,9 @@

<template v-else-if="optionSelected === 'Create / Maintain a team sprint calendar'">
<h4 v-if="!selectedTeamName">Maintain the team sprint calendar of a team in database '{{
store.state.selectedDatabaseName }}'</h4>
store.state.selectedDatabaseName }}'</h4>
<h4 v-else>Maintain the team sprint calendar of team '{{ selectedTeamName }}' in database '{{
store.state.selectedDatabaseName }}'</h4>
store.state.selectedDatabaseName }}'</h4>
<template v-if="!store.state.isTeamCalendarLoaded">
<BFormGroup label="Select a team">
<BFormRadioGroup v-model="selectedTeamName" :options="teamOptions" />
Expand Down
3 changes: 1 addition & 2 deletions src/components/admin/common_admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,7 @@ const methods = {

/* Creates fetchedUserData and have the prod.roles set in dbProducts */
doFetchUser(userName, justCheck) {
store.state.selectedDatabaseName = undefined
store.dispatch('getUserAction', { userName, justCheck })
store.dispatch('loadUserData', { userName, justCheck })
},

/*
Expand Down
6 changes: 3 additions & 3 deletions src/store/modules/useracc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ const state = {

const actions = {
/*
* Load the user's profile in state.fetchedUserData
* Load the user's profile in state.fetchedUserData and set several global variables
* Set the user's generic roles in state.userIsAdmin and state.userIsAPO
* Preset the selected database to the user's current database
* If justCheck === true return with rootState.isUserFound = false and no error message
*/
getUserAction({
loadUserData({
rootState,
state,
dispatch
Expand All @@ -43,7 +43,7 @@ const actions = {
rootState.isUserFound = true
}).catch(error => {
if (!payload.justCheck) {
const msg = `getUserAction: Could not find user '${payload.userName}', ${error}`
const msg = `loadUserData: Could not find user '${payload.userName}', ${error}`
rootState.backendMessages.push({ seqKey: rootState.seqKey++, msg })
dispatch('doLog', { event: msg, level: SEV.ERROR })
}
Expand Down

0 comments on commit cbaf797

Please sign in to comment.