diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000000..67691ffc41 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @mozillasocial/web \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6795c0a1f9..00ebeaf7b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,16 @@ -name: ci +name: CI Build Checks permissions: {} on: push: - branches: - - main + branches: [main] pull_request: - branches: - - main - workflow_dispatch: {} + types: [opened, synchronize] jobs: ci: + name: Lint & Test runs-on: ubuntu-latest steps: @@ -34,6 +32,27 @@ jobs: - name: 📝 Lint run: pnpm lint + # Mozilla.Social changes have errors with this check, disabling for now. + # - name: 💪 Type check + # run: pnpm test:typecheck - - name: 💪 Type check - run: pnpm test:typecheck + docker-build: + name: Build Docker Image + timeout-minutes: 15 + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and export to Docker + uses: docker/build-push-action@v5 + with: + context: . + load: true + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 1d8fe5651d..0000000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: build & push docker container -on: - push: - branches: - - main - tags: - - '*' - pull_request: - branches: - - main -jobs: - docker: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Docker meta - id: metal - uses: docker/metadata-action@v4 - with: - images: | - ghcr.io/${{ github.repository }} - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ github.token }} - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - platforms: linux/amd64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.metal.outputs.tags }} - labels: ${{ steps.metal.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index be3094214c..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Release - -permissions: - contents: write - -on: - push: - tags: - - 'v*' - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Set node - uses: actions/setup-node@v3 - with: - node-version: 18 - - - run: npx changelogithub - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/components/timeline/TimelineDiscover.vue b/components/timeline/TimelineDiscover.vue index 08cf417183..6380d50cb0 100644 --- a/components/timeline/TimelineDiscover.vue +++ b/components/timeline/TimelineDiscover.vue @@ -5,7 +5,7 @@ import { getLanguageForRecs } from '../../utils/language' const { locale: lang } = useI18n() const locale = getLanguageForRecs(lang.value) -const recommendations: Recommendation[] = await $fetch(`/api/:server/recommendations?locale=${locale}`) +const recommendations: Recommendation[] = await $fetch(`/api/${publicServer.value}/recommendations?locale=${locale}`) // Shorten a string to less than maxLen characters without truncating words. function shorten(str: string, maxLen: number): string { @@ -18,6 +18,13 @@ function shorten(str: string, maxLen: number): string { function updateUTM(url: string): string { return url.replace('pocket-newtab', 'mozilla') } + +const clipboard = useClipboard() +async function copyLink(url, event) { + event.preventDefault() + if (url) + await clipboard.copy(url) +} diff --git a/composables/users.ts b/composables/users.ts index 7b47f487e8..891a939655 100644 --- a/composables/users.ts +++ b/composables/users.ts @@ -321,7 +321,7 @@ export async function signOut() { method: 'DELETE', // This requires https://github.com/MozillaSocial/mastodon/pull/38 on the Mastodon instance } await fetch(signOutUrl, fetchOptions).then(r => r.json()) - + if (!currentUserHandle.value) await useRouter().push('/') diff --git a/locales/en.json b/locales/en.json index a8923a045d..a3aee0f094 100644 --- a/locales/en.json +++ b/locales/en.json @@ -549,8 +549,8 @@ "label": "Featured hashtags" }, "fxa_settings": { - "description": "Change your password and Firefox account preferences", - "label": "Firefox account settings" + "description": "Change your password and account preferences", + "label": "Account settings" }, "label": "Profile", "moso_settings": { diff --git a/server/api/[server]/recommendations.ts b/server/api/[server]/recommendations.ts index e037c770f4..d6ca5aec64 100644 --- a/server/api/[server]/recommendations.ts +++ b/server/api/[server]/recommendations.ts @@ -3,7 +3,7 @@ export default defineEventHandler(async (event) => { const { locale } = getQuery(event) const recommendations = await fetch( - `https://firefox-api-proxy.readitlater.com/desktop/v1/recommendations?consumer_key=moso-web-dev&locale=${locale}`, + `https://mozilla.social/content-feed/moso/v1/discover?locale=${locale}`, ) .then(response => response.json()) .then(response => response.data)