From 30c9986229928d528455d963677f211fcd505172 Mon Sep 17 00:00:00 2001 From: JF-Cozy Date: Thu, 6 Jun 2024 10:36:22 +0200 Subject: [PATCH 1/7] chore: Remove photos subfolder in build folder --- README.md | 6 +++--- package.json | 8 ++++---- src/photos/targets/services/README.md | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3b5c8e49e..68b2ecbb8 100644 --- a/README.md +++ b/README.md @@ -55,14 +55,14 @@ Using a watcher - with Hot Module Replacement: ```sh $ cd cozy-photos $ yarn watch:photos:browser -$ cozy-stack serve --appdir photos://cozy-photos/build/photos --disable-csp +$ cozy-stack serve --appdir photos://cozy-photos/build --disable-csp ``` Or directly build the app (static file generated): ```sh $ cd cozy-photos $ yarn build:photos -$ cozy-stack serve --appdir photos://cozy-photos/build/photos +$ cozy-stack serve --appdir photos://cozy-photos/build ``` Your app is available at http://photos.cozy.localhost:8080/#/folder @@ -81,7 +81,7 @@ $ yarn watch:photos:browser ```sh # in another terminal, run the docker container -$ docker run --rm -it -p 8080:8080 -v "$(pwd)/build/photos":/data/cozy-app/photos cozy/cozy-app-dev +$ docker run --rm -it -p 8080:8080 -v "$(pwd)/build":/data/cozy-app/photos cozy/cozy-app-dev ``` Your app is available at http://photos.cozy.tools:8080. diff --git a/package.json b/package.json index c959b722c..a9e1c256c 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,10 @@ "version": "1.66.0", "main": "src/main.jsx", "scripts": { - "build": "cozy-scripts build --manifest src/photos/targets/manifest.webapp --build-dir build/photos --src-dir src/photos --barV7 false --cozyClientJs", - "watch": "cozy-scripts watch --manifest src/photos/targets/manifest.webapp --build-dir build/photos --src-dir src/photos --barV7 false --cozyClientJs", - "start": "cozy-scripts start --manifest src/photos/targets/manifest.webapp --build-dir build/photos --src-dir src/photos --barV7 false --cozyClientJs", - "deploy": "cozy-app-publish --token $REGISTRY_TOKEN --build-dir 'build/photos/' --prepublish downcloud --postpublish mattermost", + "build": "cozy-scripts build --manifest src/photos/targets/manifest.webapp --build-dir build --src-dir src/photos --barV7 false --cozyClientJs", + "watch": "cozy-scripts watch --manifest src/photos/targets/manifest.webapp --build-dir build --src-dir src/photos --barV7 false --cozyClientJs", + "start": "cozy-scripts start --manifest src/photos/targets/manifest.webapp --build-dir build --src-dir src/photos --barV7 false --cozyClientJs", + "deploy": "cozy-app-publish --token $REGISTRY_TOKEN --build-dir 'build/' --prepublish downcloud --postpublish mattermost", "tx": "tx pull --all || true", "lint": "npm-run-all --parallel 'lint:*'", "lint:styles": "stylint src --config ./node_modules/cozy-scripts/config/.stylintrc", diff --git a/src/photos/targets/services/README.md b/src/photos/targets/services/README.md index 505cdd2d5..9ce64b997 100644 --- a/src/photos/targets/services/README.md +++ b/src/photos/targets/services/README.md @@ -8,4 +8,4 @@ See [here](https://github.com/cozy/cozy.github.io/blob/dev/src/howTos/dev/servic * Install dependencies: `yarn`. * Build the service: `yarn watch:photos` -* Run it thanks to the `cozy-konnector-dev` tool, included in [cozy-jobs-cli](https://github.com/konnectors/libs/tree/master/packages/cozy-jobs-cli#cozy-run-dev) : `yarn add -D cozy-jobs-cli && ./node_modules/.bin/cozy-konnector-dev -m src/photos/targets/manifest.webapp build/photos/services/onPhotoUpload/photos.js` +* Run it thanks to the `cozy-konnector-dev` tool, included in [cozy-jobs-cli](https://github.com/konnectors/libs/tree/master/packages/cozy-jobs-cli#cozy-run-dev) : `yarn add -D cozy-jobs-cli && ./node_modules/.bin/cozy-konnector-dev -m src/photos/targets/manifest.webapp build/services/onPhotoUpload/photos.js` From 8083b65713ffeac306cd8d405538456b1acbb1ea Mon Sep 17 00:00:00 2001 From: JF-Cozy Date: Thu, 6 Jun 2024 10:59:21 +0200 Subject: [PATCH 2/7] feat: Upgrade packages --- package.json | 10 +- src/photos/components/StyledApp.jsx | 2 + .../__snapshots__/Topbar.spec.jsx.snap | 10 +- src/photos/components/actions/shareAlbum.jsx | 2 +- .../__snapshots__/AlbumsView.spec.jsx.snap | 2 +- src/photos/ducks/upload/styles.styl | 1 - src/photos/styles/albumsList.styl | 1 - src/photos/styles/createAlbumForm.styl | 1 - src/photos/styles/newAlbum.styl | 1 - src/photos/styles/photoList.styl | 1 - src/photos/styles/toolbar.styl | 1 - src/photos/targets/browser/index.ejs | 1 + src/photos/targets/browser/index.jsx | 2 +- src/photos/targets/public/index.ejs | 1 + yarn.lock | 5370 +++-------------- 15 files changed, 759 insertions(+), 4647 deletions(-) diff --git a/package.json b/package.json index a9e1c256c..75a8244a4 100644 --- a/package.json +++ b/package.json @@ -78,12 +78,12 @@ "cozy-authentication": "2.10.10", "cozy-bar": "10.0.0", "cozy-ci": "0.5.2", - "cozy-client": "^45.1.0", + "cozy-client": "^47.6.0", "cozy-client-js": "0.20.0", "cozy-device-helper": "^2.5.0", "cozy-doctypes": "1.85.4", "cozy-flags": "3.0.1", - "cozy-harvest-lib": "18.0.0", + "cozy-harvest-lib": "^25.1.1", "cozy-intent": "^2.18.0", "cozy-keys-lib": "6.0.0", "cozy-logger": "1.9.1", @@ -91,9 +91,9 @@ "cozy-realtime": "4.6.0", "cozy-scanner": "^7.0.0", "cozy-scripts": "^8.2.0", - "cozy-sharing": "10.0.0", - "cozy-stack-client": "^45.0.1", - "cozy-ui": "100.0.0", + "cozy-sharing": "^14.1.0", + "cozy-stack-client": "^47.4.0", + "cozy-ui": "^107.4.1", "date-fns": "1.30.1", "justified-layout": "2.1.2", "kd-tree-javascript": "1.0.3", diff --git a/src/photos/components/StyledApp.jsx b/src/photos/components/StyledApp.jsx index ed66023f4..9673cb63f 100644 --- a/src/photos/components/StyledApp.jsx +++ b/src/photos/components/StyledApp.jsx @@ -4,7 +4,9 @@ import 'photos/styles/main.styl' import 'cozy-sharing/dist/stylesheet.css' import CozyTheme from 'cozy-ui/transpiled/react/providers/CozyTheme' + const StyledApp = ({ children }) => { return {children} } + export default StyledApp diff --git a/src/photos/components/__snapshots__/Topbar.spec.jsx.snap b/src/photos/components/__snapshots__/Topbar.spec.jsx.snap index 84e277747..674cd89fe 100644 --- a/src/photos/components/__snapshots__/Topbar.spec.jsx.snap +++ b/src/photos/components/__snapshots__/Topbar.spec.jsx.snap @@ -2,13 +2,13 @@ exports[`Topbar renders the topbar for mobile and the child have the expected router 1`] = `

() => ({ diff --git a/src/photos/ducks/albums/components/__snapshots__/AlbumsView.spec.jsx.snap b/src/photos/ducks/albums/components/__snapshots__/AlbumsView.spec.jsx.snap index 1509d31d5..7ea2d7a66 100644 --- a/src/photos/ducks/albums/components/__snapshots__/AlbumsView.spec.jsx.snap +++ b/src/photos/ducks/albums/components/__snapshots__/AlbumsView.spec.jsx.snap @@ -2,7 +2,7 @@ exports[`AlbumsView displays an empty Component 1`] = `
@@ -83,17 +84,18 @@ exports[`Public view should render the album 1`] = ` className="pho-public-mycozy" from="" /> -
From eddaa948698c9aa2bd4037f61c726433ba7e9d93 Mon Sep 17 00:00:00 2001 From: JF-Cozy Date: Thu, 6 Jun 2024 12:15:17 +0200 Subject: [PATCH 6/7] feat: Replace var color by semantic var color --- src/components/pushClient/supportUs.styl | 2 +- src/photos/components/actions/deleteAlbum.jsx | 2 +- src/photos/ducks/upload/UploadQueue.jsx | 5 +-- src/photos/ducks/upload/styles.styl | 34 +++++++++---------- src/photos/styles/albumsList.styl | 10 +++--- src/photos/styles/createAlbumForm.styl | 2 +- src/photos/styles/newAlbum.styl | 6 ++-- src/photos/styles/photoList.styl | 8 ++--- src/photos/targets/public/index.styl | 2 +- 9 files changed, 34 insertions(+), 37 deletions(-) diff --git a/src/components/pushClient/supportUs.styl b/src/components/pushClient/supportUs.styl index f5c6d6cce..6eee3ccc5 100644 --- a/src/components/pushClient/supportUs.styl +++ b/src/components/pushClient/supportUs.styl @@ -10,5 +10,5 @@ margin-left 0 margin-right 0 .SupportUs__description - color var(--coolGrey) + color var(--actionColorActive) font-style italic diff --git a/src/photos/components/actions/deleteAlbum.jsx b/src/photos/components/actions/deleteAlbum.jsx index 8df454ecd..4d6f0dc76 100644 --- a/src/photos/components/actions/deleteAlbum.jsx +++ b/src/photos/components/actions/deleteAlbum.jsx @@ -15,7 +15,7 @@ const deleteAlbum = onDelete => () => ({ return ( - + diff --git a/src/photos/ducks/upload/UploadQueue.jsx b/src/photos/ducks/upload/UploadQueue.jsx index bdb44a1a0..d603648bf 100644 --- a/src/photos/ducks/upload/UploadQueue.jsx +++ b/src/photos/ducks/upload/UploadQueue.jsx @@ -4,7 +4,6 @@ import { connect } from 'react-redux' import { translate } from 'cozy-ui/transpiled/react/providers/I18n' import { Icon, Spinner } from 'cozy-ui/transpiled/react' -import palette from 'cozy-ui/stylus/settings/palette.json' import CrossIcon from 'cozy-ui/transpiled/react/Icons/Cross' import WarningIcon from 'cozy-ui/transpiled/react/Icons/Warning' import CheckIcon from 'cozy-ui/transpiled/react/Icons/Check' @@ -30,9 +29,7 @@ const Item = translate()(({ file, status }) => { let statusIcon switch (status) { case 'loading': - statusIcon = ( - - ) + statusIcon = break case 'cancel': statusIcon = diff --git a/src/photos/ducks/upload/styles.styl b/src/photos/ducks/upload/styles.styl index 0edd9614f..e5e0ee0e5 100644 --- a/src/photos/ducks/upload/styles.styl +++ b/src/photos/ducks/upload/styles.styl @@ -11,9 +11,9 @@ height 13.125rem width 30rem max-width 90% - border .0625rem solid var(--silver) + border .0625rem solid var(--borderMainColor) border-radius .25rem - background-color var(--white) + background-color var(--paperBackgroundColor) display flex flex-direction column transition .5s @@ -27,8 +27,8 @@ transform translate(0) .upload-queue-header - background-color var(--paleGrey) - color var(--charcoalGrey) + background-color var(--contrastBackgroundColor) + color var(--primaryTextColor) font-weight bold margin 0 padding .5rem 1rem @@ -43,7 +43,7 @@ background 0 margin 0 padding .4rem 0 .4rem .8rem - color var(--dodgerBlue) + color var(--primaryColor) text-transform uppercase font-size .8rem @@ -57,11 +57,11 @@ progress.upload-queue-progress margin 0 progress.upload-queue-progress::-webkit-progress-bar - background-color var(--silver) + background-color var(--actionColorDisabled) progress.upload-queue-progress::-webkit-progress-value - background-color var(--dodgerBlue) + background-color var(--primaryColor) progress.upload-queue-progress::-moz-progress-bar - background-color var(--dodgerBlue) + background-color var(--primaryColor) .upload-queue-content overflow auto @@ -78,10 +78,10 @@ progress.upload-queue-progress::-moz-progress-bar flex-direction column .upload-queue-item--error - background-color var(--chablis) + background-color var(--errorColorLightest) .upload-queue-item--done - background-color var(--paleGrey) + background-color var(--contrastBackgroundColor) .upload-queue-item height 3rem @@ -92,7 +92,7 @@ progress.upload-queue-progress::-moz-progress-bar flex 0 0 auto width 100% max-width 'calc(100vw - %s)' % 13.75rem - border-bottom .0625rem solid var(--silver) + border-bottom .0625rem solid var(--borderMainColor) .item-cell box-sizing border-box @@ -106,14 +106,14 @@ progress.upload-queue-progress::-moz-progress-bar white-space nowrap overflow hidden text-overflow ellipsis - color var(--charcoalGrey) + color var(--primaryTextColor) .item-file flex 0 0 85% user-select none .item-ext - color var(--coolGrey) + color var(--actionColorActive) .item-image background embedurl('./assets/icons/icon-type-image.svg') 1rem center no-repeat @@ -124,7 +124,7 @@ progress.upload-queue-progress::-moz-progress-bar .item-pending text-transform uppercase - color var(--dodgerBlue) + color var(--primaryColor) font-size .75rem font-weight bold line-height 2rem @@ -147,7 +147,7 @@ progress.upload-queue-progress::-moz-progress-bar max-height 0 border-radius 0 border 0 - background-color var(--white) + background-color var(--paperBackgroundColor) box-shadow none &:before @@ -157,7 +157,7 @@ progress.upload-queue-progress::-moz-progress-bar width 100% height $coz-bar-border-size content '' - background var(--white) + background var(--paperBackgroundColor) .upload-queue--visible max-height 30% @@ -167,5 +167,5 @@ progress.upload-queue-progress::-moz-progress-bar .upload-queue-header background 0 - color var(--dodgerBlue) + color var(--primaryColor) text-transform uppercase diff --git a/src/photos/styles/albumsList.styl b/src/photos/styles/albumsList.styl index 2baddff40..2316c34f9 100644 --- a/src/photos/styles/albumsList.styl +++ b/src/photos/styles/albumsList.styl @@ -28,7 +28,7 @@ .pho-album-title font-weight normal font-size 1rem - color var(--charcoalGrey) + color var(--primaryTextColor) .pho-album-description text-align left @@ -57,24 +57,24 @@ height 12rem border-radius .25rem object-fit cover - background var(--paleGrey) embedurl('../assets/icons/icon-album-fallback.svg') center center / 5rem 4rem no-repeat + background var(--contrastBackgroundColor) embedurl('../assets/icons/icon-album-fallback.svg') center center / 5rem 4rem no-repeat .pho-album-title width 100% margin .2rem 0 overflow hidden font-size 1.25rem - color var(--black) + color var(--primaryTextColor) text-decoration none text-overflow ellipsis .pho-album-link - color var(--black) + color var(--primaryTextColor) text-decoration none .pho-album-description width 100% - color var(--coolGrey) + color var(--actionColorActive) font-weight normal font-size .875rem margin 0 diff --git a/src/photos/styles/createAlbumForm.styl b/src/photos/styles/createAlbumForm.styl index ce9ec7751..e50fba19c 100644 --- a/src/photos/styles/createAlbumForm.styl +++ b/src/photos/styles/createAlbumForm.styl @@ -6,7 +6,7 @@ .coz-create-album-label display block - color var(--coolGrey) + color var(--actionColorActive) font-size .75rem line-height 1.5 text-transform uppercase diff --git a/src/photos/styles/newAlbum.styl b/src/photos/styles/newAlbum.styl index 7e1e9e6e1..9cc350c96 100644 --- a/src/photos/styles/newAlbum.styl +++ b/src/photos/styles/newAlbum.styl @@ -8,7 +8,7 @@ bottom 0 left 0 z-index $modal-index - background-color var(--white) + background-color var(--paperBackgroundColor) .pho-panel-form @extend $form @@ -20,7 +20,7 @@ .pho-panel-header .pho-panel-footer - background-color var(--paleGrey) + background-color var(--contrastBackgroundColor) flex 0 0 3.125rem .pho-panel-header // @stylint ignore @@ -30,7 +30,7 @@ width 100% max-width 20rem padding .5rem .3rem .35rem - background-color var(--white) + background-color var(--paperBackgroundColor) font-size 1.5rem h3 diff --git a/src/photos/styles/photoList.styl b/src/photos/styles/photoList.styl index 441ac83de..1ba51566d 100644 --- a/src/photos/styles/photoList.styl +++ b/src/photos/styles/photoList.styl @@ -25,7 +25,7 @@ a:visited, a:hover, a:active - color var(--dodgerBlue) + color var(--primaryColor) text-decoration none text-transform uppercase cursor pointer @@ -41,7 +41,7 @@ .pho-photo position absolute display inline-block - background-color var(--paleGrey) + background-color var(--contrastBackgroundColor) margin 0 1rem 1rem 0 a @@ -71,8 +71,8 @@ background-position center center &[data-input=checkbox] input[type=checkbox]:checked + label::before - background-color var(--dodgerBlue) - box-shadow 0 0 0 .1875rem var(--dodgerBlue), inset 0 0 0 1.5rem var(--dodgerBlue) + background-color var(--primaryColor) + box-shadow 0 0 0 .1875rem var(--primaryColor), inset 0 0 0 1.5rem var(--primaryColor) .pho-photo--selected .pho-photo-item diff --git a/src/photos/targets/public/index.styl b/src/photos/targets/public/index.styl index 71cf078c1..4e36b9731 100644 --- a/src/photos/targets/public/index.styl +++ b/src/photos/targets/public/index.styl @@ -22,7 +22,7 @@ bottom 0 left 0 z-index $bar-index - background-color var(--white) + background-color var(--paperBackgroundColor) .pho-public-download .pho-public-mycozy From 07930b58a128e27dff255e4c9127e44fac8c4b48 Mon Sep 17 00:00:00 2001 From: JF-Cozy Date: Thu, 6 Jun 2024 12:20:33 +0200 Subject: [PATCH 7/7] feat: Upgrade cozy-ui --- package.json | 2 +- src/photos/targets/browser/index.ejs | 2 +- src/photos/targets/public/index.ejs | 2 +- yarn.lock | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index bb60f4b9d..876422a95 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "cozy-scripts": "^8.2.0", "cozy-sharing": "^14.1.0", "cozy-stack-client": "^47.4.0", - "cozy-ui": "^107.4.1", + "cozy-ui": "^108.0.0", "date-fns": "1.30.1", "justified-layout": "2.1.2", "kd-tree-javascript": "1.0.3", diff --git a/src/photos/targets/browser/index.ejs b/src/photos/targets/browser/index.ejs index 5e52f351e..bce0c4eb6 100755 --- a/src/photos/targets/browser/index.ejs +++ b/src/photos/targets/browser/index.ejs @@ -8,7 +8,7 @@ - + - + Public Cozy Photos <% _.forEach(htmlWebpackPlugin.files.css, function(file) { %> diff --git a/yarn.lock b/yarn.lock index 35a24253d..23378a1df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6595,10 +6595,10 @@ cozy-tsconfig@1.2.0: resolved "https://registry.yarnpkg.com/cozy-tsconfig/-/cozy-tsconfig-1.2.0.tgz#17e61f960f139fae4d26cbac2254b9ab632b269e" integrity sha512-TRHnY9goF3FzVlUbP7BcHxuN2XAA4AmppT4fHHZmTKaSwYTByVR1Al+riFMDbce94kJZ1wzl9WNLWQuqzGZ6Cw== -cozy-ui@^107.4.1: - version "107.4.1" - resolved "https://registry.yarnpkg.com/cozy-ui/-/cozy-ui-107.4.1.tgz#f39857157dc6d8400de4d7d834fc7fcb9bbc7088" - integrity sha512-O6JR8Iz8poJsr3lg7OO2NxTHCcaifGYwDRzJ+1tsD7W+gQAwEIpI+dkK9D4omv59ym+gAWPXuxm5uhw77dptZQ== +cozy-ui@^108.0.0: + version "108.0.0" + resolved "https://registry.yarnpkg.com/cozy-ui/-/cozy-ui-108.0.0.tgz#94d265406f19040ee323ab078df752ca64dc948d" + integrity sha512-Et2KNzP397Eq8mEJclsVMAVZuFI8UUJz3ECfRHqYNetMmOTuO2BHlXMbkcMfJ3oYCua60kPtrgNIuvYOpiKFhw== dependencies: "@babel/runtime" "^7.3.4" "@material-ui/core" "4.12.3" @@ -13003,9 +13003,9 @@ msgpack5@^4.0.2: readable-stream "^2.3.6" safe-buffer "^5.1.2" -"mui-bottom-sheet@https://github.com/cozy/mui-bottom-sheet.git#v1.0.9": +"mui-bottom-sheet@git+https://github.com/cozy/mui-bottom-sheet.git#v1.0.9": version "1.0.8" - resolved "https://github.com/cozy/mui-bottom-sheet.git#3dc4c2a245ab39079bc2f73546bccf80847be14c" + resolved "git+https://github.com/cozy/mui-bottom-sheet.git#3dc4c2a245ab39079bc2f73546bccf80847be14c" dependencies: "@juggle/resize-observer" "^3.1.3" jest-environment-jsdom-sixteen "^1.0.3"