diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index 7d9a9948..ed8286e5 100644 --- a/.github/workflows/laravel.yml +++ b/.github/workflows/laravel.yml @@ -50,6 +50,35 @@ jobs: working-directory: ./api run: ./vendor/bin/pint --test + client_lint: + runs-on: ubuntu-latest + name: Run client linters + defaults: + run: + working-directory: ./client + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v1 + with: + node-version: "20" + + - uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install npm dependencies + run: npm ci --no-audit --no-progress --silent + + - name: Run ESLint + run: npm run lint + tests: runs-on: ubuntu-latest @@ -199,7 +228,7 @@ jobs: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} production-deploy: - needs: [code_lint, tests, build-nuxt-app] + needs: [code_lint, client_lint, tests, build-nuxt-app] if: success() && github.ref == 'refs/heads/main' && github.event_name == 'push' runs-on: ubuntu-latest name: Triggers Deployment (Vapor & Amplify) diff --git a/client/components/forms/FileInput.vue b/client/components/forms/FileInput.vue index 8615f221..913eadbd 100644 --- a/client/components/forms/FileInput.vue +++ b/client/components/forms/FileInput.vue @@ -285,7 +285,7 @@ export default { src: this.getFileSrc(file) }) this.loading = false - }).catch((error) => { + }).catch(() => { this.loading = false }) } else { @@ -297,7 +297,7 @@ export default { this.loading = false } }) - .catch((error) => { + .catch(() => { this.clearAll() this.loading = false }) diff --git a/client/components/forms/MentionInput.vue b/client/components/forms/MentionInput.vue index 57cc1607..287b4708 100644 --- a/client/components/forms/MentionInput.vue +++ b/client/components/forms/MentionInput.vue @@ -56,7 +56,7 @@ + errorReport += ` And here are technical details about the error: \`\`\`${error.stack}\`\`\`` + try { + crisp.openAndShowChat(errorReport) + crisp.showMessage(`Hi there, we're very sorry to hear you experienced an issue with OpnForm. + We'll be in touch about it very soon! In the meantime, I recommend that you try going back one step, and save your changes.`, 2000) + } catch (e) { + console.error('Crisp error', e) + } +} + \ No newline at end of file diff --git a/client/components/open/forms/components/FormWorkspaceModal.vue b/client/components/open/forms/components/FormWorkspaceModal.vue index 5e487a68..6fc26378 100644 --- a/client/components/open/forms/components/FormWorkspaceModal.vue +++ b/client/components/open/forms/components/FormWorkspaceModal.vue @@ -118,13 +118,4 @@ const onSubmit = () => { loading.value = false }) } - -const isUrl = (str) => { - try { - new URL(str) - } catch (_) { - return false - } - return true -} diff --git a/client/components/open/forms/components/ShareFormUrl.vue b/client/components/open/forms/components/ShareFormUrl.vue index 4205fabb..5fa50ebe 100644 --- a/client/components/open/forms/components/ShareFormUrl.vue +++ b/client/components/open/forms/components/ShareFormUrl.vue @@ -1,30 +1,30 @@ + + diff --git a/client/components/pages/admin/UserWorkspaces.vue b/client/components/pages/admin/UserWorkspaces.vue index 00f58b16..96ad4541 100644 --- a/client/components/pages/admin/UserWorkspaces.vue +++ b/client/components/pages/admin/UserWorkspaces.vue @@ -1,16 +1,16 @@ + +
+ +
+ + \ No newline at end of file diff --git a/client/runtimeConfig.js b/client/runtimeConfig.js index d094fb68..27344286 100644 --- a/client/runtimeConfig.js +++ b/client/runtimeConfig.js @@ -1,11 +1,3 @@ -function parseBoolean(value, defaultValue = false) { - if (typeof value === 'string') { - value = value.toLowerCase().trim() - if (value === 'true' || value === '1') return true - if (value === 'false' || value === '0') return false - } - return defaultValue -} function parseNumber(value, defaultValue = 0) { const parsedValue = parseFloat(value) diff --git a/client/stores/working_form.js b/client/stores/working_form.js index 9a3b2bfb..59f811a9 100644 --- a/client/stores/working_form.js +++ b/client/stores/working_form.js @@ -160,27 +160,6 @@ export const useWorkingFormStore = defineStore("working_form", { this.content.properties.splice(index, 1) } }, - removeField(field) { - this.internalRemoveField(field) - }, - internalRemoveField(field) { - const index = this.objectToIndex(field) - - if (index !== -1) { - useAlert().success('Ctrl + Z to undo',10000,{ - title: 'Field removed', - actions: [{ - label: 'Undo', - icon:"i-material-symbols-undo", - click: () => { - this.undo() - } - }] - }) - this.content.properties.splice(index, 1) - } - }, - moveField(oldIndex, newIndex) { const newFields = clonedeep(this.content.properties) const field = newFields.splice(oldIndex, 1)[0]