From 8aef449134fd2ee2444045b9fdf13392f6dd5093 Mon Sep 17 00:00:00 2001 From: Khac Vy Date: Mon, 6 Jan 2020 10:42:16 +0700 Subject: [PATCH] [CLD-587] Update submit or update app flow following back-end update (#241) * [CLD-587] Update submit or update app flow following back-end update * Update show client secret * [CLD-587] Update foundations-ts-definitions --- package.json | 2 +- .../__tests__/__snapshots__/developer-submit-app.tsx.snap | 1 + src/components/pages/developer-submit-app.tsx | 5 +++++ src/components/ui/app-detail.tsx | 7 ++++--- src/constants/app-auth-flow.ts | 6 ++++++ yarn.lock | 8 ++++---- 6 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 src/constants/app-auth-flow.ts diff --git a/package.json b/package.json index 160361c653..24436696fa 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@babel/preset-env": "^7.7.7", "@cypress/webpack-preprocessor": "^4.1.1", "@reapit/config-manager": "^1.1.0", - "@reapit/foundations-ts-definitions": "latest", + "@reapit/foundations-ts-definitions": "^0.0.6", "@redux-saga/testing-utils": "^1.0.5", "@types/diff": "^4.0.2", "@types/enzyme": "~3.9.3", diff --git a/src/components/pages/__tests__/__snapshots__/developer-submit-app.tsx.snap b/src/components/pages/__tests__/__snapshots__/developer-submit-app.tsx.snap index f57d839c1c..617972a23c 100644 --- a/src/components/pages/__tests__/__snapshots__/developer-submit-app.tsx.snap +++ b/src/components/pages/__tests__/__snapshots__/developer-submit-app.tsx.snap @@ -69,6 +69,7 @@ exports[`DeveloperSubmitApp should match submit revision form snapshot 1`] = ` = ({ installedOn, scopes = [], isListed, - isDirectApi + isDirectApi, + authFlow } = data const icon = media.filter(({ type }) => type === 'icon')[0] const carouselImages = media.filter(({ type }) => type === 'image') @@ -121,8 +123,7 @@ export const AppDetail: React.FunctionComponent = ({ {isListed ? : } )} - {id && } - + {authFlow === AuthFlow.CLIENT_SECRET && id && } {carouselImages.length > 0 && (
diff --git a/src/constants/app-auth-flow.ts b/src/constants/app-auth-flow.ts new file mode 100644 index 0000000000..d71c511983 --- /dev/null +++ b/src/constants/app-auth-flow.ts @@ -0,0 +1,6 @@ +const authFlows = { + USER_SESSION: 'authorisationCode', + CLIENT_SECRET: 'clientCredentials' +} + +export default authFlows diff --git a/yarn.lock b/yarn.lock index f3dae36877..6944443558 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1013,10 +1013,10 @@ react-icons "^3.7.0" react-table "7.0.0-alpha.35" -"@reapit/foundations-ts-definitions@latest": - version "0.0.4" - resolved "https://registry.yarnpkg.com/@reapit/foundations-ts-definitions/-/foundations-ts-definitions-0.0.4.tgz#d469eda53eab4419b6a5e711afbfc0f4b976d22f" - integrity sha512-FNy1wt5s10I1jWaUdeVzsakM59okGEMKimG+iXjfLuCWIs1sG7Pj5vTvkoGgq9nm5vyfcEQgN9M7i4Tw7ABmCQ== +"@reapit/foundations-ts-definitions@^0.0.6": + version "0.0.6" + resolved "https://registry.yarnpkg.com/@reapit/foundations-ts-definitions/-/foundations-ts-definitions-0.0.6.tgz#a3302ddda84d1ce0e2b253cf44f4dc19cb3c4118" + integrity sha512-lQXijcow6kwAJeCqLzvnl7Fyj6ZtlM1OBKGosfIaU2Nc0i6NNGHjOT1VT8f3SF///ChcG7hHHhOSNYgvO06bOQ== "@redux-saga/core@^1.1.3": version "1.1.3"