diff --git a/deploy/traction/values-development.yaml b/deploy/traction/values-development.yaml
index 4f2ee6fb8..c744d2db0 100644
--- a/deploy/traction/values-development.yaml
+++ b/deploy/traction/values-development.yaml
@@ -94,8 +94,8 @@ ui:
showMessage: true
oidc:
active: true
- authority: https://dev.loginproxy.gov.bc.ca/auth/realms/digitaltrust-nrm
- jwksUri: https://dev.loginproxy.gov.bc.ca/auth/realms/digitaltrust-nrm/protocol/openid-connect/certs
+ authority: https://dev.loginproxy.gov.bc.ca/auth/realms/digitaltrust-citz
+ jwksUri: https://dev.loginproxy.gov.bc.ca/auth/realms/digitaltrust-citz/protocol/openid-connect/certs
reservationForm: >-
{
"formDataSchema": {
diff --git a/deploy/traction/values-pr.yaml b/deploy/traction/values-pr.yaml
index 654662cdf..9d2ff097e 100644
--- a/deploy/traction/values-pr.yaml
+++ b/deploy/traction/values-pr.yaml
@@ -85,8 +85,8 @@ ui:
showMessage: true
oidc:
active: true
- authority: https://dev.loginproxy.gov.bc.ca/auth/realms/digitaltrust-nrm
- jwksUri: https://dev.loginproxy.gov.bc.ca/auth/realms/digitaltrust-nrm/protocol/openid-connect/certs
+ authority: https://dev.loginproxy.gov.bc.ca/auth/realms/digitaltrust-citz
+ jwksUri: https://dev.loginproxy.gov.bc.ca/auth/realms/digitaltrust-citz/protocol/openid-connect/certs
reservationForm: >-
{
"formDataSchema": {
diff --git a/services/tenant-ui/config/default.json b/services/tenant-ui/config/default.json
index 034f72a7a..e21b49d96 100644
--- a/services/tenant-ui/config/default.json
+++ b/services/tenant-ui/config/default.json
@@ -15,7 +15,7 @@
},
"oidc": {
"active": false,
- "authority": "https://dev.loginproxy.gov.bc.ca/auth/realms/digitaltrust-nrm",
+ "authority": "https://dev.loginproxy.gov.bc.ca/auth/realms/digitaltrust-citz",
"client": "innkeeper-frontend",
"label": "IDIR"
},
@@ -53,8 +53,8 @@
"staticFiles": "../../frontend/dist",
"tractionUrl": "http://localhost:5100",
"oidc": {
- "jwksUri": "https://dev.loginproxy.gov.bc.ca/auth/realms/digitaltrust-nrm/protocol/openid-connect/certs",
- "realm": "digitaltrust-nrm",
+ "jwksUri": "https://dev.loginproxy.gov.bc.ca/auth/realms/digitaltrust-citz/protocol/openid-connect/certs",
+ "realm": "digitaltrust-citz",
"roleName": "innkeeper"
},
"innkeeper": {
diff --git a/services/tenant-ui/frontend/src/components/common/ToggleJson.vue b/services/tenant-ui/frontend/src/components/common/ToggleJson.vue
new file mode 100644
index 000000000..35bc5a85d
--- /dev/null
+++ b/services/tenant-ui/frontend/src/components/common/ToggleJson.vue
@@ -0,0 +1,60 @@
+
+
+
+ {{ $t('common.json') }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/services/tenant-ui/frontend/src/components/issuance/credentials/EnterCredentialValues.vue b/services/tenant-ui/frontend/src/components/issuance/credentials/EnterCredentialValues.vue
index 0ac7a0408..507611d52 100644
--- a/services/tenant-ui/frontend/src/components/issuance/credentials/EnterCredentialValues.vue
+++ b/services/tenant-ui/frontend/src/components/issuance/credentials/EnterCredentialValues.vue
@@ -11,43 +11,13 @@
-
-
-
-
-
-
- {{ $t('common.json') }}
-
-
-
-
-
-
-
-
-
-
-
- {{ $t('issue.schema') }}: {{ schemaForSelectedCred.schema.name }}
-
- {{ $t('issue.version') }}:
- {{ schemaForSelectedCred.schema.version }}
-
-
-
-
-
-
+
+
+
+
+ {{ $t('issue.schema') }}: {{ schemaForSelectedCred.schema.name }}
+
+ {{ $t('issue.version') }}:
+ {{ schemaForSelectedCred.schema.version }}
+
-
@@ -73,16 +51,20 @@
import { onMounted, ref } from 'vue';
// PrimeVue / Validation
import Button from 'primevue/button';
-import InputSwitch from 'primevue/inputswitch';
import InputText from 'primevue/inputtext';
-import Textarea from 'primevue/textarea';
import { useToast } from 'vue-toastification';
+import { tryParseJson } from '@/helpers/jsonParsing';
+import ToggleJson from '@/components/common/ToggleJson.vue';
const toast = useToast();
// Props
+interface CredentialValue {
+ name: string;
+ value: string;
+}
interface Props {
- existingCredentialValues?: { name: string; value: string }[];
+ existingCredentialValues?: CredentialValue[];
header: String;
schemaForSelectedCred: any;
}
@@ -91,58 +73,43 @@ const props = defineProps();
const emit = defineEmits(['back', 'save']);
// Fields
-const credentialValuesJson = ref('');
-const credentialValuesRaw = ref([] as { name: string; value: string }[]);
-
-const showRawJson = ref(false);
+const credentialValuesRaw = ref([]);
-// TODO: util function file
-function _tryParseJson(jsonString: string) {
- try {
- const o = JSON.parse(jsonString);
- if (o && typeof o === 'object') {
- return o;
- }
- return false;
- } catch (e) {
- return false;
- }
-}
+const jsonVal = ref<{ showRawJson: boolean; valuesJson: string }>({
+ showRawJson: false,
+ valuesJson: '',
+});
-function _jsonToCredRaw() {
- const parsed = _tryParseJson(credentialValuesJson.value);
+function jsonToCredentialValue(
+ jsonString: string
+): CredentialValue[] | undefined {
+ const parsed = tryParseJson(jsonString);
if (parsed) {
- credentialValuesRaw.value = JSON.parse(credentialValuesJson.value);
+ credentialValuesRaw.value = parsed;
+ return parsed;
} else {
toast.warning('The JSON you inputted has invalid syntax');
+ return undefined;
}
}
-const toggleJson = () => {
- if (showRawJson.value) {
- // Convert over to the json from what was entered on the fields
- credentialValuesJson.value = JSON.stringify(
- credentialValuesRaw.value,
- undefined,
- 2
- );
- } else {
- // Parse the entered JSON into fields, or ignore and warn if invalid syntax
- _jsonToCredRaw();
- }
-};
+function credentialValueToJson(): string | undefined {
+ // Convert over to the json from what was entered on the fields
+ const j = JSON.stringify(credentialValuesRaw.value, undefined, 2);
+ return j;
+}
const saveCredValues = () => {
- if (showRawJson.value) {
- _jsonToCredRaw();
+ if (jsonVal.value.showRawJson) {
+ jsonToCredentialValue(jsonVal.value.valuesJson);
}
emit('save', credentialValuesRaw.value);
};
-// Whnen the component is intialized set up the fields and raw JSON based
+// When the component is initialized set up the fields and raw JSON based
// on the supplied schema and if there is existing values already
onMounted(() => {
- // Popuplate cred editor if it's not already been edited
+ // Populate cred editor if it's not already been edited
if (!props.existingCredentialValues?.length) {
const schemaFillIn = props.schemaForSelectedCred.schema.attrNames.map(
(a: string) => {
@@ -158,10 +125,5 @@ onMounted(() => {
} else {
credentialValuesRaw.value = props.existingCredentialValues;
}
- credentialValuesJson.value = JSON.stringify(
- credentialValuesRaw.value,
- undefined,
- 2
- );
});
diff --git a/services/tenant-ui/frontend/src/components/issuance/schemas/CreateSchemaForm.vue b/services/tenant-ui/frontend/src/components/issuance/schemas/CreateSchemaForm.vue
index e31864050..834ee6138 100644
--- a/services/tenant-ui/frontend/src/components/issuance/schemas/CreateSchemaForm.vue
+++ b/services/tenant-ui/frontend/src/components/issuance/schemas/CreateSchemaForm.vue
@@ -8,28 +8,38 @@
{{ selectedSchema?.schema_id }}
-
-
-
-
-
-
+
+
+
+
+
+
+
+