Skip to content

Commit

Permalink
Remove CC referral banner
Browse files Browse the repository at this point in the history
  • Loading branch information
obulat committed Jul 18, 2023
1 parent 1753a73 commit 3f5ff38
Show file tree
Hide file tree
Showing 24 changed files with 14 additions and 452 deletions.
1 change: 0 additions & 1 deletion frontend/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ const config: NuxtConfig = {
{ path: "~/components", extensions: ["vue"], pathPrefix: false },
],
plugins: [
"~/plugins/migration-notice.ts",
"~/plugins/ua-parse.ts",
"~/plugins/focus-visible.client.ts",
"~/plugins/api-token.server.ts",
Expand Down
19 changes: 4 additions & 15 deletions frontend/src/components/VBanner/VBanners.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<template>
<div>
<div v-show="showBanners" class="flex flex-col gap-2 p-2 pb-0">
<VMigrationNotice
v-if="shouldShowMigrationBanner"
:variant="variant"
@close="dismissBanner('cc-referral')"
/>
<VAnalyticsNotice
v-if="shouldShowAnalyticsBanner"
:variant="variant"
Expand All @@ -32,16 +27,13 @@ import type { TranslationBannerId, BannerId } from "~/types/banners"
export default defineComponent({
name: "VBanners",
components: {
VMigrationNotice: () => import("~/components/VBanner/VMigrationNotice.vue"),
VTranslationStatusBanner: () =>
import("~/components/VBanner/VTranslationStatusBanner.vue"),
VAnalyticsNotice: () => import("~/components/VBanner/VAnalyticsNotice.vue"),
},
setup() {
const uiStore = useUiStore()
const shouldShowMigrationBanner = computed(
() => uiStore.shouldShowMigrationBanner
)
const shouldShowTranslationBanner = computed(
() => uiStore.shouldShowTranslationBanner
)
Expand All @@ -63,16 +55,13 @@ export default defineComponent({
}
const showBanners = computed(() =>
[
shouldShowMigrationBanner,
shouldShowTranslationBanner,
shouldShowAnalyticsBanner,
].some((item) => item.value)
[shouldShowTranslationBanner, shouldShowAnalyticsBanner].some(
(item) => item.value
)
)
return {
translationBannerId,
shouldShowMigrationBanner,
shouldShowTranslationBanner,
shouldShowAnalyticsBanner,
showBanners,
Expand Down
39 changes: 0 additions & 39 deletions frontend/src/components/VBanner/VMigrationNotice.vue

This file was deleted.

6 changes: 0 additions & 6 deletions frontend/src/locales/scripts/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -648,12 +648,6 @@
arrowLabel: "Dropdown",
},
},
migrationNotice: {
intro: "{ccSearch} is now called {openverse} and joins {wordpress} as an open source project.",
more: "{readMore} about this announcement.",
read: "Read more",
close: "Close the announcement",
},
downloadButton: {
aria: {
dropdownLabel: "Select the download file format",
Expand Down
9 changes: 0 additions & 9 deletions frontend/src/middleware/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useNavigationStore } from "~/stores/navigation"
import { useProviderStore } from "~/stores/provider"
import { useFeatureFlagStore } from "~/stores/feature-flag"
import { useUiStore } from "~/stores/ui"
Expand Down Expand Up @@ -26,14 +25,6 @@ const middleware: Middleware = async ({
query,
$pinia,
}: Context) => {
/* Nav store */

const navigationStore = useNavigationStore($pinia)

if (process.client && navigationStore.isReferredFromCc) {
navigationStore.setIsReferredFromCc(false)
}

/* Provider store */
const providerStore = useProviderStore($pinia)
await providerStore.fetchMediaProviders()
Expand Down
18 changes: 0 additions & 18 deletions frontend/src/plugins/migration-notice.ts

This file was deleted.

21 changes: 0 additions & 21 deletions frontend/src/stores/navigation.ts

This file was deleted.

13 changes: 0 additions & 13 deletions frontend/src/stores/ui.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { defineStore } from "pinia"

import { useNavigationStore } from "~/stores/navigation"

import type { OpenverseCookieState, SnackbarState } from "~/types/cookies"
import type { BannerId, TranslationBannerId } from "~/types/banners"

Expand Down Expand Up @@ -110,17 +108,6 @@ export const useUiStore = defineStore("ui", {
needsTranslationBanner(this.currentLocale)
)
},
/**
* The migration banner is shown if the user is referred from CC Search,
* and hasn't dismissed it yet.
*/
shouldShowMigrationBanner(): boolean {
const navigationStore = useNavigationStore()
return (
!this.dismissedBanners.includes("cc-referral") &&
navigationStore.isReferredFromCc
)
},
/**
* The analytics banner is shown if the user hasn't dismissed it yet.
*/
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/types/banners.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LocaleObject } from "@nuxtjs/i18n"

export type TranslationBannerId = `translation-${LocaleObject["code"]}`
export type BannerId = TranslationBannerId | "cc-referral" | "analytics"
export type BannerId = TranslationBannerId | "analytics"
60 changes: 0 additions & 60 deletions frontend/src/utils/pinia-state.ts

This file was deleted.

33 changes: 0 additions & 33 deletions frontend/src/utils/send-message.ts

This file was deleted.

Loading

0 comments on commit 3f5ff38

Please sign in to comment.