Skip to content

Commit 3a98919

Browse files
authored
Merge pull request #27 from LANL-Bioinformatics/24-disable-workflows
24 disable workflows
2 parents c9d40dd + c69c046 commit 3a98919

File tree

17 files changed

+127
-99
lines changed

17 files changed

+127
-99
lines changed

installation/README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,24 @@ https://docs.mongodb.com/manual/installation/#mongodb-community-edition-installa
2626

2727
- Populate the "client build" environment configuration file (i.e. `webapp/client/.env`).
2828

29-
You can initialize it based upon the corresponding development/production example file:
29+
You can initialize it based upon the corresponding example file:
3030
```shell
31-
cp webapp/client/.env.development.example \
31+
cp webapp/client/.env.example \
3232
webapp/client/.env
3333
```
3434
> Those environment variables are used within `webapp/client/src/config.js`.
35+
36+
- Create a build directory with a production build of the client:
37+
```shell
38+
cd webapp/client
39+
npm run build
40+
```
41+
3542
- Populate the server environment configuration file (i.e. `webapp/server/.env`).
3643

37-
You can initialize it based upon the corresponding development/production example file:
44+
You can initialize it based upon the corresponding example file:
3845
```shell
39-
cp webapp/server/.env.development.example \
46+
cp webapp/server/.env.example \
4047
webapp/server/.env
4148
```
4249
> Those environment variables are used within `webapp/server/config.js`.

installation/install.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,19 @@ do
5151
done
5252

5353
echo "Setup LANL EDGE webapp ..."
54-
#build client
55-
echo "build client..."
54+
#install client
55+
echo "install client..."
5656
cd $app_home/webapp/client
5757
npm install --legacy-peer-deps
58-
npm run build
59-
#build server
60-
echo "build server..."
58+
#install server
59+
echo "install server..."
6160
cd $app_home/webapp/server
6261
npm install
6362

6463
echo "LANL EDGE webapp successfully installed!"
65-
echo "To start the webapp in EDGEv3's root directory:"
66-
echo "pm2 start pm2.config.js"
64+
echo "Next steps:"
65+
echo "1. copy webapp/client/.env.example to webapp/client/.env and update settings in the .env file"
66+
echo "2. inside webapp/client, run command: npm run build"
67+
echo "3. copy webapp/server/.env.example to webapp/server/.env and update settings in the .env file"
68+
echo "4. start MongoDB if it's not started yet"
69+
echo "5. start the webapp in EDGEv3's root directory: pm2 start pm2.config.js"

webapp/README.md

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,28 @@
88
## Install the webapp
99

1010
cd installation
11-
./install-local.sh
11+
./install.sh
12+
13+
## Configure and start ui client
14+
15+
cd webapp/client
16+
cp .env.example .env
17+
(update settings in .env)
18+
npm start
1219

13-
## Start api server
20+
## Configure and start api server
1421

1522
cd webapp/server
16-
(change NODE_ENV=prod to NODE_ENV=dev in .env)
23+
cp .env.example .env
24+
(update settings in .env)
1725
npm start
1826

19-
## Start ui client
20-
21-
cd webapp/client
22-
npm start
2327

2428
## View the website
2529

2630
http://localhost:3000
2731

2832
## Note
2933

30-
- Have to restart the client when any changes made in client/.env.
31-
- Have to restart the server when any changes made in server code or server/.env.
32-
33-
#### Restart api server
34-
35-
cd webapp/server
36-
use Ctrl-C to stop the webapp server
37-
npm start
38-
39-
#### Restart ui client
40-
41-
cd webapp/client
42-
use Ctrl-C to stop the webapp client
43-
npm start
44-
34+
- Have to restart the api server when any changes made in webapp/server code or webapp/server/.env.
4535

webapp/client/.env.development.example

Lines changed: 0 additions & 8 deletions
This file was deleted.

webapp/client/.env.example

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
###############################################################################
2+
# Refer to `./src/config.js` to see all supported environment variables. #
3+
###############################################################################
4+
VITE_NAME=EDGE V3
5+
VITE_EMAIL_NOTIFICATION_ENABLED=false
6+
VITE_FILEUPLOAD_ENABLED=true
7+
8+
# for development only
9+
# VITE_API_URL=http://localhost:5000
10+
11+
# ORCiD login
12+
VITE_IS_ORCID_AUTH_ENABLED=false
13+
VITE_ORCID_CLIENT_ID=="__POPULATE_ME_IF_ENABLING_ORCID_AUTH__"

webapp/client/.env.production.example

Lines changed: 0 additions & 7 deletions
This file was deleted.

webapp/client/src/edge/common/Dialogs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { colors } from './util'
1212
export const ConfirmDialog = (props) => {
1313
return (
1414
<Modal isOpen={props.isOpen} centered>
15-
<ModalHeader>{props.title}</ModalHeader>
15+
<ModalHeader>{props.header}</ModalHeader>
1616
<ModalBody>{props.message}</ModalBody>
1717
<ModalFooter>
1818
<Button color="primary" onClick={props.handleClickYes}>

webapp/client/src/edge/common/util.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,16 @@ export const notify = (type, msg, timeout) => {
167167
toast.success(msg, {
168168
position: 'top-center',
169169
autoClose: timeout,
170+
rtl: false,
171+
hideProgressBar: false,
170172
})
171173
}
172174
if (type === 'error') {
173175
toast.error(msg, {
174176
position: 'top-center',
175177
autoClose: false,
178+
rtl: false,
179+
hideProgressBar: false,
176180
})
177181
}
178182
}

webapp/client/src/edge/um/user/JobQueue.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ const JobQueue = () => {
1515
accessorKey: 'name', //access nested data with dot notation
1616
header: 'project',
1717
},
18-
{
19-
accessorKey: 'owner',
20-
header: 'Owner',
21-
},
2218
{
2319
accessorKey: 'type', //normal accessorKey
2420
header: 'Type',
@@ -79,8 +75,8 @@ const JobQueue = () => {
7975
data={tableData}
8076
enableFullScreenToggle={false}
8177
enableColumnActions={false}
82-
enableSorting={false}
83-
enableColumnFilters={false}
78+
enableSorting={true}
79+
enableColumnFilters={true}
8480
state={{
8581
isLoading: loading,
8682
}}

webapp/client/src/edge/um/user/UploadFiles.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ const UploadFiles = (props) => {
2828
const [allowedExtensions, setAllowedExtensions] = useState([])
2929
const [files, setFiles] = useState([])
3030
const [updateSize, setUpdateSize] = useState(0)
31+
const [files2upload, setFiles2Upload] = useState(0)
32+
const [filesUploaded, setFilesUploaded] = useState(0)
33+
let uploaded = 0
3134

3235
useEffect(() => {
3336
//get upload info
@@ -124,6 +127,8 @@ const UploadFiles = (props) => {
124127
}
125128

126129
//upload files
130+
setFiles2Upload(files.length)
131+
127132
let promises = []
128133
for (var i = 0; i < files.length; i++) {
129134
let curr = files[i]
@@ -143,9 +148,13 @@ const UploadFiles = (props) => {
143148
},
144149
})
145150
.then((response) => {
151+
uploaded += 1
152+
setFilesUploaded(uploaded)
146153
resolve('Upload ' + curr.meta.name + ' successfully!')
147154
})
148155
.catch((error) => {
156+
uploaded += 1
157+
setFilesUploaded(uploaded)
149158
resolve('Upload ' + curr.meta.name + ' failed! ' + error)
150159
})
151160
}),
@@ -155,13 +164,19 @@ const UploadFiles = (props) => {
155164
Promise.all(promises)
156165
.then((response) => {
157166
allFiles.forEach((f) => f.remove())
167+
let errors = 0
158168
response.forEach((e) => {
159169
if (e.includes('failed')) {
160170
notify('error', e)
171+
errors += 1
161172
} else {
162-
notify('success', e)
173+
//notify('success', e)
163174
}
164175
})
176+
if (errors === 0) {
177+
notify('success', 'Files uploaded successfully!', 2000)
178+
//setTimeout(() => props.history.push("/user/files"), 2000);
179+
}
165180
setSubmitting(false)
166181
props.reloadTableData()
167182
})
@@ -173,7 +188,10 @@ const UploadFiles = (props) => {
173188

174189
return (
175190
<>
176-
<LoaderDialog loading={submitting} text="Uploading..." />
191+
<LoaderDialog
192+
loading={submitting}
193+
text={'Uploading...' + Math.round((filesUploaded / files2upload) * 100) + '%'}
194+
/>
177195
<ToastContainer />
178196
<div className="clearfix">
179197
<h4 className="pt-3">Upload Files</h4>

0 commit comments

Comments
 (0)