From 1043690a5d9d0f4fe5c760124dae9000fdd68750 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 26 Jan 2021 11:37:08 +0100 Subject: [PATCH 01/13] Add bigger container max-width for desktop view --- assets/sass/_vars.scss | 1 + assets/sass/layout.scss | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/assets/sass/_vars.scss b/assets/sass/_vars.scss index 31b7580..1387331 100644 --- a/assets/sass/_vars.scss +++ b/assets/sass/_vars.scss @@ -29,3 +29,4 @@ $errorColor: desaturate($errorText, 50%); // Responsivity $mobileThreshold: 632px; +$desktopThreshold: 940px; diff --git a/assets/sass/layout.scss b/assets/sass/layout.scss index 5a00bff..94508cc 100644 --- a/assets/sass/layout.scss +++ b/assets/sass/layout.scss @@ -650,16 +650,16 @@ button, .button { } @mixin container { - width: $mobileThreshold; - padding: 0 16px; + width: 100%; + padding: 0 8px; @media (min-width: $mobileThreshold) { margin: 0 auto; + padding: 0 16px; } - @media (max-width: $mobileThreshold) { - width: 100%; - padding: 0 8px; + @media (min-width: $desktopThreshold) { + width: $desktopThreshold; } } From d2a67a12ee8dac1ca7c54f2b8907655deb0b00cf Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 26 Jan 2021 11:42:24 +0100 Subject: [PATCH 02/13] Fix subpanel leaking out of their container --- assets/sass/layout.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/sass/layout.scss b/assets/sass/layout.scss index 94508cc..5ec9874 100644 --- a/assets/sass/layout.scss +++ b/assets/sass/layout.scss @@ -688,10 +688,14 @@ button, .button { } .sub-panel { - margin: 32px -18px; + margin: 32px 0; padding: 1px 16px; border: 2px solid lighten($panelBackground, 4%); border-radius: 5px; + + form > & { + margin: 32px -18px; + } } From 16394c0d4cfc69703e0a58adb6213443c5c14f32 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 26 Jan 2021 11:43:13 +0100 Subject: [PATCH 03/13] Set icon size for titles --- assets/sass/layout.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/sass/layout.scss b/assets/sass/layout.scss index 5ec9874..021028f 100644 --- a/assets/sass/layout.scss +++ b/assets/sass/layout.scss @@ -719,6 +719,10 @@ button, .button { stroke-linejoin: miter; fill: none; vertical-align: middle; + + h1 > &, h2 > &, h3 > & { + --icon-size: 24px; + } } // --- From e7165edafd09e1db353b207720185cf6f5df7cbf Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 26 Jan 2021 11:43:42 +0100 Subject: [PATCH 04/13] Add hover color on warning buttons --- assets/sass/layout.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/sass/layout.scss b/assets/sass/layout.scss index 021028f..a927d89 100644 --- a/assets/sass/layout.scss +++ b/assets/sass/layout.scss @@ -584,6 +584,10 @@ button, .button { &.warning { background-color: $warningColor; + + &:hover { + background-color: lighten($warningColor, 10%); + } } &.error, &.danger { From bda464ab1689be918219834782e2b8da0d1d8ca5 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 26 Jan 2021 13:00:23 +0100 Subject: [PATCH 05/13] css: move a hover color and td.actions improvements to layout.scss --- assets/sass/layout.scss | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/assets/sass/layout.scss b/assets/sass/layout.scss index a927d89..b8a5d32 100644 --- a/assets/sass/layout.scss +++ b/assets/sass/layout.scss @@ -338,7 +338,7 @@ a { text-decoration: none; &:hover { - color: lighten($secondary, 10%); + color: lighten($secondary, 30%); } .feather.feather-external-link { @@ -607,6 +607,35 @@ button, .button { } } + +// --- +// --- Tables +// --- +td.actions { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + + form { + padding: 0; + display: inline; + } + + button, .button { + margin: 0; + padding: 8px; + + .feather { + margin-right: 0; + } + } + + > *:not(:first-child) { + margin-left: 8px; + } +} + .data-table { width: 100%; text-align: left; @@ -633,6 +662,10 @@ button, .button { } } + +// --- +// --- Breadcrumb widget +// --- .breadcrumb { list-style: none; display: flex; @@ -646,6 +679,7 @@ button, .button { } } + // --- // --- Layout helpers // --- From 8612b0f33a75ac034ca719d05397cd5e89ea33ff Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 26 Jan 2021 13:00:38 +0100 Subject: [PATCH 06/13] css: move lighter theme to layout.scss and make header css mobile first --- assets/sass/_vars.scss | 7 +- assets/sass/layout.scss | 254 +++++++++++++++------------- assets/sass/responsivity_tools.scss | 19 +++ 3 files changed, 160 insertions(+), 120 deletions(-) create mode 100644 assets/sass/responsivity_tools.scss diff --git a/assets/sass/_vars.scss b/assets/sass/_vars.scss index 1387331..478fca3 100644 --- a/assets/sass/_vars.scss +++ b/assets/sass/_vars.scss @@ -6,9 +6,10 @@ $secondaryForeground: $primaryForeground; $backgroundColor: darken($primary, 4%); $defaultTextColor: #ffffff; -$headerBackground: darken($primary, 7.5%); -$footerBackground: lighten($headerBackground, 1%); -$panelBackground: lighten($headerBackground, 1%); +$headerBackground: transparent; +$headerContainer: true; +$footerBackground: transparent; +$panelBackground: darken($backgroundColor, 3.2%); $inputBackground: darken($panelBackground, 4%); $info: #4499ff; diff --git a/assets/sass/layout.scss b/assets/sass/layout.scss index b8a5d32..d086fb7 100644 --- a/assets/sass/layout.scss +++ b/assets/sass/layout.scss @@ -1,5 +1,6 @@ @import "vars"; @import 'fonts'; +@import "responsivity_tools"; * { box-sizing: border-box; @@ -69,21 +70,31 @@ body { body > header { z-index: 50; display: flex; - flex-direction: row; + flex-direction: row-reverse; justify-content: space-between; + align-items: center; $headerHeight: 64px; height: $headerHeight; line-height: $headerHeight; - background-color: $headerBackground; + background: $headerBackground; + + @if $headerContainer { + @include container; + } + + @media (max-width: $mobileThreshold) { + padding: 0; + } .logo { display: flex; flex-direction: row; + align-items: center; - padding: 0 24px 0 16px; - font-size: 32px; + padding: 0 16px 0 8px; + font-size: 24px; color: $defaultTextColor; &:hover { @@ -91,34 +102,48 @@ body > header { } img { - width: $headerHeight; - height: $headerHeight; - margin-right: 16px; + width: initial; + height: calc(#{$headerHeight} - 16px); + margin-right: 8px; + flex-shrink: 0; } } nav { - ul { + > ul { + position: fixed; + z-index: -1; + top: 0; + left: 0; + height: 100%; + transform: translateX(-100%); + transition: transform ease-out 150ms; + display: flex; - flex-direction: row; + flex-direction: column; margin: 0; - padding: 0; + padding: $headerHeight 8px 8px; font-size: 20px; + background: $panelBackground; + li { position: relative; list-style: none; + margin-top: 8px; a, button { position: relative; - height: 64px; margin: 0; - padding: 0 24px; display: flex; flex-direction: row; align-items: center; + height: auto; + padding: 8px; + + border-radius: 3px; &:hover, &:active { &:not(button) { @@ -127,13 +152,19 @@ body > header { } .feather { - --icon-size: 24px; + --icon-size: 16px; + } + + .tip { + display: block; + margin-left: 8px; + text-transform: inherit; + font-weight: inherit; } } button { - margin: 8px; - padding: 24px; + margin: 0; height: 32px; .feather { @@ -158,114 +189,121 @@ body > header { } .dropdown { - position: absolute; - z-index: -1; - top: 100%; - right: 0; - - white-space: nowrap; - background: $headerBackground; - border-radius: 0 0 3px 3px; - - a { - padding: 0 8px; - } - } - - &:hover .dropdown { + position: initial; display: block; + padding-left: 0; } } + + > li:not(:first-child) { + border-top: 1px solid transparentize($defaultTextColor, 0.8); + padding-top: 8px; + } + + &.open { + transform: translateX(0%); + box-shadow: 0 0 5px darken($panelBackground, 20%); + } } #menu-button { - display: none; - } - } + position: fixed; + top: 0; + left: 0; + display: block; + margin: 0; + padding: 0 16px; + line-height: $headerHeight; - @media (max-width: $mobileThreshold) { - flex-direction: row-reverse; + cursor: pointer; + background: transparent; + border-radius: 0; - .logo { - padding: 0 16px 0 8px; - font-size: 24px; - - img { - margin-right: 8px; + .feather { + --icon-size: 28px; + margin: 0 8px; } } - nav { - #menu-button { - display: block; - margin: 0; - padding: 0 16px; - line-height: $headerHeight; - - cursor: pointer; - background: transparent; - border-radius: 0; - - .feather { - --icon-size: 28px; - margin: 0 8px; - } - } - - > ul { - flex-direction: column; - position: absolute; - z-index: 10; - left: 0; - transform: translateX(-100%); - transition: transform ease-out 150ms; - - background-color: $headerBackground; - - &.open { - transform: translateX(0%); - } - - li { - a, button { - .tip { - display: block; - margin-left: 8px; - text-transform: inherit; - font-weight: inherit; - } - } - - .dropdown { - position: initial; - display: block; - padding-left: 32px; - } - } - } + hr { + border: 0; + border-bottom: 1px solid $defaultTextColor; + opacity: 0.2; } } @media (min-width: $mobileThreshold) { - nav ul li { - a, button, .button { - @include tip; + flex-direction: row; + + nav { + #menu-button { + display: none; } - &:last-child { - a, button, .button { - .tip { - left: unset; - right: 4px; - transform: none; + ul { + position: static; + flex-direction: row; + transform: none; + padding: 0; + background: transparent; + + li { + margin-top: 0; + margin-left: 8px; + + a, button, .button { + @include tip; } + + &:last-child { + a, button, .button { + .tip { + left: unset; + right: 4px; + transform: none; + } + } + } + + .dropdown { + position: absolute; + z-index: -1; + top: 100%; + right: 0; + display: none; + padding: 8px; + + white-space: nowrap; + background: $panelBackground; + border-radius: 0 0 3px 3px; + + box-shadow: 0 2px 2px transparentize(darken($panelBackground, 20%), 0.75); + border-top: 4px solid lighten($panelBackground, 5%); + + li { + margin-left: 0; + + &:not(:first-child) { + margin-top: 8px; + } + } + } + + &:hover .dropdown { + display: block; + } + } + + > li:not(:first-child) { + border-top: 0; + padding-top: 0; } } } } } -footer { +body > footer { padding: 8px; margin-top: 8px; text-align: center; @@ -687,24 +725,6 @@ td.actions { text-align: center; } -@mixin container { - width: 100%; - padding: 0 8px; - - @media (min-width: $mobileThreshold) { - margin: 0 auto; - padding: 0 16px; - } - - @media (min-width: $desktopThreshold) { - width: $desktopThreshold; - } -} - -.container { - @include container; -} - .panel { position: relative; margin: 16px 0 48px; diff --git a/assets/sass/responsivity_tools.scss b/assets/sass/responsivity_tools.scss new file mode 100644 index 0000000..0e3d232 --- /dev/null +++ b/assets/sass/responsivity_tools.scss @@ -0,0 +1,19 @@ +@import "vars"; + +@mixin container { + width: 100%; + padding: 0 8px; + + @media (min-width: $mobileThreshold) { + margin: 0 auto; + padding: 0 16px; + } + + @media (min-width: $desktopThreshold) { + width: $desktopThreshold; + } +} + +.container { + @include container; +} From 145d8df70a945acc6d09b06d1b32dabbb1e02a70 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 26 Jan 2021 13:37:41 +0100 Subject: [PATCH 07/13] css: move menu .tip visibility to layout.scss --- assets/sass/layout.scss | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/assets/sass/layout.scss b/assets/sass/layout.scss index d086fb7..9e14352 100644 --- a/assets/sass/layout.scss +++ b/assets/sass/layout.scss @@ -156,10 +156,22 @@ body > header { } .tip { + position: static; + visibility: visible; + opacity: 1; display: block; + height: auto; margin-left: 8px; - text-transform: inherit; + padding: 0 0 0 4px; + transform: none; + + font-size: 16px; + line-height: 16px; + + color: inherit; + text-transform: uppercase; font-weight: inherit; + background: transparent; } } @@ -251,10 +263,6 @@ body > header { margin-top: 0; margin-left: 8px; - a, button, .button { - @include tip; - } - &:last-child { a, button, .button { .tip { From 959e5ca27672c40a0b9211dca43e9f0ac505463f Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 26 Jan 2021 14:28:53 +0100 Subject: [PATCH 08/13] Remove duplicate definition of .copyable-text and improve table layout --- assets/sass/layout.scss | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/assets/sass/layout.scss b/assets/sass/layout.scss index 9e14352..4f4124b 100644 --- a/assets/sass/layout.scss +++ b/assets/sass/layout.scss @@ -693,6 +693,7 @@ td.actions { th { border-bottom: 1px solid #39434a; + white-space: nowrap; } tr:nth-child(even) { @@ -859,37 +860,7 @@ td.actions { } .content { - overflow: hidden; - white-space: nowrap; - padding: 8px; - } - - .copy-button { - margin: 0; - padding: 0; - border-radius: 0; - - .feather { - --icon-size: 20px; - margin: 8px; - } - } -} - -.copyable-text { - display: flex; - flex-direction: row; - margin: 8px; - - background-color: darken($backgroundColor, 2%); - border-radius: 5px; - overflow: hidden; - - .title { - padding: 8px; - } - - .content { + width: 0; flex-grow: 1; overflow: hidden; white-space: nowrap; @@ -939,3 +910,7 @@ td.actions { background: $secondary; } } + +.table-col-grow { + width: 100%; +} From 0f83dd7ad6d3302496769f7fdc2778fe72a41aef Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 30 Mar 2021 12:32:41 +0200 Subject: [PATCH 09/13] layout.scss: add pagination default style --- assets/sass/layout.scss | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/assets/sass/layout.scss b/assets/sass/layout.scss index 4f4124b..66e8363 100644 --- a/assets/sass/layout.scss +++ b/assets/sass/layout.scss @@ -914,3 +914,30 @@ td.actions { .table-col-grow { width: 100%; } + +.pagination { + ul { + display: flex; + flex-direction: row; + list-style: none; + padding: 8px; + + justify-content: center; + + li { + a, &.active, &.ellipsis { + display: block; + min-width: 40px; + height: 40px; + padding: 4px; + + line-height: 32px; + text-align:center; + + &:hover:not(.active):not(.ellipsis) { + background-color: #fff5; + } + } + } + } +} From ceaa0769bcad9c03898709a41e13df3b0d7dff43 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 30 Mar 2021 12:39:40 +0200 Subject: [PATCH 10/13] Upgrade dependencies --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 2eefcc6..f7c65e8 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@typescript-eslint/eslint-plugin": "^4.3.0", "@typescript-eslint/parser": "^4.3.0", "babel-loader": "^8.1.0", - "concurrently": "^5.1.0", + "concurrently": "^6.0.0", "css-loader": "^5.0.0", "eslint": "^7.10.0", "feather-icons": "^4.28.0", @@ -43,14 +43,14 @@ "imagemin-gifsicle": "^7.0.0", "imagemin-mozjpeg": "^9.0.0", "imagemin-pngquant": "^9.0.0", - "imagemin-svgo": "^8.0.0", + "imagemin-svgo": "^9.0.0", "img-loader": "^3.0.1", "jest": "^26.1.0", "maildev": "^1.1.0", "mini-css-extract-plugin": "^1.2.1", "node-sass": "^5.0.0", "nodemon": "^2.0.3", - "sass-loader": "^10.0.1", + "sass-loader": "^11.0.1", "terser-webpack-plugin": "^5.0.3", "ts-jest": "^26.1.1", "ts-loader": "^8.0.4", From 12f82f0f3dcea4d20d4e92b9f7f29069d1c385bb Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 30 Mar 2021 12:44:09 +0200 Subject: [PATCH 11/13] package.json: use NodeJS scripts instead of unix commands --- .eslintrc.json | 1 + package.json | 10 +++++----- scripts/clean.js | 10 ++++++++++ scripts/prepare-sources.js | 4 ++++ 4 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 scripts/clean.js create mode 100644 scripts/prepare-sources.js diff --git a/.eslintrc.json b/.eslintrc.json index cdf57c6..a506e1e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -88,6 +88,7 @@ }, "ignorePatterns": [ "jest.config.js", + "scripts/**/*", "webpack.config.js", "dist/**/*", "public/**/*", diff --git a/package.json b/package.json index f7c65e8..2e8efd7 100644 --- a/package.json +++ b/package.json @@ -8,13 +8,13 @@ "main": "dist/main.js", "scripts": { "test": "jest --verbose --runInBand", - "clean": "(test ! -d dist || rm -r dist)", - "prepareSources": "cp package.json src/", + "clean": "node scripts/clean.js", + "prepare-sources": "node scripts/prepare-sources.js", "compile": "yarn clean && tsc", - "build": "yarn prepareSources && yarn compile && webpack --mode production", - "dev": "yarn prepareSources && concurrently -k -n \"Typescript,Node,Webpack,Maildev\" -p \"[{name}]\" -c \"blue,green,red,yellow\" \"tsc --watch\" \"nodemon\" \"webpack --watch --mode development\" \"maildev\"", + "build": "yarn prepare-sources && yarn compile && webpack --mode production", + "dev": "yarn prepare-sources && concurrently -k -n \"Typescript,Node,Webpack,Maildev\" -p \"[{name}]\" -c \"blue,green,red,yellow\" \"tsc --watch\" \"nodemon\" \"webpack --watch --mode development\" \"maildev\"", "start": "yarn build && node", - "lint": "eslint . --ext .js,.jsx,.ts,.tsx" + "lint": "eslint ." }, "devDependencies": { "@babel/core": "^7.9.0", diff --git a/scripts/clean.js b/scripts/clean.js new file mode 100644 index 0000000..d5ef093 --- /dev/null +++ b/scripts/clean.js @@ -0,0 +1,10 @@ +const fs = require('fs'); + +[ + 'dist', +].forEach(file => { + if (fs.existsSync(file)) { + console.log('Cleaning', file, '...'); + fs.rmSync(file, {recursive: true}); + } +}); diff --git a/scripts/prepare-sources.js b/scripts/prepare-sources.js new file mode 100644 index 0000000..a78c2f3 --- /dev/null +++ b/scripts/prepare-sources.js @@ -0,0 +1,4 @@ +const fs = require('fs'); +const path = require('path'); + +fs.copyFileSync('package.json', path.join('src', 'package.json')); From faa728aacb3b9472ab0844215fc97560b46a3f48 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 30 Mar 2021 14:27:03 +0200 Subject: [PATCH 12/13] layout.scss: allow .form-field to be hidden with .hidden --- assets/sass/layout.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/sass/layout.scss b/assets/sass/layout.scss index 66e8363..3d791fd 100644 --- a/assets/sass/layout.scss +++ b/assets/sass/layout.scss @@ -398,7 +398,7 @@ form { padding: 8px 16px; text-align: center; - .form-field { + .form-field:not(.hidden) { display: flex; flex-direction: column; margin: 16px auto; From d223c9c77f1b6e6f3b5da0cf2c6bb518af80ccd6 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 30 Mar 2021 16:56:35 +0200 Subject: [PATCH 13/13] Update config to new swaf version --- config/default.json5 | 86 +++++++++++++++++++++-------------------- config/production.json5 | 26 ++++++------- 2 files changed, 58 insertions(+), 54 deletions(-) diff --git a/config/default.json5 b/config/default.json5 index e0c6b9b..0afc385 100644 --- a/config/default.json5 +++ b/config/default.json5 @@ -1,43 +1,47 @@ { - app: { - name: 'Example App', - contact_email: 'contact@example.net' - }, - log_level: "DEV", - db_log_level: "ERROR", - public_url: "http://localhost:4899", - public_websocket_url: "ws://localhost:4899", - port: 4899, - mysql: { - connectionLimit: 10, - host: "localhost", - user: "root", - password: "", - database: "example_app", - create_database_automatically: false - }, - redis: { - host: "127.0.0.1", - port: 6379, - prefix: 'example_app' - }, - session: { - cookie: { - secure: false - } - }, - mail: { - host: "127.0.0.1", - port: "1025", - secure: false, - username: "", - password: "", - allow_invalid_tls: true, - from: 'contact@example.net', - from_name: 'Example App', - }, - view: { - cache: false - }, - approval_mode: false, + app: { + name: 'Example App', + contact_email: 'contact@example.net', + }, + log_level: "DEV", + db_log_level: "ERROR", + public_url: "http://localhost:4899", + public_websocket_url: "ws://localhost:4899", + port: 4899, + mysql: { + connectionLimit: 10, + host: "localhost", + user: "root", + password: "", + database: "example_app", + create_database_automatically: false, + }, + redis: { + host: "127.0.0.1", + port: 6379, + prefix: 'example_app', + }, + session: { + cookie: { + secure: false, + }, + }, + mail: { + host: "127.0.0.1", + port: "1025", + secure: false, + username: "", + password: "", + allow_invalid_tls: true, + from: 'contact@example.net', + from_name: 'Example App', + }, + view: { + cache: false, + }, + auth: { + approval_mode: false, + // 30 days + name_change_wait_period: 2592000000, + }, } diff --git a/config/production.json5 b/config/production.json5 index 6993e0e..725329b 100644 --- a/config/production.json5 +++ b/config/production.json5 @@ -1,15 +1,15 @@ { - log_level: "DEBUG", - db_log_level: "ERROR", - public_url: "https://watch-my.stream", - public_websocket_url: "wss://watch-my.stream", - session: { - cookie: { - secure: true - } - }, - mail: { - secure: true, - allow_invalid_tls: false - } + log_level: "DEBUG", + db_log_level: "ERROR", + public_url: "https://watch-my.stream", + public_websocket_url: "wss://watch-my.stream", + session: { + cookie: { + secure: true, + }, + }, + mail: { + secure: true, + allow_invalid_tls: false, + }, }