Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tmp folder to store temp uploaded logos in project admin form #2092

Draft
wants to merge 43 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
42a13b6
feat: setup dockerized vue widget dev server
luistoptal Oct 6, 2024
9d32a07
chore: Merge branch 'develop' into new-feature/376-upload-update-proj…
luistoptal Oct 23, 2024
a257ae4
feat: mock image upload
luistoptal Oct 23, 2024
d10ab93
uppy widget is displayed in the ui
luistoptal Oct 25, 2024
f5f8ee9
display spinner while scripts load
luistoptal Oct 25, 2024
19c9c7e
renames controller and model variables to be more specific
luistoptal Oct 25, 2024
69e4e3f
feat: a11y uppy image loader
luistoptal Oct 25, 2024
5d2e114
feat: native inplementation
luistoptal Oct 25, 2024
f87f9b7
feat: custom image editor
luistoptal Oct 29, 2024
51ab59c
refactor: cleanup current implementation
luistoptal Oct 29, 2024
d19ad67
chore: comment feature and display upload button
luistoptal Oct 29, 2024
5e3f38f
feat: able to upload file and send data back to the client
luistoptal Oct 29, 2024
c04e70e
chore: restores actioncreate method to original functionality
luistoptal Oct 29, 2024
1edd8c0
feat: use write logo in project controller
luistoptal Oct 30, 2024
0103442
feat: setup logo cleanup on project delete and on logo upload
luistoptal Oct 30, 2024
b251bd9
feat: splits vue widget into components
luistoptal Oct 30, 2024
8a338dd
chore: cleanup logs and accept hidden input name
luistoptal Oct 30, 2024
f10940d
feat: tweak image editor flow and improve a11y
luistoptal Oct 30, 2024
f3a2930
feat: save logo in temp storage
luistoptal Oct 31, 2024
1376054
feat: project CRUD wroks with logo
luistoptal Nov 3, 2024
8af0f39
chore: delete logs
luistoptal Nov 3, 2024
47a83ab
feat: setup vue widget dev and prod
luistoptal Nov 3, 2024
7fbdf74
refactor: adds global error handling
luistoptal Nov 3, 2024
05a841d
feat: adds vue component unit testing
luistoptal Nov 4, 2024
fa90440
feat: validate image height before uploading
luistoptal Nov 4, 2024
6d3f072
chore: use production version of vue app
luistoptal Nov 4, 2024
a33135f
feat: tweak test scripts
luistoptal Nov 4, 2024
9110cae
feat: setup prod env
luistoptal Nov 4, 2024
7c863a4
refactor: cleanup vite app dev setup
luistoptal Nov 4, 2024
61cf404
chor: clean up readme
luistoptal Nov 4, 2024
14a144c
feat: separates form buttons from uppy widget
luistoptal Nov 5, 2024
d9dc59e
chore: reset env
luistoptal Nov 5, 2024
a15de36
fix: typo
luistoptal Nov 5, 2024
673784e
feat: adds e2e test of the logo upload flow
luistoptal Nov 5, 2024
1771019
feat: adds tests to readme
luistoptal Nov 5, 2024
aa43466
chore: expands readme
luistoptal Nov 5, 2024
5a15df3
chore: up log
luistoptal Nov 5, 2024
40f3224
chore: Merge branch 'develop' into new-feature/376-upload-update-proj…
luistoptal Nov 15, 2024
b6c936f
chore: cleans up
luistoptal Nov 15, 2024
3371083
feat: uses tmp folder to store temp uploaded logos in project admin form
luistoptal Nov 15, 2024
487fe6e
chore: remove excessive logs
luistoptal Nov 15, 2024
8ab6092
refactor: simplifies write logo fnc
luistoptal Nov 18, 2024
2bf354e
refactor: update and write tmp logo, set uppy debug to false
luistoptal Nov 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ files/certs
files/data/filetypes.json
images/tempcaptcha/
images/vue
files/dev

# nginx config created by generate_config.sh
ops/configuration/nginx-conf/sites/staging/gigadb.staging.http.conf
Expand Down Expand Up @@ -89,6 +90,7 @@ vault
staging_vault
live_vault
js/fuw-*
js/vite-logo-upload-*

# docs
docs/apidocs/phpdoc-cache-*
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased

- Feat #376: Use tmp folder to store temp uploaded logos in project admin form
- Feat #376: Uppy logo uploader for admin projects
- Feat #701: Code refactoring to separate upload status transitions and notifications to prepare for upload status overhaul
- Security #1867: Update the gitlab static application security testing (SAST) job using the Semgrep-based analyzer

Expand Down
3 changes: 2 additions & 1 deletion less/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@
@import "modules/team-grid.less";
@import "modules/map.less";
@import "modules/lists.less";
@import "modules/tooltip.less";
@import "modules/tooltip.less";
@import "modules/spinner.less";
13 changes: 13 additions & 0 deletions less/modules/spinner.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.spinner {
border: 4px solid @color-gigadb-green;
border-top: 4px solid transparent;
border-radius: 50%;
width: 1.5rem;
height: 1.5rem;
animation: spin 1s linear infinite;
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
6 changes: 6 additions & 0 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 25 additions & 13 deletions ops/deployment/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,17 @@ services:
- ${APPLICATION}/less:/var/www/less
- ${APPLICATION}/css:/var/www/css
- ${APPLICATION}/sql:/var/www/sql
- ${APPLICATION}/style-guide:/var/www/style-guide
- ${APPLICATION}/style-guide:/var/www/style-guide
- ${APPLICATION}/index.php:/var/www/index.php
- ${APPLICATION}/composer.json:/var/www/composer.json
- ${APPLICATION}/composer.lock:/var/www/composer.lock
- ${APPLICATION}/ops/configuration/php-conf/php-${GIGADB_ENV}.ini:/usr/local/etc/php/php.ini
- ${APPLICATION}/ops/configuration/php-conf/gigadb.pool.conf:/usr/local/etc/php-fpm.d/gigadb.pool.conf
- ${APPLICATION}/ops/configuration/php-conf/opcache.ini:/usr/local/etc/php/conf.d/opcache.ini
# access to File Upload Wizard model classes
- ../../fuw/app:/app
- ../../fuw/app:/app
- ../../gigadb:/gigadb
- /tmp:/var/www/datasetfiles
expose:
- "9000"
extra_hosts:
Expand Down Expand Up @@ -348,15 +349,15 @@ services:
ipv4_address: 172.16.238.11
extra_hosts:
- "gigadb.test:172.16.238.10"
- "fuw-admin-api:172.16.238.10"
- "fuw-admin-api:172.16.238.10"
environment: # to run headless, set false and comment out port 5900 above and make sure to pass --headless arg in acceptance.suite.yml
START_XVFB: "false"

fuw-admin:
<<: *logging
environment:
GIGADB_ENV: $GIGADB_ENV
DOCKER_HOST: "tcp://host.docker.internal:2375"
DOCKER_HOST: "tcp://host.docker.internal:2375"
build:
context: ../../fuw/app
dockerfile: common/Dockerfile
Expand Down Expand Up @@ -465,7 +466,7 @@ services:
- ~/.composer/cache:/root/.composer/cache:delegated
# Mount source-code for development
- ../../fuw/app:/app
- ../../gigadb/app:/gigadb-apps
- ../../gigadb/app:/gigadb-apps
# php config
- ../../fuw/app/php-conf/fuw.ini:/usr/local/etc/php/conf.d/fuw.ini
- ../../fuw/app/php-conf/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
Expand All @@ -480,7 +481,7 @@ services:
# volume mount the location of public ftp directory
- /tmp:/var/ftp/public
# access to files and reference data
- ../../files:/var/www/files
- ../../files:/var/www/files
depends_on:
- database
- beanstalkd
Expand Down Expand Up @@ -509,7 +510,7 @@ services:
- ~/.composer/cache:/root/.composer/cache:delegated
# Mount source-code for development
- ../../fuw/app:/app
- ../../gigadb/app:/gigadb-apps
- ../../gigadb/app:/gigadb-apps
# php config
- ../../fuw/app/php-conf/fuw.ini:/usr/local/etc/php/conf.d/fuw.ini
- ../../fuw/app/php-conf/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
Expand All @@ -524,7 +525,7 @@ services:
# volume mount the location of public ftp directory
- /tmp:/var/ftp/public
# access to files and reference data
- ../../files:/var/www/files
- ../../files:/var/www/files
depends_on:
- database
- beanstalkd
Expand Down Expand Up @@ -565,7 +566,7 @@ services:
- ~/.composer/cache:/root/.composer/cache:delegated
# Mount source-code for development
- ../../fuw/app:/app
- ../../gigadb/app:/gigadb-apps
- ../../gigadb/app:/gigadb-apps
- ../../vendor:/gigadb-website/vendor
- ../../sql:/gigadb-website/sql
- ../../protected:/gigadb-website
Expand All @@ -587,7 +588,7 @@ services:
# to run tests that interact with containers
# - /var/run/docker.sock:/var/run/docker.sock:ro
# volume mount the location of public ftp directory
- /tmp:/var/ftp/public
- /tmp:/var/ftp/public
networks:
- web-tier
- db-tier
Expand Down Expand Up @@ -634,7 +635,7 @@ services:
- ${DATA_SAVE_PATH}/fuw/repo:/var/repo/
- ${DATA_SAVE_PATH}/fuw/flags:/var/tmp/processing_flag
# access to the ftp tokens so the upload's location attribute can be populated
- ${DATA_SAVE_PATH}/fuw/credentials:/var/private:ro
- ${DATA_SAVE_PATH}/fuw/credentials:/var/private:ro
# access to the fuw/console so tusd hooks can trigger upload update
- ../../fuw/app:/fuw/app
# access to data feeds
Expand All @@ -657,7 +658,7 @@ services:
- ${DATA_SAVE_PATH}/fuw/incoming/tusd:/var/inbox/
- ${DATA_SAVE_PATH}/fuw/repo:/var/repo/
# access to the ftp tokens so the upload's location attribute can be populated
- ${DATA_SAVE_PATH}/fuw/credentials:/var/private
- ${DATA_SAVE_PATH}/fuw/credentials:/var/private
# access to the fuw/console so tusd hooks can trigger upload update
- ../../fuw/app:/app
# access to data feeds
Expand Down Expand Up @@ -705,6 +706,17 @@ services:
- le_config:/ca
command: --domains '*.gigasciencejournal.com'

# Using similar workflow as js service
vite-project-image-location-prod:
image: node:$NODE_VERSION-bullseye-slim
working_dir: /var/www/vite
volumes:
- ${APPLICATION}/:/var/www
shm_size: '1gb'
command: bash -c "npm run test:unit ; npm run build ; npm run deploy"
networks:
- web-tier

networks:
web-tier:
driver: bridge
Expand All @@ -717,4 +729,4 @@ networks:
volumes:
le_config:
le_webrootpath:
portainer_data:
portainer_data:
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added playwright/images/G10Klogo.jpg
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 playwright/images/bgi_logo_new.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 playwright/images/tall-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 27 additions & 21 deletions playwright/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion playwright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "npx playwright test"
"test": "npx playwright test",
"test:single": "npx playwright test --workers=1 --project=chromium"
},
"keywords": [],
"author": "",
Expand Down
Loading