Skip to content

Commit

Permalink
Merge branch 'main' into ch88576/smartkey-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
piercetrey-figure authored Jun 30, 2021
2 parents 6c62cec + 70f3078 commit 274eea4
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 238 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/release-build-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,12 @@ jobs:
- name: Build image
run: docker build . --file docker/Dockerfile --tag "p8e-ui:$VERSION"

- name: Log into registry
run: echo "${{ secrets.DOCKER_REGISTRY_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}

- name: Push image
run: |
Expand All @@ -103,3 +107,11 @@ jobs:
docker tag "p8e-ui:$VERSION" $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
PRERELEASE=${{ github.event.release.prerelease }}
echo PRERELEASE=$PRERELEASE
if [ "$PRERELEASE" == "false" ]; then
docker tag "p8e-ui:$VERSION" $IMAGE_ID:latest
docker push $IMAGE_ID:latest
fi
28 changes: 2 additions & 26 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,17 @@
import React, { useEffect } from 'react';
import React from 'react';
import { Switch, Route, Redirect } from 'react-router-dom';
import DashboardContainer from 'components/Dashboard/DashboardContainer';
import { ContractContainer, ContractListContainer } from 'components/Contract';
import { LoginContainer } from 'components/Login';
import { KeyManagerContainer, AddServiceKeyModal } from 'components/KeyManagement';
import { OAuthCallback } from 'components/OAuth';
import KeyDetailsContainer from 'components/KeyManagement/KeyDetailsContainer';
import { ScopeContainer, ScopeHistoryContainer, ScopeListContainer } from 'components/Scopes';
import { Settings } from 'Constant';
import { useDeepLink } from 'hooks';

const App = ({ isAuthenticated }) => {
const { performDeepLink } = useDeepLink();

useEffect(() => {
if (isAuthenticated) {
performDeepLink();
}
}, [isAuthenticated, performDeepLink]);

if (!isAuthenticated) {
return (
<>
<Switch>
<Route exact path="/oauth/callback" component={OAuthCallback} />
</Switch>
<LoginContainer />
</>
);
}

const App = () => {
return (
<>
<Switch>
<Route exact path="/" component={DashboardContainer} />
{/* <Route exact path="/login" component={LoginContainer} /> */}
{/* <Route exact path="/register" component={RegisterContainer} /> */}
<Route exact path="/contracts/:uuid" component={ContractContainer} />
<Route exact path="/contracts" component={ContractListContainer} />
<Route exact path="/scopes/:scopeUuid/history/:uuid" component={ScopeHistoryContainer} />
Expand Down
6 changes: 1 addition & 5 deletions src/AppContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import React from 'react';
import { useSelector } from 'react-redux';
import App from 'App';
import { ErrorCardContainer } from 'components/ErrorCards';

export const AppContainer = () => {
const { jwt } = useSelector(({ identityReducer }) => identityReducer);
const isAuthenticated = typeof jwt === 'string' && jwt.length > 0;

return (<>
<App isAuthenticated={isAuthenticated} />
<App />
<ErrorCardContainer />
</>);
}
1 change: 0 additions & 1 deletion src/Constant/identity.ts

This file was deleted.

25 changes: 0 additions & 25 deletions src/actions/identity-actions.ts

This file was deleted.

12 changes: 1 addition & 11 deletions src/components/Layout/Menu/MenuContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
import React from 'react';
import { useDispatch } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { logout } from 'actions/identity-actions';
import { Menu, MenuLink, MenuLinkText, MenuListItem } from './index';
import { Menu, MenuLink } from './index';
import { Location } from 'history';

type MenuContainerProps = {
location: Location;
}

const MenuContainer = ({ location }) => {
const dispatch = useDispatch();
const handleLogout = () => {
dispatch(logout());
};

return (
<Menu>
<ul>
<MenuLink pathname="/" location={location} text="Dashboard" />
<MenuLink pathname="/contracts" location={location} text="Contracts" />
<MenuLink pathname="/scopes" location={location} text="Scopes" />
<MenuLink pathname="/key-management" location={location} text="Key Management" />
<MenuListItem>
<MenuLinkText onClick={handleLogout}>Logout</MenuLinkText>
</MenuListItem>
</ul>
</Menu>
);
Expand Down
34 changes: 0 additions & 34 deletions src/components/Login/LoginContainer.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/Login/index.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/components/OAuth/OAuthCallback.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/OAuth/index.ts

This file was deleted.

22 changes: 0 additions & 22 deletions src/interceptors/401-interceptor.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/interceptors/index.ts

This file was deleted.

47 changes: 0 additions & 47 deletions src/interceptors/jwt-interceptor.ts

This file was deleted.

37 changes: 0 additions & 37 deletions src/reducers/identity-reducer.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import { default as contractReducer } from './contract-reducer';
import { default as scopeReducer } from './scope-reducer';
import { default as objectReducer } from './object-reducer';
import { default as keyReducer } from './key-reducer';
import { default as identityReducer } from './identity-reducer';
import { default as errorReducer } from './error-reducer';

export default {
contractReducer,
scopeReducer,
objectReducer,
keyReducer,
identityReducer,
errorReducer,
};
3 changes: 0 additions & 3 deletions src/store/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { applyMiddleware, createStore, combineReducers, compose } from 'redux';
import thunk from 'redux-thunk';
import rootReducer from 'reducers';
import { setup401Interceptor } from 'interceptors';

const middleware = [
thunk, // thunk middleware allows us to return promises from and receive dispatch reference in redux action creators.
Expand All @@ -23,6 +22,4 @@ const composedEnhancers = compose(applyMiddleware(...middleware), ...enhancers);

const store = createStore(combineReducers({ ...rootReducer }), preloadedState, composedEnhancers);

setup401Interceptor();

export default store;

0 comments on commit 274eea4

Please sign in to comment.