Skip to content

Commit

Permalink
Merge pull request #326 from globe-and-citizen/develop
Browse files Browse the repository at this point in the history
Release 1.8
  • Loading branch information
arnonrdp authored Oct 28, 2023
2 parents e98aeee + 0020360 commit e0f95b0
Show file tree
Hide file tree
Showing 16 changed files with 2,918 additions and 1,532 deletions.
13 changes: 7 additions & 6 deletions USER_STORIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ The following user stories should be runnable without error in production.

1. Navigate to https://celebrity-fanalyzer.pages.dev/
2. Navigate to the profile page and choose `SIGN UP`
3. Navigate to the `ADMIN` panel.
4. Chose `New Entry`
3. Navigate to the `SETTINGS PANE` of the profile panel & request access as a writer.
4. (Use a separate Admin account to then grant privileges to the new user.)
5. As the newly created user once again, chose `New Entry`
- Chose the appropriate month prompt
- Add a title
- Write my description
- Add an image
- Submit entry which shows a green `Enstry Successfully Submitted` drop down. The "Edit Entry Dialogue Card" then closes so that I can't re-submit accidentally the same entry.
5. When I navigate to `Search`, and chose the appropriate month prompt, I can see my own entry
6. I `Like` my own entry and see the icon go bold.
7. I `Share` my own entry, and successfully post the link to my `Facebook`.
6. When I navigate to `Search`, and chose the appropriate month prompt, I can see my own entry
7. I `Like` my own entry and see the icon go bold.
8. I `Share` my own entry, and successfully post the link to my `Facebook`.

## Story 2

Expand Down Expand Up @@ -119,4 +120,4 @@ The following user stories should be runnable without error in production.





16 changes: 16 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,22 @@
<meta name="description" content="Celebrities Over Analyzed" />
<meta name="keywords" content="Globe&Citizen, analyze, celebrity, famous, votes, likes, comments, shares, Layer8" />

<!-- Open Graph / Facebook -->
<meta property="og:title" content="CelebrityFanalyzer" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://celebrityfanalyzer.com/" />
<meta property="og:image" content="https://celebrityfanalyzer.com/logo.svg" />
<meta property="og:description" content="Celebrities Over Analyzed" />

<!-- Twitter -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@celebrityfanalyzer" />
<meta name="twitter:url" content="https://celebrityfanalyzer.com/" />
<meta name="twitter:title" content="CelebrityFanalyzer" />
<meta name="twitter:description" content="Celebrities Over Analyzed" />
<meta name="twitter:image" content="https://celebrityfanalyzer.com/logo.svg" />
<meta name="twitter:image:alt" content="CelebrityFanalyzer Logo" />

<!-- Theme / Favicon -->
<link rel="icon" type="image/png" sizes="128x128" href="/favicon-128x128.png" />
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png" />
Expand Down
3,976 changes: 2,501 additions & 1,475 deletions package-lock.json

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,39 @@
},
"dependencies": {
"@originjs/vite-plugin-commonjs": "^1.0.3",
"@quasar/extras": "^1.16.4",
"@quasar/extras": "^1.16.7",
"dotenv": "^16.3.1",
"echarts": "^5.4.2",
"firebase": "^9.23.0",
"pinia": "^2.1.4",
"pinia-plugin-persistedstate": "^3.1.0",
"quasar": "^2.12.2",
"echarts": "^5.4.3",
"firebase": "^10.4.0",
"pinia": "^2.1.6",
"pinia-plugin-persistedstate": "^3.2.0",
"quasar": "^2.12.7",
"secure-ls": "^1.2.6",
"sha1": "^1.1.1",
"vue": "^3.2.47",
"vue-echarts": "^6.6.0",
"vue-router": "^4.2.2"
"vue-echarts": "^6.6.1",
"vue-router": "^4.2.5"
},
"devDependencies": {
"@cypress/code-coverage": "^3.10.8",
"@pinia/testing": "^0.1.2",
"@quasar/app-vite": "^1.4.3",
"@quasar/quasar-app-extension-testing-e2e-cypress": "^5.1.0",
"@quasar/quasar-app-extension-testing-unit-vitest": "^0.3.0",
"@cypress/code-coverage": "^3.12.1",
"@pinia/testing": "^0.1.3",
"@quasar/app-vite": "^1.6.2",
"@quasar/quasar-app-extension-testing-e2e-cypress": "^5.1.1",
"@quasar/quasar-app-extension-testing-unit-vitest": "^0.3.1",
"@vitest/coverage-istanbul": "^0.31.4",
"@vue/test-utils": "^2.4.0",
"autoprefixer": "^10.4.14",
"@vue/test-utils": "^2.4.1",
"autoprefixer": "^10.4.16",
"c8": "^7.14.0",
"cypress": "^12.16.0",
"cypress": "^12.17.4",
"cypress-wait-until": "^1.7.2",
"eslint": "^8.44.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-cypress": "^2.13.3",
"eslint-plugin-vue": "^9.15.1",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-cypress": "^2.15.1",
"eslint-plugin-vue": "^9.17.0",
"jsdom": "^22.1.0",
"postcss": "^8.4.24",
"prettier": "^2.8.8",
"start-server-and-test": "^2.0.0",
"postcss": "^8.4.31",
"prettier": "^3.0.3",
"start-server-and-test": "^2.0.1",
"vitest": "^0.31.4",
"vue-router-mock": "^0.2.0",
"workbox-build": "^6.6.0",
Expand Down
7 changes: 7 additions & 0 deletions public/icons/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 1 addition & 6 deletions src/components/Posts/ThePost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<q-responsive :ratio="1" :style="{ backgroundImage: `url(${post?.image})` }">
<div class="bg-blur flex">
<q-img fit="contain" ratio="1" tspinner-color="primary" :src="post?.image" />
<q-img fit="contain" ratio="1" spinner-color="primary" :src="post?.image" />
</div>
</q-responsive>
<section class="q-pa-md q-pb-none">
Expand Down Expand Up @@ -161,11 +161,6 @@ async function subscribe() {
</script>

<style scoped lang="scss">
.parallax {
position: fixed;
top: 65px;
z-index: -1;
}
// add a blur effect to the background image
.bg-blur {
backdrop-filter: blur(60px);
Expand Down
28 changes: 18 additions & 10 deletions src/components/shared/ItemCard.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<template>
<article class="q-pt-md relative-position row" v-ripple:primary>
<div class="col-8">
<div
<article class="q-pt-md relative-position row">
<div class="col-8 flex column">
<router-link
v-if="item.author"
class="cursor-pointer flex items-center"
@click="router.push(`/fan/${item.author.username || item.author.uid}`)"
>
class="flex items-center link"
:to="`/fan/${item.author.username || item.author.uid}`">
<q-avatar size="2rem">
<q-img v-if="item.author.photoURL" :src="item.author.photoURL" />
<q-img v-else src="/icons/user_raiting_premium_member.svg" :ratio="1" width="28px" />
</q-avatar>
<p class="q-mb-none q-ml-sm text-body1">
{{ item.author.displayName?.length > 20 ? item.author.displayName.substring(0, 20) + '...' : item.author.displayName }}
</p>
</div>
<div class="cursor-pointer" @click="goToUrl()" data-test="item-link">
</router-link>
<router-link class="link " :to="link" data-test="item-link">
<h2 class="q-mb-none text-body1 text-bold">
{{ item.title?.length > 40 ? item.title.substring(0, 40) + '...' : item.title }}
</h2>
Expand All @@ -25,9 +24,11 @@
<div v-if="item.categories">
<q-badge v-for="(item, i) of item.categories" class="q-mx-xs" :key="i" rounded>{{ item }}</q-badge>
</div>
</div>
</router-link>
</div>
<q-img class="col-4 cursor-pointer" :ratio="1" :src="item.image" style="border-radius: 24px" @click="goToUrl()" />
<router-link :to="link" class="col-4 text-primary">
<q-img :ratio="1" :src="item.image" style="border-radius: 24px" @click="goToUrl()" />
</router-link>
<!-- TODO: Add 'Selected for you' and two more buttons according to mockup -->
<q-separator class="full-width q-mt-md" />
</article>
Expand Down Expand Up @@ -58,3 +59,10 @@ function goToUrl() {
router.push(props.link)
}
</script>

<style scoped lang="scss">
.link {
text-decoration: none;
color: black;
}
</style>
19 changes: 14 additions & 5 deletions src/pages/EntryPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,31 @@
</template>

<script setup>
import { useQuasar } from 'quasar'
import TheAnthrogram from 'src/components/Posts/TheAnthrogram.vue'
import TheComments from 'src/components/Posts/TheComments.vue'
import ThePost from 'src/components/Posts/ThePost.vue'
import { useCommentStore, useEntryStore, useErrorStore, useLikeStore, useShareStore } from 'src/stores'
import { useCommentStore, useEntryStore, useErrorStore, useLikeStore, useShareStore, useStatStore } from 'src/stores'
import { startTracking, stopTracking } from 'src/utils/activityTracker'
import { computed, onMounted, onUnmounted, ref, watchEffect } from 'vue'
import { useRouter } from 'vue-router'
import { useQuasar } from 'quasar'
import { onBeforeRouteLeave, useRouter } from 'vue-router'
const router = useRouter()
const $q = useQuasar()
const commentStore = useCommentStore()
const errorStore = useErrorStore()
const entryStore = useEntryStore()
const errorStore = useErrorStore()
const likeStore = useLikeStore()
const shareStore = useShareStore()
const statStore = useStatStore()
const tab = ref(entryStore.tab)
entryStore.fetchEntries().catch((error) => errorStore.throwError(error))
const entry = computed(() => {
return entryStore.getEntries?.find((entry) => router.currentRoute.value.href.includes(entry.slug))
return entryStore.getEntries?.find((entry) => router.currentRoute.value.href.includes(entry.slug))
})
watchEffect(async () => {
Expand All @@ -56,6 +58,7 @@ watchEffect(async () => {
})
onMounted(() => {
startTracking()
if (entryStore.getEntries && !entry.value?.id) {
$q.notify({
type: 'info',
Expand All @@ -72,6 +75,12 @@ onMounted(() => {
}, 6000)
}
})
onBeforeRouteLeave(async () => {
const stats = stopTracking()
await statStore.addStats('entries', entry.value.id, stats)
})
onUnmounted(() => {
entryStore.setTab('post')
})
Expand Down
31 changes: 24 additions & 7 deletions src/pages/IndexPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,28 +154,45 @@
opinion, suggest a topic, or give feedback. We would love to hear from you! Celebrity Fanalyzer is a work in progress. If you want
to get involved in shaping the future of the application, reach out to us via Discord:
</p>
<q-btn flat href="https://discord.gg/z4P3UrhhSH" icon="img:/icons/discord.svg" round size="xl" target="_blank">
<q-btn flat href="https://discord.gg/z4P3UrhhSH" icon="img:/icons/discord.svg" round size="lg" target="_blank">
<q-tooltip anchor="bottom middle" self="center middle">Community on Discord</q-tooltip>
</q-btn>
<q-btn
class="q-mx-md"
flat
href="https://github.com/globe-and-citizen/celebrity-fanalyzer"
icon="img:/icons/github.svg"
round
size="lg"
target="_blank"
>
<q-tooltip anchor="bottom middle" self="center middle">Contribute</q-tooltip>
</q-btn>
<q-btn data-test="terms-of-service-button" flat to="/terms-of-service" icon="local_police" round size="lg">
<q-tooltip anchor="bottom middle" self="center middle">Terms of Service</q-tooltip>
</q-btn>
</section>
</q-page>
</q-page-container>
</template>

<script setup>
import TheHeader from 'src/components/shared/TheHeader.vue'
import { useEntryStore, useErrorStore, usePromptStore, useUserStore } from 'src/stores'
import { currentYearMonth, previousYearMonth } from 'src/utils/date'
import { currentYearMonth } from 'src/utils/date'
import { useEntryStore, useErrorStore, usePromptStore } from 'src/stores'
import { computed, onMounted } from 'vue'
const entryStore = useEntryStore()
const errorStore = useErrorStore()
const promptStore = usePromptStore()
const userStore = useUserStore()
const monthPrompt = computed(() =>
promptStore.getPrompts?.find((prompt) => prompt.id === currentYearMonth() || prompt.id === previousYearMonth())
)
const monthPrompt = computed(() =>{
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
const sortedPrompts = promptStore.getPrompts?.sort((a, b) => a.id - b.id)
return sortedPrompts?.find((prompt) => prompt.id <= currentYearMonth())
})
onMounted(async () => {
await promptStore.fetchPrompts().catch((error) => errorStore.throwError(error))
await entryStore.fetchEntries().catch((error) => errorStore.throwError(error))
Expand Down
86 changes: 86 additions & 0 deletions src/pages/StatsPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<template>
<TheHeader feedbackButton title="Stats" />
<q-page-container style="max-width: none">
<q-page>
<q-table
class="q-ma-md"
:columns="columnsSummary"
hide-bottom
:pagination="pagination"
:rows="rowSummary"
:title="`Summary Data: ${visitors === 1 ? '1 visitor' : `${visitors} visitors`}`"
/>
<q-table
class="q-ma-md"
:columns="columnsDetailed"
hide-bottom
:pagination="pagination"
:rows="statStore.getStats"
:title="`Detailed Data: ${visits === 1 ? '1 visit' : `${visits} visits`}`"
/>
</q-page>
</q-page-container>
</template>

<script setup>
import TheHeader from 'src/components/shared/TheHeader.vue'
import { useEntryStore, useStatStore } from 'src/stores'
import { shortMonthDayTime } from 'src/utils/date'
import { computed, onMounted } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const entryStore = useEntryStore()
const statStore = useStatStore()
const fields = {
clicks: { label: 'Clicks' },
keypresses: { label: 'Keypresses' },
mouseMovements: { label: 'Mouse Movements' },
scrolls: { label: 'Scrolls' },
totalTime: { label: 'Time Spent' }
}
const columnsDetailed = [
{ name: 'created', align: 'center', label: 'Date', field: (row) => shortMonthDayTime(row.created), sortable: true },
...Object.keys(fields).map((fieldName) => ({ name: fieldName, label: fields[fieldName].label, field: fieldName, sortable: true }))
]
const columnsSummary = [
{ name: 'type', align: 'center', label: '', field: 'type', sortable: true },
...Object.keys(fields).map((fieldName) => ({ name: fieldName, label: fields[fieldName].label, field: fieldName, sortable: true }))
]
const entry = computed(() => entryStore.getEntries?.find((entry) => router.currentRoute.value.href.includes(entry.slug)))
const pagination = { sortBy: 'date', descending: true, rowsPerPage: 0 }
const visits = computed(() => statStore.getStats?.length || 0)
const visitors = computed(() => {
const authorIds = new Set(statStore.getStats?.map((stat) => stat.author.id))
return authorIds.size
})
const rowSummary = computed(() => {
const stats = statStore.getStats
if (!stats || stats.length === 0) {
return []
}
const averageRow = { type: 'Average' }
const totalRow = { type: 'Total' }
Object.keys(fields).forEach((field) => {
averageRow[field] = (stats.reduce((acc, stat) => acc + stat[field], 0) / stats.length).toFixed(1)
totalRow[field] = stats.reduce((acc, stat) => acc + stat[field], 0)
})
return [averageRow, totalRow]
})
onMounted(async () => {
if (!entryStore.getEntries.length) {
await entryStore.fetchEntries()
}
await statStore.fetchStats('entries', entry.value.id)
})
</script>
Loading

0 comments on commit e0f95b0

Please sign in to comment.