From e7627212a7a484c4d2830cb26096634d2a48c8ed Mon Sep 17 00:00:00 2001 From: Jason Syrotuck Date: Thu, 26 Oct 2023 08:37:37 -0700 Subject: [PATCH] [FIX] feature flag condition and typescript conversion (#2745) (#2746) * convert to TS and correct condition * commo folder sync --- ...entialReducer.js => verifiableCredentialReducer.ts} | 10 ++++++++-- ...entialReducer.js => verifiableCredentialReducer.ts} | 10 ++++++++-- .../components/dashboard/mine/permits/PermitsTable.js | 4 ++-- 3 files changed, 18 insertions(+), 6 deletions(-) rename services/core-web/common/reducers/{verifiableCredentialReducer.js => verifiableCredentialReducer.ts} (71%) rename services/minespace-web/common/reducers/{verifiableCredentialReducer.js => verifiableCredentialReducer.ts} (71%) diff --git a/services/core-web/common/reducers/verifiableCredentialReducer.js b/services/core-web/common/reducers/verifiableCredentialReducer.ts similarity index 71% rename from services/core-web/common/reducers/verifiableCredentialReducer.js rename to services/core-web/common/reducers/verifiableCredentialReducer.ts index 2569c421d1..4175c22d8a 100644 --- a/services/core-web/common/reducers/verifiableCredentialReducer.js +++ b/services/core-web/common/reducers/verifiableCredentialReducer.ts @@ -1,13 +1,19 @@ import * as actionTypes from "../constants/actionTypes"; import { VERIFIABLE_CREDENTIALS } from "../constants/reducerTypes"; +import { RootState } from "@/App"; +import { IVCInvitation, LOADING_STATUS } from "@mds/common"; /** * @file verifiableCredentialReducer.js * all data associated with verificable credential records. */ +interface verifiableCredentialState { + vcWalletConnectionInvitation: IVCInvitation; +} + const initialState = { - vcWalletConnectionInvitation: {}, + vcWalletConnectionInvitation: {} as IVCInvitation, }; const verifiableCredentialReducer = (state = initialState, action) => { @@ -26,7 +32,7 @@ const verifiableCredentialReducerObject = { [VERIFIABLE_CREDENTIALS]: verifiableCredentialReducer, }; -export const getVCWalletConnectionInvitation = (state) => +export const getVCWalletConnectionInvitation = (state: RootState) => state[VERIFIABLE_CREDENTIALS].vcWalletConnectionInvitation; export default verifiableCredentialReducerObject; diff --git a/services/minespace-web/common/reducers/verifiableCredentialReducer.js b/services/minespace-web/common/reducers/verifiableCredentialReducer.ts similarity index 71% rename from services/minespace-web/common/reducers/verifiableCredentialReducer.js rename to services/minespace-web/common/reducers/verifiableCredentialReducer.ts index 2569c421d1..4175c22d8a 100644 --- a/services/minespace-web/common/reducers/verifiableCredentialReducer.js +++ b/services/minespace-web/common/reducers/verifiableCredentialReducer.ts @@ -1,13 +1,19 @@ import * as actionTypes from "../constants/actionTypes"; import { VERIFIABLE_CREDENTIALS } from "../constants/reducerTypes"; +import { RootState } from "@/App"; +import { IVCInvitation, LOADING_STATUS } from "@mds/common"; /** * @file verifiableCredentialReducer.js * all data associated with verificable credential records. */ +interface verifiableCredentialState { + vcWalletConnectionInvitation: IVCInvitation; +} + const initialState = { - vcWalletConnectionInvitation: {}, + vcWalletConnectionInvitation: {} as IVCInvitation, }; const verifiableCredentialReducer = (state = initialState, action) => { @@ -26,7 +32,7 @@ const verifiableCredentialReducerObject = { [VERIFIABLE_CREDENTIALS]: verifiableCredentialReducer, }; -export const getVCWalletConnectionInvitation = (state) => +export const getVCWalletConnectionInvitation = (state: RootState) => state[VERIFIABLE_CREDENTIALS].vcWalletConnectionInvitation; export default verifiableCredentialReducerObject; diff --git a/services/minespace-web/src/components/dashboard/mine/permits/PermitsTable.js b/services/minespace-web/src/components/dashboard/mine/permits/PermitsTable.js index a84ce9dcc6..1fc0188453 100644 --- a/services/minespace-web/src/components/dashboard/mine/permits/PermitsTable.js +++ b/services/minespace-web/src/components/dashboard/mine/permits/PermitsTable.js @@ -55,8 +55,6 @@ export const PermitsTable = (props) => { dataIndex: "permitee_guid", render: (text, record) => { if (isFeatureEnabled(Feature.VERIFIABLE_CREDENTIALS)) { - return
; - } else { return (
{record.majorMineInd && record.status === "Open" && ( @@ -77,6 +75,8 @@ export const PermitsTable = (props) => { )}
); + } else { + return
; } }, },