-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/aboutBusinessConfig
- Loading branch information
Showing
8 changed files
with
28 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -293,6 +293,7 @@ kubectl delete secret,pvc --selector "app.kubernetes.io/instance"=my-release | |
| `ui.enabled` | Deploy tenant-ui | `true` | | ||
| `ui.showOIDCReservationLogin` | Use OIDC to make reservations | `false` | | ||
| `ui.quickConnectEndorserName` | Flag a ledger as auto-accept/endorse so the Tenant UI can quick connect | `""` | | ||
| `ui.requireEmailForReservation` | Whether the Email field is needed for a reservation (if false will default [email protected] to API) | `true` | | ||
| `ui.image.repository` | | `ghcr.io/bcgov/traction-tenant-ui` | | ||
| `ui.image.pullPolicy` | | `IfNotPresent` | | ||
| `ui.image.pullSecrets` | | `[]` | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -591,6 +591,9 @@ ui: | |
showOIDCReservationLogin: false | ||
## @param ui.oidc.quickConnectEndorserName A ledger that has endorser auto-accept/transact enabled | ||
quickConnectEndorserName: "" | ||
## @param ui.requireEmailForReservation Whether the Email field is needed for a tenant reservation | ||
## If false will default [email protected] to API | ||
requireEmailForReservation: true | ||
image: | ||
## @param ui.image.repository | ||
repository: ghcr.io/bcgov/traction-tenant-ui | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,4 +35,4 @@ | |
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,17 +50,20 @@ import { useToast } from 'vue-toastification'; | |
import { JsonForms, JsonFormsChangeEvent } from '@jsonforms/vue'; | ||
import { vanillaRenderers } from '@jsonforms/vue-vanilla'; | ||
// State | ||
import { useReservationStore } from '@/store'; | ||
import { useConfigStore, useReservationStore } from '@/store'; | ||
import { storeToRefs } from 'pinia'; | ||
// Components | ||
import { RESERVATION_STATUSES } from '@/helpers/constants'; | ||
import ShowWallet from './status/ShowWallet.vue'; | ||
import ReservationConfirmation from './ReservationConfirmation.vue'; | ||
import axios from 'axios'; | ||
import { stringOrBooleanTruthy } from '@/helpers'; | ||
const toast = useToast(); | ||
// State setup | ||
const configStore = useConfigStore(); | ||
const { config } = storeToRefs(useConfigStore()); | ||
const reservationStore = useReservationStore(); | ||
const { loading, status } = storeToRefs(useReservationStore()); | ||
|
@@ -129,8 +132,11 @@ const manProperties = { | |
type: 'string', | ||
}, | ||
}; | ||
const manRequired = ['tenantName']; | ||
if (stringOrBooleanTruthy(config.value?.frontend?.requireEmailForReservation)) { | ||
manRequired.push('emailAddress'); | ||
} | ||
const manRequired = ['emailAddress', 'tenantName']; | ||
const manElements = [ | ||
{ | ||
type: 'Control', | ||
|
@@ -295,6 +301,13 @@ const handleSubmit = async (event: any) => { | |
tenant_name: tenantName, | ||
context_data: contextData, | ||
}; | ||
// If the email address is blank and not required, put a dummy value in. | ||
if ( | ||
!emailAddress && | ||
!stringOrBooleanTruthy(config.value?.frontend?.requireEmailForReservation) | ||
) { | ||
formFields.value.contact_email = '[email protected]'; | ||
} | ||
const res = await reservationStore.makeReservation(formFields.value); | ||
reservationIdResult.value = res.reservation_id; | ||
|