Skip to content

Commit

Permalink
Merge branch 'develop' into PIM-24
Browse files Browse the repository at this point in the history
  • Loading branch information
lklong709 authored Jan 12, 2023
2 parents 5cae585 + 6e6165a commit 19241e4
Show file tree
Hide file tree
Showing 79 changed files with 2,002 additions and 1,099 deletions.
4 changes: 4 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
REACT_APP_CLIENT_ID=app
REACT_APP_CLIENT_SECRET=[REPLACE THIS WITH THE PROVIDED REACT_APP_CLIENT_SECRET from https://pim.aesirx.io]
REACT_APP_ENDPOINT_URL=http://example.com/
REACT_APP_ENDPOINT_ANALYTICS_URL=http://example.com/
REACT_APP_SSO_CLIENT_ID=[REPLACE THIS WITH THE PROVIDED REACT_APP_SSO_CLIENT_ID from https://pim.aesirx.io]
REACT_APP_SSO_CLIENT_SECRET=[REPLACE THIS WITH THE PROVIDED REACT_APP_SSO_CLIENT_SECRET from https://pim.aesirx.io]
REACT_APP_ENCRYPT=encrypt
REACT_APP_LICENSE=[REPLACE THIS WITH THE PROVIDED REACT_APP_LICENSE from https://pim.aesirx.io]
REACT_APP_DAM_LICENSE=[REPLACE THIS WITH THE PROVIDED REACT_APP_LICENSE from https://pim.aesirx.io]
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: demo
on:
push:
branches:
- master

jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: demo
env:
CI: false
REACT_APP_CLIENT_ID: ${{ secrets.REACT_APP_CLIENT_ID }}
REACT_APP_CLIENT_SECRET: ${{ secrets.REACT_APP_CLIENT_SECRET }}
REACT_APP_ENDPOINT_URL: ${{ secrets.REACT_APP_ENDPOINT_URL }}
REACT_APP_ENCRYPT: ${{ secrets.REACT_APP_ENCRYPT }}
REACT_APP_LICENSE: ${{ secrets.REACT_APP_LICENSE }}
REACT_APP_DAM_LICENSE: ${{ secrets.REACT_APP_DAM_LICENSE }}
REACT_APP_TEST_MODE: ${{ secrets.REACT_APP_TEST_MODE }}
REACT_APP_DEMO_USER: ${{ secrets.REACT_APP_DEMO_USER }}
REACT_APP_DEMO_PASSWORD: ${{ secrets.REACT_APP_DEMO_PASSWORD }}
REACT_APP_SSO_CLIENT_ID: ${{ secrets.REACT_APP_SSO_CLIENT_ID }}
REACT_APP_SSO_CLIENT_SECRET: ${{ secrets.REACT_APP_SSO_CLIENT_SECRET }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14

- run: yarn install
- run: yarn build

- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: unnecessary

- name: Adding Known Hosts
run: ssh-keyscan -p ${{ secrets.SSH_PORT}} -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts

- name: Deploy with rsync
run: rsync -avz -e "ssh -p ${{ secrets.SSH_PORT }}" ./build/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.SSH_PATH }}
41 changes: 41 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: develop
on:
push:
branches:
- develop

jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: develop
env:
CI: false
REACT_APP_CLIENT_ID: ${{ secrets.REACT_APP_CLIENT_ID }}
REACT_APP_CLIENT_SECRET: ${{ secrets.REACT_APP_CLIENT_SECRET }}
REACT_APP_ENDPOINT_URL: ${{ secrets.REACT_APP_ENDPOINT_URL }}
REACT_APP_ENCRYPT: ${{ secrets.REACT_APP_ENCRYPT }}
REACT_APP_LICENSE: ${{ secrets.REACT_APP_LICENSE }}
REACT_APP_DAM_LICENSE: ${{ secrets.REACT_APP_DAM_LICENSE }}
REACT_APP_TEST_MODE: ${{ secrets.REACT_APP_TEST_MODE }}
REACT_APP_SSO_CLIENT_ID: ${{ secrets.REACT_APP_SSO_CLIENT_ID }}
REACT_APP_SSO_CLIENT_SECRET: ${{ secrets.REACT_APP_SSO_CLIENT_SECRET }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14

- run: yarn install
- run: yarn build

- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: unnecessary

- name: Adding Known Hosts
run: ssh-keyscan -p ${{ secrets.SSH_PORT}} -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts

- name: Deploy with rsync
run: rsync -avz -e "ssh -p ${{ secrets.SSH_PORT }}" ./build/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.SSH_PATH }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@fortawesome/react-fontawesome": "^0.1.12",
"aesirx-dam-app": "^1.1.0",
"aesirx-dma-lib": "^1.7.3",
"aesirx-sso": "^1.0.1",
"aesirx-sso": "^1.0.3",
"axios": "^0.21.0",
"bootstrap": "5.2.2",
"d3-fetch": "^3.0.1",
Expand Down
3 changes: 3 additions & 0 deletions public/assets/images/delete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/assets/images/logo/logo-white-mini.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 8 additions & 12 deletions public/assets/images/logo/logo-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/warn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 1 addition & 21 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,11 @@ import { SSOContextProvider } from 'aesirx-sso';
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
theme: this.getCurrentTheme(),
};
this.changeTheme = this.changeTheme.bind(this);
}
getCurrentTheme() {
let currentTheme = localStorage.getItem('theme');
if (!currentTheme) {
localStorage.setItem('theme', 'light');
return currentTheme ?? 'light';
}
return currentTheme;
}
changeTheme(newTheme) {
this.setState({ theme: newTheme });
localStorage.setItem('theme', newTheme);
document.documentElement.setAttribute('data-theme', newTheme);
}

componentDidMount() {
document.documentElement.setAttribute('data-theme', this.state.theme);
}
render() {
return (
<ThemesContextProvider value={{ theme: this.state.theme, changeTheme: this.changeTheme }}>
<ThemesContextProvider>
<ErrorBoundary>
<I18nextProvider i18n={i18n}>
<SSOContextProvider>
Expand Down
53 changes: 53 additions & 0 deletions src/SVG/ThemeMode.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React from 'react';

const ThemeMode = ({ fill = 'none', onClick }) => {
return (
<svg
onClick={onClick}
width="25"
height="24"
viewBox="0 0 25 24"
fill={fill}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 3.66562C12.3883 3.66562 12.7031 3.35081 12.7031 2.9625V0.703125C12.7031 0.314812 12.3883 0 12 0C11.6117 0 11.2969 0.314812 11.2969 0.703125V2.9625C11.2969 3.35081 11.6117 3.66562 12 3.66562Z"
fill={fill}
/>
<path
d="M5.11213 6.10654C5.38673 6.38113 5.8319 6.38113 6.10649 6.10654C6.38109 5.83195 6.38109 5.38677 6.10649 5.11218L4.5089 3.51454C4.2343 3.23995 3.78913 3.23995 3.51454 3.51454C3.23995 3.78913 3.23995 4.2343 3.51454 4.5089L5.11213 6.10654Z"
fill={fill}
/>
<path
d="M5.11213 17.8935L3.51454 19.4911C3.23995 19.7657 3.23995 20.2108 3.51454 20.4854C3.78913 20.76 4.2343 20.76 4.5089 20.4854L6.10654 18.8878C6.38113 18.6132 6.38113 18.168 6.10654 17.8934C5.83195 17.6188 5.38673 17.6189 5.11213 17.8935Z"
fill={fill}
/>
<path
d="M12 20.3345C11.6117 20.3345 11.2969 20.6493 11.2969 21.0376V23.297C11.2969 23.6853 11.6117 24.0001 12 24.0001C12.3883 24.0001 12.7031 23.6853 12.7031 23.297V21.0376C12.7031 20.6493 12.3883 20.3345 12 20.3345Z"
fill={fill}
/>
<path
d="M3.66562 12C3.66562 11.6117 3.35081 11.2969 2.9625 11.2969H0.703125C0.314812 11.2969 0 11.6117 0 12C0 12.3883 0.314812 12.7031 0.703125 12.7031H2.9625C3.35081 12.7031 3.66562 12.3883 3.66562 12Z"
fill={fill}
/>
<path
d="M11.9985 6.0249C8.70384 6.0249 6.02344 8.70531 6.02344 11.9999C6.02344 15.2945 8.70384 17.9749 11.9985 17.9749C15.2931 17.9749 17.9735 15.2945 17.9735 11.9999C17.9735 8.70531 15.2931 6.0249 11.9985 6.0249Z"
fill={fill}
/>
<path
d="M18.8878 6.10654L20.4854 4.5089C20.76 4.2343 20.76 3.78913 20.4854 3.51454C20.2109 3.23995 19.7657 3.23995 19.4911 3.51454L17.8934 5.11218C17.6189 5.38677 17.6189 5.83195 17.8934 6.10654C18.168 6.38113 18.6132 6.38113 18.8878 6.10654Z"
fill={fill}
/>
<path
d="M18.8878 17.8934C18.6132 17.6189 18.168 17.6189 17.8934 17.8934C17.6189 18.168 17.6189 18.6132 17.8934 18.8878L19.4911 20.4854C19.7657 20.76 20.2109 20.76 20.4854 20.4854C20.76 20.2109 20.76 19.7657 20.4854 19.4911L18.8878 17.8934Z"
fill={fill}
/>
<path
d="M23.2984 11.2969H21.0391C20.6507 11.2969 20.3359 11.6117 20.3359 12C20.3359 12.3883 20.6507 12.7031 21.0391 12.7031H23.2984C23.6868 12.7031 24.0016 12.3883 24.0016 12C24.0016 11.6117 23.6868 11.2969 23.2984 11.2969Z"
fill={fill}
/>
</svg>
);
};

export default ThemeMode;
8 changes: 4 additions & 4 deletions src/auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@

import history from '../routes/history';
import { notify } from '../components/Toast';
import { AXIOS_CONFIGS, GENERAL_CONFIG } from 'aesirx-dma-lib';
import { AXIOS_CONFIGS } from 'aesirx-dma-lib';
import { Storage, AesirxAuthenticationApiService } from 'aesirx-dma-lib';

if (
AXIOS_CONFIGS.CLIENT_ID === '' ||
AXIOS_CONFIGS.CLIENT_SECRET === '' ||
AXIOS_CONFIGS.BASE_ENDPOINT_URL === '' ||
AXIOS_CONFIGS.LICENSE === '' ||
GENERAL_CONFIG.WEBSOCKET_ENDPOINT === ''
AXIOS_CONFIGS.LICENSE === ''
// GENERAL_CONFIG.WEBSOCKET_ENDPOINT === ''
) {
notify(
'The app has not been fully configured and you will not be able to login. Go to https://dma.aesirx.io/install-guide/npm for instructions on how to configure your .env file',
'The app has not been fully configured and you will not be able to login. Go to https://pim.aesirx.io/install-guide/npm for instructions on how to configure your .env file',
'error'
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/ActionsBar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ const ActionsBar = ({ t, buttons = [] }) => {
>
{item.icon && (
<ComponentSVG
color={item.iconColor}
url={item.icon}
className={`icon-${item.variant ? item.variant : 'light'} me-1`}
/>
)}
{item.title}
<span style={{ color: item.textColor }}>{item.title}</span>
</Button>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/ComponentSVG/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function ComponentSVG({ url, width, height, color, className }) {
width: width ?? '24px',
height: height ?? '24px',
...(color && {
backgroundColor: color ? `${color}` : 'var(--body-color)',
backgroundColor: color ? `${color}` : 'var(--bs-body-color)',
}),
}}
></span>
Expand Down
2 changes: 0 additions & 2 deletions src/components/Fields/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ const FieldsList = observer(
}
};
render() {
console.log('rerender Fields', this.props.viewModel.fieldListViewModel.items);

const generateFormSetting = [
{
fields: [
Expand Down
Loading

0 comments on commit 19241e4

Please sign in to comment.