From 118988768c57e88da5c26a311dc2516feddc46d2 Mon Sep 17 00:00:00 2001 From: Hristo Oskov Date: Wed, 19 Jun 2024 14:59:09 -0700 Subject: [PATCH 1/4] add button to copy auth0 token --- src/containers/app/AppContainer.js | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/containers/app/AppContainer.js b/src/containers/app/AppContainer.js index 61d004ae..f73aeede 100644 --- a/src/containers/app/AppContainer.js +++ b/src/containers/app/AppContainer.js @@ -4,12 +4,15 @@ import { useEffect } from 'react'; +import { faPenField } from '@fortawesome/pro-light-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import _isFunction from 'lodash/isFunction'; import { AppContainerWrapper, AppContentWrapper, AppHeaderWrapper, AppNavigationWrapper, + IconButton, Spinner, } from 'lattice-ui-kit'; import { useDispatch } from 'react-redux'; @@ -20,6 +23,7 @@ import { Switch, } from 'react-router-dom'; import { RequestStates } from 'redux-reqseq'; +import styled from 'styled-components'; import type { RequestState } from 'redux-reqseq'; import { INITIALIZE_APPLICATION, initializeApplication } from './actions'; @@ -31,13 +35,24 @@ import StudyRouter from '../study/StudyRouter'; import * as Routes from '../../core/router/Routes'; import { OpenLatticeIconSVG } from '../../assets/svg/icons'; import { BasicErrorComponent, ContactSupportButton } from '../../common/components'; -import { isNonEmptyString, useRequestState } from '../../common/utils'; +import { copyToClipboard, isNonEmptyString, useRequestState } from '../../common/utils'; import { logout } from '../../core/auth/actions'; -import { getUserInfo, isAdmin } from '../../core/auth/utils'; +import { getAuthToken, getUserInfo, isAdmin } from '../../core/auth/utils'; import { GOOGLE_MEASUREMENT_ID } from '../../core/tracking/google/GoogleAnalytics'; declare var gtag :?Function; +const CopyTokenWrapper = styled.div` + align-items: center; + display: flex; + justify-content: center; + margin: 0px 0px 0px 30px; + + svg { + margin-top: -4px; + } +`; + const AppContainer = () => { const dispatch = useDispatch(); @@ -105,6 +120,11 @@ const AppContainer = () => { Studies { isAdmin() && Dashboard} + + copyToClipboard(getAuthToken())}> + + + From 7482dcec3c0a93fb5f30120ca955ddc04e6fdc27 Mon Sep 17 00:00:00 2001 From: Hristo Oskov Date: Wed, 19 Jun 2024 15:02:03 -0700 Subject: [PATCH 2/4] add title --- src/containers/app/AppContainer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/app/AppContainer.js b/src/containers/app/AppContainer.js index f73aeede..17281b93 100644 --- a/src/containers/app/AppContainer.js +++ b/src/containers/app/AppContainer.js @@ -121,7 +121,7 @@ const AppContainer = () => { Studies { isAdmin() && Dashboard} - copyToClipboard(getAuthToken())}> + copyToClipboard(getAuthToken())} title="copy auth0 token"> From 0aa55e9afd362fd8681677d4c1e5c1dab62b6d9f Mon Sep 17 00:00:00 2001 From: Hristo Oskov Date: Wed, 19 Jun 2024 15:02:43 -0700 Subject: [PATCH 3/4] happy linter --- src/containers/app/AppContainer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/app/AppContainer.js b/src/containers/app/AppContainer.js index 17281b93..f565d016 100644 --- a/src/containers/app/AppContainer.js +++ b/src/containers/app/AppContainer.js @@ -46,7 +46,7 @@ const CopyTokenWrapper = styled.div` align-items: center; display: flex; justify-content: center; - margin: 0px 0px 0px 30px; + margin: 0 0 0 30px; svg { margin-top: -4px; From e6ec519bdc0b93c0709a05f66ad752b5b83becf9 Mon Sep 17 00:00:00 2001 From: Hristo Oskov Date: Wed, 19 Jun 2024 15:05:52 -0700 Subject: [PATCH 4/4] switch to terminal icon --- src/containers/app/AppContainer.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/containers/app/AppContainer.js b/src/containers/app/AppContainer.js index f565d016..783ba00b 100644 --- a/src/containers/app/AppContainer.js +++ b/src/containers/app/AppContainer.js @@ -4,7 +4,7 @@ import { useEffect } from 'react'; -import { faPenField } from '@fortawesome/pro-light-svg-icons'; +import { faRectangleTerminal } from '@fortawesome/pro-light-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import _isFunction from 'lodash/isFunction'; import { @@ -47,10 +47,6 @@ const CopyTokenWrapper = styled.div` display: flex; justify-content: center; margin: 0 0 0 30px; - - svg { - margin-top: -4px; - } `; const AppContainer = () => { @@ -122,7 +118,7 @@ const AppContainer = () => { { isAdmin() && Dashboard} copyToClipboard(getAuthToken())} title="copy auth0 token"> - +