diff --git a/config/config.exs b/config/config.exs index 7ef1b213c..3651b9d6a 100644 --- a/config/config.exs +++ b/config/config.exs @@ -365,6 +365,14 @@ config :mobilizon, Mobilizon.Service.Pictures.Unsplash, app_name: "Mobilizon", access_key: nil +config :mobilizon, :search, global: [is_default_search: false, is_enabled: true] + +config :mobilizon, Mobilizon.Service.GlobalSearch, + service: Mobilizon.Service.GlobalSearch.SearchMobilizon + +config :mobilizon, Mobilizon.Service.GlobalSearch.SearchMobilizon, + endpoint: "https://search.joinmobilizon.org" + # Import environment specific config. This must remain at the bottom # of this file so it overrides the configuration defined above. import_config "#{config_env()}.exs" diff --git a/js/.eslintrc.js b/js/.eslintrc.js index 96907e6d5..c2b3c63fa 100644 --- a/js/.eslintrc.js +++ b/js/.eslintrc.js @@ -11,7 +11,7 @@ module.exports = { extends: [ "eslint:recommended", "plugin:vue/vue3-essential", - "@vue/eslint-config-typescript", + "@vue/eslint-config-typescript/recommended", "plugin:prettier/recommended", "@vue/eslint-config-prettier", ], @@ -24,12 +24,11 @@ module.exports = { }, rules: { - "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", "no-underscore-dangle": [ "error", { - allow: ["__typename"], + allow: ["__typename", "__schema"], }, ], "@typescript-eslint/no-explicit-any": "off", diff --git a/js/.gitignore b/js/.gitignore index e8b645d0b..5c5176c48 100644 --- a/js/.gitignore +++ b/js/.gitignore @@ -24,3 +24,6 @@ yarn-error.log* *.njsproj *.sln *.sw? +/test-results/ +/playwright-report/ +/playwright/.cache/ diff --git a/js/get_union_json.ts b/js/get_union_json.ts index 287cc9982..9a36881d1 100644 --- a/js/get_union_json.ts +++ b/js/get_union_json.ts @@ -1,5 +1,5 @@ -const fetch = require("node-fetch"); -const fs = require("fs"); +import fetch from "node-fetch"; +import fs from "fs"; fetch(`http://localhost:4000/api`, { method: "POST", diff --git a/js/package.json b/js/package.json index 60a992e05..94dc34c15 100644 --- a/js/package.json +++ b/js/package.json @@ -51,6 +51,7 @@ "@vue-leaflet/vue-leaflet": "^0.6.1", "@vue/apollo-composable": "^4.0.0-alpha.17", "@vue/compiler-sfc": "^3.2.37", + "@vueuse/core": "^9.1.0", "@vueuse/head": "^0.7.9", "@vueuse/router": "^9.0.2", "@xiaoshuapp/draggable": "^4.1.0", @@ -93,6 +94,7 @@ "devDependencies": { "@histoire/plugin-vue": "^0.10.0", "@intlify/vite-plugin-vue-i18n": "^6.0.0", + "@playwright/test": "^1.25.1", "@rushstack/eslint-patch": "^1.1.4", "@tailwindcss/forms": "^0.5.2", "@tailwindcss/typography": "^0.5.4", diff --git a/js/playwright.config.ts b/js/playwright.config.ts new file mode 100644 index 000000000..c3da6c26e --- /dev/null +++ b/js/playwright.config.ts @@ -0,0 +1,107 @@ +import type { PlaywrightTestConfig } from "@playwright/test"; +import { devices } from "@playwright/test"; + +/** + * Read environment variables from file. + * https://github.com/motdotla/dotenv + */ +// require('dotenv').config(); + +/** + * See https://playwright.dev/docs/test-configuration. + */ +const config: PlaywrightTestConfig = { + testDir: "./tests/e2e", + /* Maximum time one test can run for. */ + timeout: 30 * 1000, + expect: { + /** + * Maximum time expect() should wait for the condition to be met. + * For example in `await expect(locator).toHaveText();` + */ + timeout: 5000, + }, + /* Run tests in files in parallel */ + fullyParallel: true, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? 1 : undefined, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: "html", + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ + actionTimeout: 0, + /* Base URL to use in actions like `await page.goto('/')`. */ + baseURL: "http://localhost:4005", + + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: "on-first-retry", + }, + + /* Configure projects for major browsers */ + projects: [ + { + name: "chromium", + use: { + ...devices["Desktop Chrome"], + }, + }, + + { + name: "firefox", + use: { + ...devices["Desktop Firefox"], + }, + }, + + // { + // name: 'webkit', + // use: { + // ...devices['Desktop Safari'], + // }, + // }, + + /* Test against mobile viewports. */ + // { + // name: 'Mobile Chrome', + // use: { + // ...devices['Pixel 5'], + // }, + // }, + // { + // name: 'Mobile Safari', + // use: { + // ...devices['iPhone 12'], + // }, + // }, + + /* Test against branded browsers. */ + // { + // name: 'Microsoft Edge', + // use: { + // channel: 'msedge', + // }, + // }, + // { + // name: 'Google Chrome', + // use: { + // channel: 'chrome', + // }, + // }, + ], + + /* Folder for test artifacts such as screenshots, videos, traces, etc. */ + // outputDir: 'test-results/', + + /* Run your local dev server before starting the tests */ + // webServer: { + // command: 'npm run start', + // port: 3000, + // }, +}; + +export default config; diff --git a/js/src/assets/logo.svg b/js/public/img/logo.svg similarity index 100% rename from js/src/assets/logo.svg rename to js/public/img/logo.svg diff --git a/js/src/App.vue b/js/src/App.vue index f6d844c87..175d22d41 100644 --- a/js/src/App.vue +++ b/js/src/App.vue @@ -32,17 +32,17 @@ diff --git a/js/src/components/Settings/SettingMenuSection.vue b/js/src/components/Settings/SettingMenuSection.vue index 091f45be5..173839567 100644 --- a/js/src/components/Settings/SettingMenuSection.vue +++ b/js/src/components/Settings/SettingMenuSection.vue @@ -1,5 +1,7 @@