diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 971a12e2e9..83797626ca 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## ⚑️ 1.8.6 - Implementation of VueX [PR: #271](https://github.com/Lissy93/dashy/pull/271) +- New state management pattern, which should lead to a more organized code base long term, and will also make building out the new UI editor significantly easier to do in a clean and reliable way + ## πŸ’„ 1.8.5 - Lots of Requested UI Improvements [PR #261](https://github.com/Lissy93/dashy/pull/261) - Adds an option for landing URL in workspace, Re: #255 - Switches to a new API for generative icons, Re: #163 diff --git a/.github/pr-badge.yml b/.github/pr-badge.yml index c32c37c35b..ae49e97a1f 100644 --- a/.github/pr-badge.yml +++ b/.github/pr-badge.yml @@ -1,5 +1,5 @@ -# Config file for pull-request-badge. See: https://pullrequestbadge.com/ -# Enables badges to be inserted into the PR description, based on certain conditions +# Config file for pull-request-badge. See: https://pullrequestbadge.com/ by @stefanbuck +# Dynamically inserts status badges into PR description, based on certain conditions # Checks if the required sections are missing - label: "⚠️Missing" @@ -23,21 +23,43 @@ color: "#f25265" when: "$labels.length == 0" -# Show note when in draft mode +# Show note when task list has unfinished items +- label: "⚠️Notice" + message: "Unchecked Tasks" + when: "$payload.pull_request.body.includes('- [ ] ')" + color: "#f25265" + +# Show badge indicating PR status - label: "Status" - message: "Draft" + message: "✏️ Draft" when: "$isDraft" color: "#ffa933" +- label: "Status" + message: "🧱 Work in Progress" + when: "$payload.pull_request.title.includes('WIP')" + color: "#29e3f4" +- label: "Status" + message: "βœ… Ready" + color: "#3ef963" + when: "$labels.includes('πŸ”€ Ready for Merge')" # Add size label based on very large or tiny PRs +- label: "PR Size" + message: "Extra Large" + color: "#f9833e" + when: "$additions > 1000" - label: "PR Size" message: "Large" - color: "#f79c47" - when: "$additions > 600" + color: "#f4b546" + when: "$additions > 500 && $additions < 1000" +- label: "PR Size" + message: "Medium" + color: "#f3ff59" + when: "$additions > 10 && $additions < 500" - label: "PR Size" message: "Quick" color: "#3eef8b" - when: "$additions < 5" + when: "$additions < 10" # Show PR number, to destination and from destination - label: "#$prNumber" @@ -57,7 +79,7 @@ when: "$payload.pull_request.author_association !== 'OWNER'" url: "https://github.com/$payload.pull_request.user.login" -# Show a badge indicating the PR category +# Show a badge indicating the PR category, based on tag - label: "Type" message: "✨ Feature" color: "#39b0fd" @@ -90,3 +112,34 @@ message: "🌟 Showcase Addition" color: "#39b0fd" when: "$labels.includes('πŸ’― Showcase')" +- label: "Type" + message: "πŸ—οΈ Architecture" + color: "#39b0fd" + when: "$labels.includes('πŸ—οΈ Architectural Changes')" +- label: "Type" + message: "πŸ€– Auto Submission" + color: "#39b0fd" + when: "$labels.includes('πŸ€– Auto')" +- label: "Type" + message: "🌐 Language Update" + color: "#39b0fd" + when: "$labels.includes('🌐 Language')" + +# Show warning, when certain tags are applied +- label: "Warning" + message: "β›” Do Not Merge" + color: "#f25265" + when: "$labels.includes('β›” Don't Merge')" +- label: "Warning" + message: "🚫 Merge Conflicts" + color: "#f25265" + when: "$labels.includes('🚫 Merge Conflicts')" +- label: "Warning" + message: "πŸ•ΈοΈ Inactive" + color: "#f25265" + when: "$labels.includes('πŸ•ΈοΈ Inactive')" +- label: "Warning" + message: "πŸ’€ Spam" + color: "#f25265" + when: "$labels.includes('πŸ’€ Spam')" + diff --git a/.github/pr-branch-labeler.yml b/.github/pr-branch-labeler.yml index 0a7732e3fe..c01da9934b 100644 --- a/.github/pr-branch-labeler.yml +++ b/.github/pr-branch-labeler.yml @@ -1,10 +1,11 @@ # PR labels and the branch patterns they should be auto-assigned to - -πŸ¦‹ Bug Fix: ['FIX/*', 'HOT-FIX/*', 'BUG-FIX/*'] -✨ New Feature: ['FEATURE/*'] +✨ New Feature: ['FEATURE/*', 'FEAT/*'] 🚚 Refactor: ['IMPROVMENTS/*', 'REFACTOR/*'] -πŸ’― Showcase: ['SHOWCASE/*'] -πŸ’„ Stylistic Changes: ['STYLES/*', 'THEME/*'] -πŸ› οΈ Build Changes: ['ARCH/*', 'ARCHITECTURE/*', 'DOCKER/*', 'BUILD/*'] +πŸ¦‹ Bug Fix: ['FIX/*', 'HOT-FIX/*', 'BUG-FIX/*'] +πŸ’― Showcase: ['SHOWCASE/*', 'SHOWCASE_SUBMISSION/*'] +πŸ’„ Stylistic Changes: ['STYLES/*', 'THEME/*', 'UI/*'] +πŸ—οΈ Architectural Changes: ['ARCH/*', 'ARCHITECTURE/*'] +πŸ› οΈ Build Changes: ['DOCKER/*', 'BUILD/*', 'CI/*', 'ACTIONS/*'] +🌐 Language: ['LANG/*', 'INTERNATIONALIZATION/*', 'I18N/*', 'TEXT-UPDATE/*'] πŸ€– Auto: ['AUTO/*', 'BOT/*', 'snyk-upgrade-*', 'snyk-fix-*'] β›” Don't Merge: ['WEBSITE/*', 'EXPERIMENT/*', 'DEPLOY/*', 'deploy_*', 'gh-pages', 'dev-demo'] \ No newline at end of file diff --git a/.github/workflows/docs-link-checker.yml b/.github/workflows/docs-link-checker.yml index 023bc5a9da..527b5af915 100644 --- a/.github/workflows/docs-link-checker.yml +++ b/.github/workflows/docs-link-checker.yml @@ -4,7 +4,7 @@ on: repository_dispatch: workflow_dispatch: schedule: - - cron: '0 1 * * 0' # At 01:00 on Sunday. + - cron: '0 1 1 * *' # Run monthly jobs: link-checker: runs-on: ubuntu-latest @@ -14,7 +14,7 @@ jobs: - name: Check for Broken Links uses: lycheeverse/lychee-action@v1.0.8 with: - args: --verbose --no-progress **/*.md **/*.html + args: --verbose -a 200,302,304,429 --no-progress **/*.md **/*.html env: GITHUB_TOKEN: ${{secrets.BOT_GITHUB_TOKEN}} LYCHEE_OUT: .github/broken-link-report.md diff --git a/.github/workflows/manage-pending-labels.yml b/.github/workflows/manage-pending-labels.yml index 1ab5fd6ac5..465dc9efb3 100644 --- a/.github/workflows/manage-pending-labels.yml +++ b/.github/workflows/manage-pending-labels.yml @@ -19,7 +19,7 @@ jobs: add-awaiting-author: runs-on: ubuntu-latest - if: ${{ github.event.comment.author_association != 'COLLABORATOR' && github.event.comment.author_association != 'OWNER' }} + if: ${{ !github.event.issue.pull_request && github.event.comment.author_association != 'COLLABORATOR' && github.event.comment.author_association != 'OWNER' }} steps: - name: Add Awaiting Author labels when Updated uses: actions-cool/issues-helper@v2 diff --git a/package.json b/package.json index dfa8622667..538c617f37 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Dashy", - "version": "1.8.5", + "version": "1.8.6", "license": "MIT", "main": "server", "scripts": { @@ -39,7 +39,8 @@ "vue-router": "^3.0.3", "vue-select": "^3.12.1", "vue-swatches": "^2.1.1", - "vue-toasted": "^1.1.28" + "vue-toasted": "^1.1.28", + "vuex": "^3.6.2" }, "devDependencies": { "@architect/sandbox": "^3.7.4", diff --git a/src/App.vue b/src/App.vue index cb34b125e9..d9619e04b9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,10 +11,9 @@ import Header from '@/components/PageStrcture/Header.vue'; import Footer from '@/components/PageStrcture/Footer.vue'; import LoadingScreen from '@/components/PageStrcture/LoadingScreen.vue'; -import { componentVisibility } from '@/utils/ConfigHelpers'; -import ConfigAccumulator from '@/utils/ConfigAccumalator'; import { welcomeMsg } from '@/utils/CoolConsole'; import ErrorHandler from '@/utils/ErrorHandler'; +import Keys from '@/utils/StoreMutations'; import { localStorageKeys, splashScreenTime, @@ -22,10 +21,6 @@ import { language as defaultLanguage, } from '@/utils/defaults'; -const Accumulator = new ConfigAccumulator(); -const config = Accumulator.config(); -const visibleComponents = componentVisibility(config.appConfig) || defaultVisibleComponents; - export default { name: 'app', components: { @@ -33,17 +28,9 @@ export default { Footer, LoadingScreen, }, - provide: { - config, - visibleComponents, - }, data() { return { isLoading: true, // Set to false after mount complete - showFooter: visibleComponents.footer, - appConfig: Accumulator.appConfig(), - pageInfo: Accumulator.pageInfo(), - visibleComponents, }; }, computed: { @@ -55,6 +42,24 @@ export default { shouldShowSplash() { return (this.visibleComponents || defaultVisibleComponents).splashScreen; }, + config() { + return this.$store.state.config; + }, + appConfig() { + return this.$store.getters.appConfig; + }, + pageInfo() { + return this.$store.getters.pageInfo; + }, + sections() { + return this.$store.getters.pageInfo; + }, + visibleComponents() { + return this.$store.getters.visibleComponents; + }, + }, + created() { + this.$store.dispatch('initializeConfig'); }, methods: { /* Injects the users custom CSS as a style tag */ @@ -103,6 +108,7 @@ export default { /* Fetch or detect users language, then apply it */ applyLanguage() { const language = this.getLanguage(); + this.$store.commit(Keys.SET_LANGUAGE, language); this.$i18n.locale = language; document.getElementsByTagName('html')[0].setAttribute('lang', language); }, diff --git a/src/components/Configuration/AppVersion.vue b/src/components/Configuration/AppVersion.vue index 973cbb4f69..c0c8f0dec5 100644 --- a/src/components/Configuration/AppVersion.vue +++ b/src/components/Configuration/AppVersion.vue @@ -36,7 +36,11 @@ import ErrorHandler from '@/utils/ErrorHandler'; export default { name: 'AppInfoModal', - inject: ['config'], + computed: { + appConfig() { + return this.$store.getters.appConfig; + }, + }, data() { return { appVersion: process.env.VUE_APP_VERSION, // Current version, from package.json @@ -50,8 +54,7 @@ export default { }; }, mounted() { - const appConfig = this.config.appConfig || {}; - if (!this.appVersion || (appConfig && appConfig.disableUpdateChecks)) { + if (!this.appVersion || (this.appConfig && this.appConfig.disableUpdateChecks)) { // Either current version isn't found, or user disabled checks this.checksEnabled = false; } else { diff --git a/src/components/Configuration/RebuildApp.vue b/src/components/Configuration/RebuildApp.vue index 5bcefdf005..725ee091e6 100644 --- a/src/components/Configuration/RebuildApp.vue +++ b/src/components/Configuration/RebuildApp.vue @@ -55,7 +55,11 @@ import { modalNames, serviceEndpoints } from '@/utils/defaults'; export default { name: 'RebuildApp', - inject: ['config'], + computed: { + appConfig() { + return this.$store.getters.appConfig; + }, + }, components: { Button, RebuildIcon, @@ -112,12 +116,8 @@ export default { }, }, mounted() { - if (this.config) { - if (this.config.appConfig) { - if (this.config.appConfig.allowConfigEdit === false) { - this.allowRebuild = false; - } - } + if (this.appConfig.allowConfigEdit === false) { + this.allowRebuild = false; } }, }; diff --git a/src/components/LinkItems/ContextMenu.vue b/src/components/LinkItems/ContextMenu.vue index 68349c24cd..4d66e2e316 100644 --- a/src/components/LinkItems/ContextMenu.vue +++ b/src/components/LinkItems/ContextMenu.vue @@ -1,6 +1,6 @@ diff --git a/src/components/MinimalView/MinimalSection.vue b/src/components/MinimalView/MinimalSection.vue index d4d3aac78a..60a69326e0 100644 --- a/src/components/MinimalView/MinimalSection.vue +++ b/src/components/MinimalView/MinimalSection.vue @@ -26,7 +26,6 @@ :ref="`iframeModal-${groupId}`" :name="`iframeModal-${groupId}`" @closed="$emit('itemClicked')" - @modalChanged="modalChanged" /> @@ -37,7 +36,6 @@ import IframeModal from '@/components/LinkItems/IframeModal.vue'; export default { name: 'ItemGroup', - inject: ['config'], props: { groupId: String, title: String, @@ -50,6 +48,11 @@ export default { selected: Boolean, showAll: Boolean, }, + computed: { + appConfig() { + return this.$store.getters.appConfig; + }, + }, components: { Item, IframeModal, @@ -66,15 +69,12 @@ export default { triggerModal(url) { this.$refs[`iframeModal-${this.groupId}`].show(url); }, - modalChanged(changedTo) { - this.$emit('change-modal-visibility', changedTo); - }, shouldEnableStatusCheck(itemPreference) { - const globalPreference = this.config.appConfig.statusCheck || false; + const globalPreference = this.appConfig.statusCheck || false; return itemPreference !== undefined ? itemPreference : globalPreference; }, getStatusCheckInterval() { - let interval = this.config.appConfig.statusCheckInterval; + let interval = this.appConfig.statusCheckInterval; if (!interval) return 0; if (interval > 60) interval = 60; if (interval < 1) interval = 0; diff --git a/src/components/PageStrcture/Header.vue b/src/components/PageStrcture/Header.vue index 6fb4679e3b..d17a41f4f5 100644 --- a/src/components/PageStrcture/Header.vue +++ b/src/components/PageStrcture/Header.vue @@ -1,5 +1,5 @@