Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into fix/discover-nav-update
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-liddle authored Oct 4, 2023
2 parents 06df3dc + 049c125 commit f70e075
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 85 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @mozillasocial/web
35 changes: 27 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
46 changes: 0 additions & 46 deletions .github/workflows/docker.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/release.yml

This file was deleted.

14 changes: 13 additions & 1 deletion components/timeline/TimelineDiscover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
}
</script>

<template>
Expand Down Expand Up @@ -48,6 +55,11 @@ function updateUTM(url: string): string {
</div>
<div class="media" relative overflow-hidden max-w-120px min-w-120px>
<img :src="item.imageUrl" rounded-lg overflow-hidden w-full ha>
<div m-y-4px flex flex-justify-end>
<button p-12px text-xl @click="copyLink(updateUTM(item.url), $event)">
<div i-ri:share-line />
</button>
</div>
</div>
</NuxtLink>
</template>
Expand Down
2 changes: 1 addition & 1 deletion composables/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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('/')

Expand Down
4 changes: 2 additions & 2 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion server/api/[server]/recommendations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f70e075

Please sign in to comment.