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

Vite #477

Merged
merged 157 commits into from
Apr 29, 2024
Merged

Vite #477

Show file tree
Hide file tree
Changes from 144 commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
93473f4
Use vite, upgrade bootstrap - hello world
will-moore Aug 3, 2022
1f10fcc
Add nav menus
will-moore Aug 3, 2022
9c57364
install backbone and underscore, setup Router
will-moore Aug 3, 2022
38c54c8
build and deploy script to serve dist/ from omero-web
will-moore Aug 3, 2022
544dbc4
install jquery. FigureModel created to load figure
will-moore Aug 3, 2022
ee98535
Add all init code to main.js. Fixed some of it...
will-moore Aug 5, 2022
7e25ca0
Add Raphael.js. Add modal dialogs to index.html
will-moore Aug 5, 2022
4587934
Add .env, include in .bumpversion.cfg
will-moore Aug 5, 2022
d45bff5
Show RELEASE_VERSION in index.html
will-moore Aug 5, 2022
744e6c4
Add shape-editor code
will-moore Aug 6, 2022
b29281d
more fixes to files.js
will-moore Aug 6, 2022
2751a3e
comment-out jquery-ui slider()
will-moore Aug 6, 2022
b2b2500
Add <main> and canvas to index.html
will-moore Aug 6, 2022
195762b
Add bootstrap-icons. Add buttons to nav
will-moore Aug 8, 2022
e61adc2
Add more nav buttons. Comment-out $.tooltip()
will-moore Aug 8, 2022
969ea45
More global const to replace in views.py
will-moore Aug 9, 2022
0b1574b
Update deploy to fix bootstrap-icons.css
will-moore Aug 10, 2022
6e92abd
Merge remote-tracking branch 'origin/master' into vite
will-moore Aug 11, 2022
385d79f
Update index.html from PR 472
will-moore Aug 11, 2022
7ffd419
Update build to use bootstrap-icons from node_modules
will-moore Aug 11, 2022
f0e6c9b
import figure.css. import templates.html?raw
will-moore Aug 11, 2022
68cc0fc
Update more templates. Fix LENGTH_UNITS
will-moore Aug 12, 2022
45249b4
Add tabbed right panel
will-moore Aug 15, 2022
1345e14
More template import fixes
will-moore Aug 16, 2022
ea055dc
Right panel Preview tab - grid layout and rotation/projection buttons
will-moore Sep 7, 2022
3132381
Use range input for channel sliders
will-moore Sep 12, 2022
ae4887c
Move images to src/images/
will-moore Sep 13, 2022
01b9177
Fix layout and icons for Z-slider range input
will-moore Sep 14, 2022
a98bdab
Z and T sliders use input-range working
will-moore Sep 21, 2022
764e3ed
Update README and fix BASE_OMEROWEB_URL
will-moore Sep 21, 2022
1e3086a
Hide Z and T sliders when not needed
will-moore Sep 21, 2022
a739695
remove unused demo/index.html
will-moore Sep 24, 2022
39bb314
Fix show of lutpickerModal
will-moore Sep 24, 2022
974a8e8
Fix channel buttons and colors drop-down menu
will-moore Sep 24, 2022
0c492af
Fix modals and figure-view events
will-moore Sep 24, 2022
0aa1b98
Fix Delete panels and modal Close buttons
will-moore Sep 25, 2022
1d04afe
Fixed lut-picker dialog
will-moore Sep 25, 2022
abc43e8
Remove old libs from omero_figure/static/figure/3rdparty
will-moore Sep 26, 2022
cd4902a
Fix navbar height and padding
will-moore Sep 26, 2022
70b0537
Fix viewport Zoom slider
will-moore Sep 26, 2022
b15aa45
Fix Crop button, replace pull-right with float-end
will-moore Sep 29, 2022
deefe00
Fix saving coors errors when built (same origin)
will-moore Oct 14, 2022
c465235
Handle Figure -> New
will-moore Oct 14, 2022
7b6b4c5
File > Open opens dialog and loads files
will-moore Oct 15, 2022
a1d7840
CSS fixes for File-Open dialog file list
will-moore Oct 16, 2022
706f6e8
File open dialog css tweaks
will-moore Oct 17, 2022
5a5dfae
data-toggle -> data-bs-toggle to fix file filter
will-moore Oct 18, 2022
864a2ed
Remove commented-out code
will-moore Oct 19, 2022
5bbfc33
Add backbone.mousetrap to fix keyboard events on body
will-moore Oct 19, 2022
13a8e36
Fix figureConfirmDialog()
will-moore Oct 20, 2022
11e12e1
Delete old src/index.html
will-moore Oct 20, 2022
a11ba63
Fix deleteFile and saveAs
will-moore Dec 7, 2022
30f4064
Remove old app.js
will-moore Dec 11, 2022
bfd7e18
Update setup.py require_npm() with new build steps
will-moore Jan 12, 2023
de538d3
Merge remote-tracking branch 'origin/master' into vite
will-moore Jan 12, 2023
b5b37f3
Delete old omero_figure/templates/figure/index.html
will-moore Jan 12, 2023
eafb2ba
gitignore includes all omero_figure/templates
will-moore Jan 12, 2023
490bc34
Fix 'npm run build' in setup.py
will-moore Jan 12, 2023
809674e
flake8 fixes
will-moore Jan 12, 2023
dfdaa95
deploy_build.sh includes mkdir templates/omero_figure
will-moore Jan 12, 2023
d6b2f29
Fix modal show/hide for main.js entry points
will-moore Jan 13, 2023
f3d614e
Export of PDF figure working. Format html
will-moore Jan 13, 2023
18aad3c
Fix Undo/Redo
will-moore Jan 13, 2023
1989109
Fix JSON dialog and align_grid
will-moore Jan 14, 2023
f336712
Fix alignment buttons enable/disable on select
will-moore Jan 14, 2023
37c2c72
Fix align_top button rotation
will-moore Jan 15, 2023
28a1e2c
Fix checkmark by chosen export_option
will-moore Jan 15, 2023
5208175
Fix layout of Info attributes
will-moore Jan 15, 2023
ba9fa6c
Info panel tweaks; Add back figure-title to nav bar
will-moore Jan 19, 2023
04169c5
Fix nav-bar button sizes and nav-bar height
will-moore Jan 19, 2023
fc03cdf
Fix image-panel loading spinners
will-moore Jan 19, 2023
c0be23d
Fix xywh form elements
will-moore Jan 19, 2023
a5b2bc6
Fixing ROI and Scalebar forms in right panel
will-moore Jan 19, 2023
21673cf
Fix right panel background height
will-moore Jan 20, 2023
765a158
Fix units symbol on scalebar
will-moore Jan 20, 2023
4dfb486
Fix labels, install marked, remove /spec tests
will-moore Jan 20, 2023
0f11acf
fix size of label field input
will-moore Jan 31, 2023
200b35f
Fix editing of labels - dropdown selections
will-moore Jan 31, 2023
794bd12
Add back the <footer> and fix zoom slider to use range input
will-moore Feb 1, 2023
d7d6324
Fix set-id dialog
will-moore Mar 23, 2023
7f0a435
Fix matching flags in preview set-id
will-moore Mar 23, 2023
4c2fe16
Use color input for colorpicker
will-moore Mar 23, 2023
32418aa
Add hint on CORS setup
will-moore Mar 24, 2023
175acf0
Fix hmr bug. LUT picker fixed, LUT slider css fix
will-moore Mar 24, 2023
0b1e538
Fix LUT background image in build
will-moore Mar 28, 2023
1cadbda
Fix ROI dialog drawing Shapes
will-moore Apr 5, 2023
30629ec
Fix ROI dialog loading ROIs from OMERO
will-moore Apr 5, 2023
366e198
Fix loading of multi-shape ROIs from OMERO
will-moore Apr 5, 2023
db4696c
Merge remote-tracking branch 'origin/master' into vite
will-moore Jun 15, 2023
0f0494d
flake8 fixes
will-moore Jun 15, 2023
9270fa8
Merge remote-tracking branch 'origin/master' into vite
will-moore Aug 17, 2023
d82721d
Handle no file found to Open
will-moore Aug 17, 2023
ecd6ac8
Delete Gruntfile
will-moore Aug 17, 2023
6ac51bf
Fix missing 'let'
will-moore Aug 17, 2023
6c5804e
Fix check icon on grid gap drop-down menu
will-moore Aug 23, 2023
8e17911
Handle 404 etc for load images
will-moore Aug 23, 2023
0bfa74b
Fix focus() of addImages input
will-moore Aug 23, 2023
1d6d2cf
Merge remote-tracking branch 'Rdornier/add-cyan-color' into vite
will-moore Feb 13, 2024
7a60c0e
Merge remote-tracking branch 'Rdornier/manual-zoom-level' into vite
will-moore Feb 13, 2024
621caf7
Merge remote-tracking branch 'Rdornier/edit-id-z-stack' into vite
will-moore Feb 15, 2024
12bce37
Merge remote-tracking branch 'Rdornier/right-vertical' into vite
will-moore Feb 15, 2024
c9bee9b
Merge remote-tracking branch 'Rdornier/align-right-bottom' into vite
will-moore Feb 15, 2024
2da0e11
Fix right dialog drop-down menus extending off the page
will-moore Feb 15, 2024
5068c7e
Merge commit '68f10d8a' from PR #521 Z-offset attribute label into vite
will-moore Feb 15, 2024
e44a4f9
Merge branch 'font_getsize_removal' into vite
will-moore Feb 15, 2024
44cb2b9
Merge remote-tracking branch 'origin/master' into vite
will-moore Feb 15, 2024
97178e7
Don't change class of Save button
will-moore Feb 15, 2024
8bd7d70
Fix recovery-from-storage workflow
will-moore Feb 15, 2024
a20b541
Fix dpi dialog closing
will-moore Feb 15, 2024
0e4bd95
Fix align-height icon rotation
will-moore Feb 15, 2024
daa6355
Fix rotation functionality
will-moore Feb 15, 2024
88b7834
Fix paper setup dialog
will-moore Feb 16, 2024
2588e4c
Fix chgrp functionality
will-moore Feb 16, 2024
a718b8b
Fix Labels from KVP dialog
will-moore Feb 16, 2024
3890281
Fix openwith bug with iviewer
will-moore Feb 16, 2024
518d005
Fix ROI form color and line width
will-moore Feb 16, 2024
62c45ee
Fix ROI dialog copy/paste menu items
will-moore Feb 16, 2024
abbdb3f
ShapeEditor Rois re-ordering
will-moore Feb 17, 2024
91df8b5
ShapeEditor Fill color
will-moore Feb 17, 2024
14a87c9
Add missing shapeEditorTest files
will-moore Feb 17, 2024
24bafa7
Fix layout of zoom slider and input
will-moore Feb 17, 2024
395e570
Fix legend panel
will-moore Feb 18, 2024
c65b7bb
Add 'npm run watch' option for development. Update README
will-moore Feb 19, 2024
9f07d81
Mention shapeEditorTest.html in README. Remove 'Fork me' from that page
will-moore Feb 19, 2024
e159f51
Merge remote-tracking branch 'origin/master' into vite
will-moore Feb 19, 2024
b85a64a
preserve button-success color
will-moore Feb 19, 2024
4487c24
Fix crop dialog
will-moore Feb 20, 2024
d9899b8
Fix crop button styles
will-moore Feb 21, 2024
a726997
Move Z/T slider logic into separate view
will-moore Feb 29, 2024
f01b455
consistent gaps between scalebar form elements
will-moore Mar 6, 2024
bead614
Handle channel range slider values -> parseFloat()
will-moore Mar 7, 2024
fd95c4b
Restrict button outline to .btn-default
will-moore Mar 7, 2024
3c4408f
Files case-insensitive sorting. Fix button styles
will-moore Mar 7, 2024
99ba25e
Disable export_pdf button unless script is installed
will-moore Mar 7, 2024
2f883f7
Add missing script error button
will-moore Mar 8, 2024
2962d63
Revert "ShapeEditor Fill color"
will-moore Mar 8, 2024
1b976b0
Fix styles on clear_dpi button
will-moore Mar 8, 2024
01528ee
Fix overlay of Z-projection 2 sliders
will-moore Mar 8, 2024
07deaba
colourPickerOption and LUT menu item icon fixes
will-moore Mar 8, 2024
2f5c445
Fix LUT dialog layout and preview panel
will-moore Mar 8, 2024
431bf1c
Fix invert intensity channel
will-moore Mar 8, 2024
d2169b4
Prevent sliding start > end etc for channel sliders
will-moore Mar 8, 2024
06bcaad
Fix lutPreview display of LUT when selected
will-moore Mar 11, 2024
ba7cf35
Enable js min source map in vite.config.js
will-moore Mar 11, 2024
25f7f53
Fix import_from_JSON. Move checkSaveAndClear() to figureModel
will-moore Mar 12, 2024
ecaa140
Z-projection sliders - ensure start < end
will-moore Mar 19, 2024
0955ade
Support clicking on channel range sliders
will-moore Mar 20, 2024
d1948f0
Add click handling to Z-projection range sliders
will-moore Mar 20, 2024
c3019fc
Re-enable global figureModel
will-moore Mar 21, 2024
054222a
Fix declaration of shapeJson variable
will-moore Apr 11, 2024
b7cfdfa
Fix height of sliders in Firefox
will-moore Apr 12, 2024
dfce0ac
Merge remote-tracking branch 'origin/master' into vite
will-moore Apr 12, 2024
8e01878
Fix spacing above Edit Labels form
will-moore Apr 12, 2024
54739e9
Fix version in src/.env
will-moore Apr 22, 2024
60c4d75
comment out fillColor and fillOpacity handling in shapeEditorTest.js
will-moore Apr 23, 2024
88ccde0
Fix shapeEditor layer ordering when drawing multiple shapes
will-moore Apr 23, 2024
0a6278e
Fix Copy/Paste of rotated viewport to ROI (polygon)
will-moore Apr 26, 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
1 change: 1 addition & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ values =
[bumpversion:part:build]

[bumpversion:file:omero_figure/utils.py]
[bumpversion:file:src/.env]
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ node_modules/
_site
dist
omero_figure.egg-info
omero_figure/static/figure/figure.js
omero_figure/static/figure/templates.js
omero_figure/static/figure/3rdparty/shape-editor*
omero_figure/templates/
omero_figure/static/omero_figure/
15 changes: 0 additions & 15 deletions Dockerfile

This file was deleted.

177 changes: 0 additions & 177 deletions Gruntfile.js

This file was deleted.

58 changes: 27 additions & 31 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ above. If using *Option 1*, you need to *replace* the existing script:
Development
-----------

We use Grunt for various tools.
See http://figure.openmicroscopy.org/2014/05/01/testing-with-jshint-jasmine-grunt.html
for an introduction.
We use `vite.js <https://vitejs.dev/>`_ to build and serve the app during development.

Install Node from https://nodejs.org, then:

Expand All @@ -142,57 +140,55 @@ Install Node from https://nodejs.org, then:
$ cd omero-figure
$ npm install

Install Grunt CLI as described on http://gruntjs.com/using-the-cli.

To build various resources into ``omero_figure/static`` run:
To serve the app at http://localhost:8080/ using the vite dev server
(this will automatically refresh the page when changes are saved):

::

$ grunt build
$ npm run start

This will concatenate js files into a single figure.js file,
compile the underscore templates into templates.js and also
copy the shape-editor.js from node_modules.
If you are editing the Shape-Editor code, you can view the test page at
http://localhost:8080/shapeEditorTest.html

During development, you will want to peform the concatenation
(``concat``) and template compilation (``jst``) tasks whenever
the JavaScript or template files change. This can be achieved
with:

::
CORS
****

$ grunt watch
During development, we load and save figure files to an omero-web server.
You will need to have CORS enabled on your local omero-web server at
http://localhost:4080/ and be logged in already.
This URL can be edited in `src/index.html`.

It is also possible to develop figure in docker without installing anything locally.
The Docker image is built on top of ``openmicroscopy/omero-web-standalone:latest``, so you will have a fully functional
omero-web environment while developing ``omero-figure``.
First build the Docker image:
You MUST access the figure app at http://localhost:8080/ (NOT http://127.0.0.1:8080/)
for CORS to work.

::
NB: in general, POST actions such as saving of figure files or exporting figures doesn't
yet work with the dev server. To test these actions, build the app as described below:

$ docker build -t figure-devel .

Build
-----

To build the app:

To develop ``omero-figure`` you can either make all the changes within the Docker container itself by running:
::

$ npm run build

$ docker run -ti -e OMEROHOST=YOUR_HOST -p 4080:4080 figure-devel
This compiles index.html and other static assets into correct locations to be
served by the Django `omero-web` server.

The preferred option is to mount the repository containing the omero-figure code. Make the changes locally and see the changes in the docker container. To do so, run:
To serve this on a local omero-web, set config as above and install with:

::
$ docker run -ti -e OMEROHOST=YOUR_HOST -p 4080:4080 -v /PATH_TO_GIT_REPO/omero-figure:/home/figure/src figure-devel

$ pip install -e .

After starting the container, run ``docker ps`` in another terminal to find the ID of the container. Then run:
In order to build whenever changes are saved within the `src/` directory:

::

$ docker exec -u 0 -it CONTAINER_ID bash # replace CONTAINER_ID by the correct value
$ cd /home/figure/src
$ grunt watch

$ npm run watch


Release process
Expand Down
12 changes: 12 additions & 0 deletions deploy_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

echo "Deploying built resources to plugin directory..."

# copy bootstrap-icons from node_modules to static...
mkdir -p omero_figure/static/omero_figure/fonts/
cp node_modules/bootstrap-icons/font/bootstrap-icons.css omero_figure/static/omero_figure/
cp node_modules/bootstrap-icons/font/fonts/bootstrap-icons.woff2 omero_figure/static/omero_figure/fonts/

# output dir is static dir (js & css in correct place) - only need to move index.html
mkdir -p omero_figure/templates/omero_figure/
cp omero_figure/static/omero_figure/index.html omero_figure/templates/omero_figure/
Loading