Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature flags 717 #743

Merged
merged 22 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/tenant-ui/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ data:
FRONTEND_INNKEEPER_OIDC_CLIENT: {{ .Values.oidc.client | quote }}
FRONTEND_INNKEEPER_OIDC_LABEL: {{ .Values.oidc.label | quote }}
FRONTEND_INNKEEPER_SHOW_ADMIN: {{ .Values.oidc.showInnkeeperAdminLogin | quote }}
FRONTEND_TENANT_SHOW_WRITABLE_COMPONENTS: {{ .Values.oidc.showWritableComponents | quote }}
FRONTEND_TENANT_PROXY_URL: {{ .Values.traction.tenantProxyEndpoint }}
SERVER_OIDC_JWKS: {{ .Values.oidc.jwksUri | quote }}
SERVER_OIDC_REALM: {{ .Values.oidc.realm | quote }}
Expand Down
1 change: 1 addition & 0 deletions deploy/tenant-ui/values-development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ traction:
oidc:
active: true
showInnkeeperAdminLogin: true
showWritableComponents: 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
ariesDetails:
Expand Down
1 change: 1 addition & 0 deletions deploy/tenant-ui/values-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ traction:
oidc:
active: true
showInnkeeperAdminLogin: true
showWritableComponents: 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
ariesDetails:
Expand Down
1 change: 1 addition & 0 deletions deploy/tenant-ui/values-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ traction:
oidc:
active: true
showInnkeeperAdminLogin: true
showWritableComponents: true
popkinj marked this conversation as resolved.
Show resolved Hide resolved
authority: https://loginproxy.gov.bc.ca/auth/realms/digitaltrust-nrm
jwksUri: https://loginproxy.gov.bc.ca/auth/realms/digitaltrust-nrm/protocol/openid-connect/certs
ariesDetails:
Expand Down
1 change: 1 addition & 0 deletions deploy/tenant-ui/values-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ traction:
oidc:
active: true
showInnkeeperAdminLogin: true
showWritableComponents: true
authority: https://test.loginproxy.gov.bc.ca/auth/realms/digitaltrust-nrm
jwksUri: https://test.loginproxy.gov.bc.ca/auth/realms/digitaltrust-nrm/protocol/openid-connect/certs
ariesDetails:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"tenantProxyPath": "FRONTEND_TENANT_PROXY_URL",
"showInnkeeperReservationPassword": "FRONTEND_INNKEEPER_SHOW_RESERVATION_PASSWORD",
"showInnkeeperAdminLogin": "FRONTEND_INNKEEPER_SHOW_ADMIN",
"showWritableComponents": "FRONTEND_TENANT_SHOW_WRITABLE_COMPONENTS",
"matomoUrl": "FRONTEND_MATOMO_URL",
"oidc": {
"active": "FRONTEND_INNKEEPER_OIDC_ACTIVE",
Expand Down
1 change: 1 addition & 0 deletions services/tenant-ui/config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"showInnkeeperReservationPassword": true,
"showInnkeeperAdminLogin": true,
"showOIDCReservationLogin": false,
"showWritableComponents": true,
"oidc": {
"active": false,
"authority": "https://dev.loginproxy.gov.bc.ca/auth/realms/digitaltrust-nrm",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ import StatusChip from '../common/StatusChip.vue';
import { TABLE_OPT, API_PATH } from '@/helpers/constants';
import { formatDateLong } from '@/helpers';

// State
import { useConfigStore } from '@/store/configStore';
const { config } = storeToRefs(useConfigStore());

const confirm = useConfirm();
const toast = useToast();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
:connection-id="props.connectionId"
:connection-name="props.connectionName"
/>
<div class="p-inputgroup flex-1 send-message">
<div
v-if="config.frontend.showWritableComponents"
class="p-inputgroup flex-1 send-message"
>
<InputText
v-model="message"
type="text"
Expand All @@ -36,6 +39,10 @@ import MessageContactList from './MessageContactList.vue';

// State
import { useMessageStore } from '@/store';
import { storeToRefs } from 'pinia';
import { useConfigStore } from '@/store/configStore';

const { config } = storeToRefs(useConfigStore());

const messageStore = useMessageStore();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<Column :sortable="false" header="Actions">
<template #body="{ data }">
<Button
v-if="config.frontend.showWritableComponents"
title="Delete Credential Definition"
icon="pi pi-trash"
class="p-button-rounded p-button-icon-only p-button-text"
Expand Down Expand Up @@ -129,6 +130,7 @@ import { useToast } from 'vue-toastification';
// State
import { useGovernanceStore } from '../../store';
import { storeToRefs } from 'pinia';
import { useConfigStore } from '@/store/configStore';
// Custom components
import RowExpandData from '../common/RowExpandData.vue';
import { TABLE_OPT, API_PATH } from '@/helpers/constants';
Expand All @@ -138,6 +140,8 @@ import MainCardContent from '../layout/mainCard/MainCardContent.vue';
const confirm = useConfirm();
const toast = useToast();

const { config } = storeToRefs(useConfigStore());

const governanceStore = useGovernanceStore();
const { loading, storedCredDefs } = storeToRefs(useGovernanceStore());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<template #header>
<div class="flex justify-content-between">
<div class="flex justify-content-start">
<OfferCredential />
<OfferCredential v-if="config.frontend.showWritableComponents" />
</div>
<div class="flex justify-content-end">
<span class="p-input-icon-left">
Expand Down Expand Up @@ -142,6 +142,7 @@ import { Ref, computed, onMounted, ref } from 'vue';
// State
import { useContactsStore, useIssuerStore } from '@/store';
import { storeToRefs } from 'pinia';
import { useConfigStore } from '@/store/configStore';
// PrimeVue/etc
import { FilterMatchMode } from 'primevue/api';
import Column from 'primevue/column';
Expand All @@ -159,6 +160,8 @@ import DeleteCredentialExchangeButton from './deleteCredential/DeleteCredentialE
import RevokeCredentialButton from './deleteCredential/RevokeCredentialButton.vue';
import OfferCredential from './offerCredential/OfferCredential.vue';

const { config } = storeToRefs(useConfigStore());

const toast = useToast();

const { listContacts, findConnectionName } = useContactsStore();
Expand Down
11 changes: 9 additions & 2 deletions services/tenant-ui/frontend/src/components/issuance/Schemas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
<template #header>
<div class="flex justify-content-between">
<div class="flex justify-content-start">
<CreateSchema />
<CopySchema class="ml-4" />
<CreateSchema v-if="config.frontend.showWritableComponents" />
<CopySchema
v-if="config.frontend.showWritableComponents"
class="ml-4"
/>
</div>
<div class="flex justify-content-end">
<span class="p-input-icon-left">
Expand Down Expand Up @@ -173,6 +176,10 @@ import RowExpandData from '../common/RowExpandData.vue';
import { TABLE_OPT, API_PATH } from '@/helpers/constants';
import { formatDateLong } from '@/helpers';

// State
import { useConfigStore } from '@/store/configStore';
const { config } = storeToRefs(useConfigStore());

const confirm = useConfirm();
const toast = useToast();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
<template #header>
<div class="flex justify-content-between">
<div class="flex justify-content-start">
<CreateMessage @success="loadTable" />
<CreateMessage
v-if="config.frontend.showWritableComponents"
@success="loadTable"
/>
</div>
<div class="flex justify-content-end">
<span class="p-input-icon-left">
Expand Down Expand Up @@ -133,6 +136,10 @@ import MainCardContent from '../layout/mainCard/MainCardContent.vue';
import CreateMessage from './createMessage/CreateMessage.vue';
import LoadingLabel from '../common/LoadingLabel.vue';

// State
import { useConfigStore } from '@/store/configStore';
const { config } = storeToRefs(useConfigStore());

const toast = useToast();

const messageStore = useMessageStore();
Expand Down
5 changes: 4 additions & 1 deletion services/tenant-ui/frontend/src/components/oca/Oca.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<template #header>
<div class="flex justify-content-between">
<div class="flex justify-content-start">
<CreateOca />
<CreateOca v-if="config.frontend.showWritableComponents" />
popkinj marked this conversation as resolved.
Show resolved Hide resolved
</div>
<div class="flex justify-content-end">
<span class="p-input-icon-left">
Expand All @@ -39,6 +39,7 @@
<Column :sortable="false" header="Actions">
<template #body="{ data }">
<Button
v-if="config.frontend.showWritableComponents"
title="Delete Credential Definition"
icon="pi pi-trash"
class="p-button-rounded p-button-icon-only p-button-text"
Expand Down Expand Up @@ -122,6 +123,8 @@ import { useToast } from 'vue-toastification';
// State
import { useGovernanceStore } from '../../store';
import { storeToRefs } from 'pinia';
import { useConfigStore } from '@/store/configStore';
const { config } = storeToRefs(useConfigStore());
// Custom components
import CreateOca from './createOca/CreateOca.vue';
import MainCardContent from '../layout/mainCard/MainCardContent.vue';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
>
<template #header>
<div class="flex justify-content-between">
<CreateRequest />
<CreateRequest v-if="config.frontend.showWritableComponents" />

<div class="flex justify-content-end">
<span class="p-input-icon-left">
Expand All @@ -42,9 +42,15 @@
<Column :sortable="false" :header="$t('common.actions')">
<template #body="{ data }">
<div class="flex">
<DeleteExchangeRecord :record-id="data.presentation_exchange_id" />
<DeleteExchangeRecord
v-if="config.frontend.showWritableComponents"
:record-id="data.presentation_exchange_id"
/>
<CreateRequest
v-if="data.role === 'verifier'"
v-if="
data.role === 'verifier' &&
config.frontend.showWritableComponents
"
:existing-pres-req="data.presentation_request"
icon-display
/>
Expand Down Expand Up @@ -104,6 +110,7 @@ import { useToast } from 'vue-toastification';
// State
import { useContactsStore, useVerifierStore } from '@/store';
import { storeToRefs } from 'pinia';
import { useConfigStore } from '@/store/configStore';
// Components
import MainCardContent from '@/components/layout/mainCard/MainCardContent.vue';
import CreateRequest from './createPresentationRequest/CreateRequest.vue';
Expand All @@ -124,6 +131,7 @@ const { contacts } = storeToRefs(useContactsStore());
const { loading, presentations, selectedPresentation } = storeToRefs(
useVerifierStore()
);
const { config } = storeToRefs(useConfigStore());

const loadTable = async () => {
verifierStore.listPresentations().catch((err) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ describe('Acapy', async () => {
const store = useConfigStore();
const wrapper = createWrapper();
wrapper.getComponent({ name: 'Accordion' }).trigger('click');
expect(store.getPluginList).toHaveBeenCalled();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ describe('IssuedCredentials', () => {
const wrapper = mountIssuedCredentials();

wrapper.getComponent({ name: 'DataTable' });
wrapper.getComponent({ name: 'OfferCredential' });
});

test('table body is rendered with expected values', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe('Messages', async () => {
test('mount has expected components', () => {
const wrapper = mountMessages();
wrapper.getComponent({ name: 'DataTable' });
wrapper.getComponent({ name: 'CreateMessage' });
});

test('table body is rendered with expected values', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ describe('Presentations', () => {
const wrapper = mountPresentations();

wrapper.getComponent({ name: 'DataTable' });
wrapper.getComponent({ name: 'CreateRequest' });
wrapper.getComponent({ name: 'DeleteExchangeRecord' });
});

test('table body is rendered with expected values', async () => {
Expand Down
Loading