Skip to content

Commit b850f5a

Browse files
authored
Merge pull request #7 from bbsaclay/master
v0.6.0
2 parents d88ff99 + 5664755 commit b850f5a

25 files changed

+236
-708
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/
22
build/
33
package-lock.json
4+
*-bundle.js

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ COPY server server
1515
COPY .logo-ascii .logo-ascii
1616

1717
# Build frontend and install backend dependencies
18-
RUN npm deps && npm run build && rm -rf frontend
18+
RUN npm run deps && npm run build && rm -rf frontend
1919

2020
EXPOSE 3000
2121

Dockerfile-local

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
FROM ubuntu:20.04
22

33
# Install Node.js
4-
RUN apt-get update && apt-get install -y --reinstall ca-certificates curl build-essential
5-
RUN curl --silent --location https://deb.nodesource.com/setup_12.x | bash -
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
RUN apt-get update
66
RUN apt-get install -y nodejs
7-
RUN npm install -g [email protected]
7+
RUN node --version
88

9-
# Copy bundled frontend
9+
# Copy bundled frontend and backend dependencies
1010
COPY build build
11+
COPY node_modules node_modules
1112

1213
# Copy files for the backend
1314
COPY package.json package.json
1415
COPY server server
1516
COPY .logo-ascii .logo-ascii
1617

17-
# Install backend dependencies
18-
RUN npm install
1918
EXPOSE 3000
2019

2120
# default files and folders (usefull when no volume can be mounted with this image)
2221
RUN mkdir -p /data
23-
22+
COPY data-test /data/data-test
2423

2524
# ENTRYPOINT ["node", "server/server.js"]
2625
RUN echo 'cat .logo-ascii && node server/server.js "$@"' > entrypoint.sh

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pixano ./data-test --port 3001
6363

6464
#### Install global dependencies
6565

66-
- NodeJS (>=12)
66+
- NodeJS (10, 12 or 14)
6767
To install on ubuntu:
6868

6969
```bash
@@ -78,6 +78,8 @@ nodejs --version
7878
npm install -g [email protected]
7979
```
8080
You can read this nice [introduction](https://codeburst.io/the-only-nodejs-introduction-youll-ever-need-d969a47ef219) to NodeJS in case you're curious on how it works.
81+
82+
> ATTENTION: node version 16 is not compatible for now
8183
8284
#### Install application dependencies
8385

@@ -90,10 +92,16 @@ If you want to use custom `pixano-element` modules from local path instead of th
9092

9193
```bash
9294
# Install application dependencies and local pixano-elements
93-
npm run installLocalElements --path=../../pixano-elements
95+
npm run installLocalElements --path=$PIXANO_ELEMENTS_PATH
9496
```
9597
*NB: Make sure you have the git repository of pixano-elements next to the pixano-app folder and that you have followed the pixano-elements build instructions before running the above commands.*
9698

99+
If this command breaks your local pixano-elements demo, this command will repear it:
100+
```bash
101+
cd $PIXANO_ELEMENTS_PATH
102+
npm run bootstrap
103+
```
104+
97105
#### Build the application
98106

99107
```bash
@@ -187,10 +195,13 @@ The `task1.json` file contains global task settings (task type, task categories,
187195

188196
### Build docker from sources
189197

190-
To create a docker image of the application, build the application (step 1.b) and then run:
198+
To create a docker image of the application, you can use the standard docker command:
191199
```bash
192200
# You can change `pixano` by your choosen image name
193201
sudo docker build -t pixano/pixano-app:my-tag .
202+
```
203+
If you used a local pixano-element, build the application (step 1.b) and then run:
204+
```bash
194205
# You can use the local Dockerfile if the build folder already exists
195206
sudo docker build -t pixano/pixano-app:my-tag -f Dockerfile-local .
196207
```

documentation/rest-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ This document lists the API of the Pixano server that enable the creation of new
5757
type Objective = 'to_annotate' | 'to_validate' | 'to_correct';
5858

5959
// possible status a data item can have
60-
type LabellingStatus = Objective | 'done';
60+
type LabellingStatus = Objective | 'done' | 'discard';
6161

6262
// possible types a data item can have
6363
type DataType = 'image' | 'pcl' | 'pcl_image' | 'sequence_pcl' | 'sequence_image' | 'sequence_pcl_image';

frontend/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pixano-app-frontend",
3-
"version": "0.5.0",
3+
"version": "0.6.0",
44
"description": "This is a Pixano app.",
55
"scripts": {
66
"copyindex": "shx cp src/index.html ../build",
@@ -49,10 +49,10 @@
4949
"@material/mwc-tab-bar": "0.19.1",
5050
"@material/mwc-textarea": "0.19.1",
5151
"@material/mwc-textfield": "0.19.1",
52-
"@pixano/ai": "0.6.1",
53-
"@pixano/core": "0.6.1",
54-
"@pixano/graphics-2d": "0.6.1",
55-
"@pixano/graphics-3d": "0.6.1",
52+
"@pixano/ai": "0.7.0",
53+
"@pixano/core": "0.7.0",
54+
"@pixano/graphics-2d": "0.7.0",
55+
"@pixano/graphics-3d": "0.7.0",
5656
"@trystan2k/fleshy-jsoneditor": "3.0.0",
5757
"@webcomponents/webcomponentsjs": "^2.4.0",
5858
"babel-loader": "^8.2.3",

frontend/src/actions/requests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const _requestHelper = (method, url = "/api/v1/", body = undefined, dispatch = n
2929
dispatch(updateWaiting(true));
3030
}
3131
return new Promise((resolve, reject) => {
32-
return fetch(url, messageContent).then((response) => {
32+
return fetch(encodeURI(url), messageContent).then((response) => {
3333
if (dispatch) {
3434
dispatch(updateWaiting(false));
3535
}

frontend/src/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ class MyApp extends connect(store)(LitElement) {
6868
goHome() {
6969
const user = getState('user');
7070
const page = user.currentUser.role === 'admin' ? '/#dashboard-admin': '/#dashboard-user';
71-
window.history.pushState({}, '', page);
71+
window.history.pushState({}, '', encodeURI(page));
7272
store.dispatch(navigate(page));
7373
}
7474

7575
goLogin() {
7676
const page = '/#login';
77-
window.history.pushState({}, '', page);
77+
window.history.pushState({}, '', encodeURI(page));
7878
store.dispatch(navigate(page));
7979
}
8080

0 commit comments

Comments
 (0)