Skip to content

Commit 744eb34

Browse files
authored
fix: Package.json script compat with npm, remove yarn cmd (#537)
Fix src/App LazyLoad typo Refactor dashboard apps change viewType
1 parent 2c1d2f1 commit 744eb34

File tree

5 files changed

+30
-20
lines changed

5 files changed

+30
-20
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"scripts": {
4848
"dev:client": "NODE_ENV=development webpack --config webpack.dev.js --progress",
4949
"dev:serve": "DEBUG_DEPTH=5 DEBUG=app BABEL_ENV=server NODE_ENV=development nodemon -w lib -w server server/server.js",
50-
"dev": "npm-run-all -p dev:serve 'dev:client --watch'",
50+
"dev": "npm-run-all -p dev:serve 'dev:client -- --watch'",
5151
"clean:dev": "rimraf build",
5252
"clean:prod": "rimraf dist",
5353
"prod:build": "npm run clean:prod && NODE_ENV=production webpack -p --config webpack.prod.js",
@@ -57,7 +57,7 @@
5757
"build:prod-server": "node build.js --prod-server",
5858
"lint-fix": "eslint . --fix",
5959
"test": "NODE_ENV=testing jest --config jest.config.json -u",
60-
"precommit": "yarn test && lint-staged",
60+
"precommit": "npm test && lint-staged",
6161
"viz": "webpack --config webpack.dev.js --profile --progress --json > reports/stats.json && webpack-bundle-analyzer reports/stats.json",
6262
"report-cov": "cat ./coverage/lcov.info | codecov",
6363
"dbg": "BABEL_ENV=server NODE_ENV=development node --inspect-brk server/server.js",

src/App.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class App extends React.Component {
8383
/>
8484
))}
8585
</Switch>
86-
</LazyLoad>>
86+
</LazyLoad>
8787
</div>
8888
</BrowserRouter>
8989
</Provider>

src/components/Deploy/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
.editorWrap {
7676
width: 90%;
7777
max-width: 95% !important;
78+
padding-right: 10px;
7879
}
7980

8081
.isYamlLabel {

src/components/Loading/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
.loadOuter{
1919
position: absolute;
2020
top: 40%;
21-
left: 40%;
21+
left: 50%;
2222
margin: -3em 0 0 -3em;
2323

2424
.loader {

src/pages/Dashboard/Apps/index.jsx

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Toolbar from 'components/Toolbar';
1111
import TdName, { ProviderName } from 'components/TdName';
1212
import Statistics from 'components/Statistics';
1313
import TimeShow from 'components/TimeShow';
14+
import Loading from 'components/Loading';
1415
import { getObjName, mappingStatus } from 'utils';
1516

1617
import styles from './index.scss';
@@ -55,8 +56,14 @@ export default class Apps extends Component {
5556

5657
changeView = type => {
5758
const { appStore } = this.props;
59+
5860
if (appStore.viewType !== type) {
61+
appStore.isLoading = true;
5962
appStore.viewType = type;
63+
// mimic loading
64+
setTimeout(() => {
65+
appStore.isLoading = false;
66+
}, 200);
6067
}
6168
};
6269

@@ -171,24 +178,26 @@ export default class Apps extends Component {
171178
}
172179

173180
renderCardApps() {
174-
const { apps } = this.props.appStore;
181+
const { apps, isLoading } = this.props.appStore;
175182

176183
return (
177-
<div className={styles.appCardContent}>
178-
{apps.map(app => (
179-
<Link key={app.app_id} to={`/dashboard/app/${app.app_id}`}>
180-
<div className={styles.appCard}>
181-
<span className={styles.icon}>
182-
<Image src={app.icon} iconSize={48} />
183-
</span>
184-
<p className={styles.name}>{app.name}</p>
185-
<p className={styles.description} title={app.description}>
186-
{app.description}
187-
</p>
188-
</div>
189-
</Link>
190-
))}
191-
</div>
184+
<Loading isLoading={isLoading}>
185+
<div className={styles.appCardContent}>
186+
{apps.map(app => (
187+
<Link key={app.app_id} to={`/dashboard/app/${app.app_id}`}>
188+
<div className={styles.appCard}>
189+
<span className={styles.icon}>
190+
<Image src={app.icon} iconSize={48} />
191+
</span>
192+
<p className={styles.name}>{app.name}</p>
193+
<p className={styles.description} title={app.description}>
194+
{app.description}
195+
</p>
196+
</div>
197+
</Link>
198+
))}
199+
</div>
200+
</Loading>
192201
);
193202
}
194203

0 commit comments

Comments
 (0)