From 8ed5c729457e5f0f01e2eb025c6f3b7edb298318 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Dec 2022 14:44:54 +0100 Subject: [PATCH] Refactor and redesign client --- .eslintrc.json | 6 +- client/.eslintrc.json | 6 +- client/.gitignore | 1 + client/package.json | 22 +- client/public/img/bottom-peertube-logo-v3.svg | 13 - client/public/img/peertube-logo.svg | 42 - .../public}/img/sepia-search.svg | 0 client/src/components/ActorMiniature.vue | 75 +- client/src/components/ChannelResult.vue | 147 +- client/src/components/Filters.vue | 458 ++++ client/src/components/Footer.vue | 184 +- client/src/components/Header.vue | 109 +- .../components/InterfaceLanguageDropdown.vue | 2 +- client/src/components/Pagination.vue | 56 +- client/src/components/PlaylistResult.vue | 251 +- client/src/components/SafeHTML.vue | 50 + client/src/components/SearchInput.vue | 142 ++ client/src/components/SearchWarning.vue | 50 +- client/src/components/SortButton.vue | 104 + client/src/components/VideoResult.vue | 191 +- client/src/components/icons/IconWarning.vue | 12 + client/src/env.d.ts | 13 +- client/src/main.ts | 33 +- client/src/mixins/CommonMixins.ts | 9 + client/src/models/search-url.model.ts | 8 +- client/src/scss/_bootstrap-mixins.scss | 7 + client/src/scss/_bootstrap-variables.scss | 24 + client/src/scss/_mixins.scss | 8 + client/src/scss/_variables.scss | 29 +- client/src/scss/bootstrap.scss | 51 + client/src/scss/classes.scss | 301 +++ client/src/scss/main.scss | 273 +-- client/src/scss/progress.scss | 10 +- client/src/shared/html-parser.ts | 40 + client/src/shared/search.ts | 42 +- client/src/shared/utils.ts | 46 +- client/src/views/Home.vue | 129 ++ client/src/views/Search.vue | 1166 ++-------- client/tsconfig.json | 2 + client/vite.config.ts | 13 +- client/yarn.lock | 2013 ++++++++--------- config/test.yaml | 1 - package.json | 1 + themes/framasoft/index.css | 37 - yarn.lock | 35 +- 45 files changed, 3029 insertions(+), 3183 deletions(-) delete mode 100644 client/public/img/bottom-peertube-logo-v3.svg delete mode 100644 client/public/img/peertube-logo.svg rename {themes/framasoft => client/public}/img/sepia-search.svg (100%) create mode 100644 client/src/components/Filters.vue create mode 100644 client/src/components/SafeHTML.vue create mode 100644 client/src/components/SearchInput.vue create mode 100644 client/src/components/SortButton.vue create mode 100644 client/src/components/icons/IconWarning.vue create mode 100644 client/src/mixins/CommonMixins.ts create mode 100644 client/src/scss/_bootstrap-mixins.scss create mode 100644 client/src/scss/_bootstrap-variables.scss create mode 100644 client/src/scss/_mixins.scss create mode 100644 client/src/scss/bootstrap.scss create mode 100644 client/src/scss/classes.scss create mode 100644 client/src/shared/html-parser.ts create mode 100644 client/src/views/Home.vue diff --git a/.eslintrc.json b/.eslintrc.json index 57ecfe4..100f593 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -42,7 +42,9 @@ 2, { "SwitchCase": 1, - "MemberExpression": "off" + "MemberExpression": "off", + // https://github.com/eslint/eslint/issues/15299 + "ignoredNodes": ["PropertyDefinition"] } ], "@typescript-eslint/consistent-type-assertions": [ @@ -85,6 +87,8 @@ "@typescript-eslint/no-namespace": "off", "@typescript-eslint/no-empty-interface": "off", "@typescript-eslint/no-extraneous-class": "off", + "@typescript-eslint/prefer-nullish-coalescing": "off", + "@typescript-eslint/consistent-indexed-object-style": "off", // bugged but useful "@typescript-eslint/restrict-plus-operands": "off" }, diff --git a/client/.eslintrc.json b/client/.eslintrc.json index cefaa25..2a0eb10 100644 --- a/client/.eslintrc.json +++ b/client/.eslintrc.json @@ -12,7 +12,11 @@ ], "rules": { "vue/multi-word-component-names": "off", + "vue/max-attributes-per-line": "off", + "vue/html-self-closing": "off", + "vue/singleline-html-element-content-newline": "off", "vue/require-default-prop": "off", - "@typescript-eslint/no-explicit-any": "off" + "vue/html-indent": "off", + "vue/multiline-html-element-content-newline": "off" } } diff --git a/client/.gitignore b/client/.gitignore index 57db099..d25625b 100644 --- a/client/.gitignore +++ b/client/.gitignore @@ -1,2 +1,3 @@ src/locale/**/*~ dist/ +stats.html diff --git a/client/package.json b/client/package.json index 45594de..44c8561 100644 --- a/client/package.json +++ b/client/package.json @@ -12,25 +12,29 @@ }, "dependencies": {}, "devDependencies": { + "@babel/types": "^7.20.5", + "@popperjs/core": "^2.11.6", "@sipec/vue3-tags-input": "^3.0.4", "@types/axios": "^0.14.0", "@types/markdown-it": "^12.2.3", "@typescript-eslint/eslint-plugin": "^5.12.1", "@typescript-eslint/parser": "^5.12.1", - "@vitejs/plugin-vue": "^2.2.2", - "@vue/eslint-config-typescript": "^10.0.0", - "axios": "^0.26.0", + "@vitejs/plugin-vue": "^4.0.0", + "@vue/eslint-config-typescript": "^11.0.2", + "axios": "^1.2.1", + "bootstrap": "^5.2.3", "eslint": "^8.9.0", - "eslint-plugin-vue": "^8.5.0", - "markdown-it": "^12.3.2", + "eslint-plugin-vue": "^9.8.0", + "markdown-it": "^13.0.1", "nprogress": "^0.2.0", + "rollup-plugin-visualizer": "^5.8.3", "sass": "^1.49.8", - "typescript": "~4.5.5", - "vite": "^2.8.4", + "typescript": "~4.9.4", + "vite": "^4.0.1", "vue": "^3.2.31", "vue-matomo": "^4.1.0", "vue-router": "^4.0.12", - "vue-tsc": "^0.31.4", - "vue3-gettext": "2.2.0-alpha.1" + "vue-tsc": "^1.0.13", + "vue3-gettext": "2.3.4" } } diff --git a/client/public/img/bottom-peertube-logo-v3.svg b/client/public/img/bottom-peertube-logo-v3.svg deleted file mode 100644 index c078291..0000000 --- a/client/public/img/bottom-peertube-logo-v3.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - Peertube_V3_logo Copy - - - - - - - - - - \ No newline at end of file diff --git a/client/public/img/peertube-logo.svg b/client/public/img/peertube-logo.svg deleted file mode 100644 index 59452dc..0000000 --- a/client/public/img/peertube-logo.svg +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/themes/framasoft/img/sepia-search.svg b/client/public/img/sepia-search.svg similarity index 100% rename from themes/framasoft/img/sepia-search.svg rename to client/public/img/sepia-search.svg diff --git a/client/src/components/ActorMiniature.vue b/client/src/components/ActorMiniature.vue index 50d8245..15a47a3 100644 --- a/client/src/components/ActorMiniature.vue +++ b/client/src/components/ActorMiniature.vue @@ -1,34 +1,20 @@ - diff --git a/client/src/components/ChannelResult.vue b/client/src/components/ChannelResult.vue index 06538e6..11df3ee 100644 --- a/client/src/components/ChannelResult.vue +++ b/client/src/components/ChannelResult.vue @@ -1,55 +1,42 @@ - diff --git a/client/src/components/Footer.vue b/client/src/components/Footer.vue index 5d601a0..1b57d34 100644 --- a/client/src/components/Footer.vue +++ b/client/src/components/Footer.vue @@ -1,84 +1,19 @@ @@ -104,115 +39,18 @@ diff --git a/client/src/components/InterfaceLanguageDropdown.vue b/client/src/components/InterfaceLanguageDropdown.vue index 096824a..bb265fd 100644 --- a/client/src/components/InterfaceLanguageDropdown.vue +++ b/client/src/components/InterfaceLanguageDropdown.vue @@ -96,7 +96,7 @@ padding: .5rem 0; position: absolute; text-align: left; - font-size: 14px; + font-size: 0.875rem; a { text-decoration: none; diff --git a/client/src/components/Pagination.vue b/client/src/components/Pagination.vue index 1131d8c..17f1d7c 100644 --- a/client/src/components/Pagination.vue +++ b/client/src/components/Pagination.vue @@ -1,74 +1,62 @@