Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Rename meta search page and all code #1868

Merged
merged 14 commits into from
Oct 3, 2022
7 changes: 2 additions & 5 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,8 @@ const config: NuxtConfig = {
*/
redirect: {
rules: [
{
from: '^/photos/(.*)$',
to: '/image/$1',
statusCode: 301,
},
{ from: '^/photos/(.*)$', to: '/image/$1', statusCode: 301 },
{ from: '/meta-search', to: '/external-sources', statusCode: 301 },
zackkrida marked this conversation as resolved.
Show resolved Hide resolved
],
// If the URL cannot be decoded, we call next() to show the client-side error page.
onDecodeError: (
Expand Down
Binary file removed src/assets/screenshots/supported.png
Binary file not shown.
Binary file removed src/assets/screenshots/unsupported.png
Binary file not shown.
6 changes: 3 additions & 3 deletions src/components/VErrorSection/VNoResults.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
>
{{ $t('no-results.alternatives') }}
</h2>
<VMetaSourceList class="mt-4 md:mt-6" :type="type" :query="query" />
<VExternalSourceList class="mt-4 md:mt-6" :type="type" :query="query" />
</div>
</template>

Expand All @@ -18,11 +18,11 @@ import { defineComponent, PropType } from '@nuxtjs/composition-api'
import type { MediaType } from '~/constants/media'
import type { ApiQueryParams } from '~/utils/search-query-transform'
import VMetaSourceList from '~/components/VMetaSearch/VMetaSourceList.vue'
import VExternalSourceList from '~/components/VExternalSearch/VExternalSourceList.vue'
export default defineComponent({
name: 'VNoResults',
components: { VMetaSourceList },
components: { VExternalSourceList },
props: {
type: {
type: String as PropType<MediaType>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,38 @@
<section
:key="type"
ref="sectionRef"
class="meta-search flex flex-row place-items-center justify-center p-4"
data-testid="meta-search-form"
class="external-sources flex flex-row place-items-center justify-center p-4"
data-testid="external-sources-form"
@keydown.tab.exact="handleTab"
>
<i18n
v-if="!hasNoResults && isSupported"
path="meta-search.form.supported-title"
path="external-sources.form.supported-title"
tag="p"
class="text-base font-normal leading-[130%]"
/>

<i18n
v-else-if="!hasNoResults && !isSupported"
path="meta-search.form.unsupported-title"
path="external-sources.form.unsupported-title"
tag="p"
class="text-base font-normal leading-[130%]"
>
<template #openverse>Openverse</template>
<template #type>{{ $t(`meta-search.form.types.${type}`) }}</template>
<template #type>{{ $t(`external-sources.form.types.${type}`) }}</template>
</i18n>

<i18n
v-else
path="meta-search.form.no-results-title"
path="external-sources.form.no-results-title"
tag="p"
class="text-base font-normal leading-[130%]"
>
<template #type>{{ $t(`meta-search.form.types.${type}`) }}</template>
<template #type>{{ $t(`external-sources.form.types.${type}`) }}</template>
<template #query>{{ query.q }}</template>
</i18n>

<VMetaSourceList
<VExternalSourceList
class="inline-flex ms-2 md:justify-center"
:type="type"
:query="query"
Expand All @@ -54,12 +54,12 @@ import type { ApiQueryParams } from '~/utils/search-query-transform'
import { getFocusableElements } from '~/utils/focus-management'
import { defineEvent } from '~/types/emits'
import VMetaSourceList from './VMetaSourceList.vue'
import VExternalSourceList from './VExternalSourceList.vue'
export default defineComponent({
name: 'VMetaSearchForm',
name: 'VExternalSearchForm',
components: {
VMetaSourceList,
VExternalSourceList,
},
props: {
query: { type: Object as PropType<ApiQueryParams>, required: true },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<VPopover
ref="sourceListPopover"
class="flex items-stretch"
:label="$t('meta-search.button').toString()"
:label="$t('external-sources.button').toString()"
placement="top-start"
>
<template #trigger="{ a11yProps }">
Expand All @@ -13,7 +13,7 @@
variant="tertiary"
size="disabled"
class="caption-regular justify-between py-1 px-3 text-dark-charcoal pe-2"
>{{ $t('meta-search.button').toString() }}
>{{ $t('external-sources.button').toString() }}
<VIcon
class="text-dark-charcoal-40 ms-1"
:class="a11yProps['aria-expanded'] ? 'rotate-180' : 'rotate-0'"
Expand All @@ -36,10 +36,10 @@
@click="close"
/>
<h2 class="description-bold mb-2 px-4 pt-5 text-start">
{{ $t('meta-search.title') }}
{{ $t('external-sources.title') }}
</h2>
<p class="caption-regular mb-4 px-4 text-start">
{{ $t('meta-search.caption', { openverse: 'Openverse' }) }}
{{ $t('external-sources.caption', { openverse: 'Openverse' }) }}
</p>
<VButton
v-for="source in sources"
Expand Down Expand Up @@ -84,7 +84,7 @@ import closeSmallIcon from '~/assets/icons/close-small.svg'
* when there are insufficient or zero search results.
*/
export default defineComponent({
name: 'VMetaSourceList',
name: 'VExternalSourceList',
components: { VButton, VIcon, VIconButton, VPopover },
props: {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ import {
Story,
} from '@storybook/addon-docs'

import VMetaSourceList from '~/components/VMetaSearch/VMetaSourceList.vue'
import VExternalSourceList from '~/components/VExternalSearch/VExternalSourceList.vue'

<Meta title="Components/VMetaSourceList" component={VMetaSourceList} />
<Meta title="Components/VExternalSourceList" component={VExternalSourceList} />

export const Template = (args) => ({
template: `<VMetaSourceList v-bind="args"/>`,
components: { VMetaSourceList },
template: `<VExternalSourceList v-bind="args"/>`,
components: { VExternalSourceList },
setup() {
return { args }
},
})

# VMetaSourceList
# VExternalSourceList

<Description of={VMetaSourceList} />
<Description of={VExternalSourceList} />

<ArgsTable of={VMetaSourceList} />
<ArgsTable of={VExternalSourceList} />

## Images

Expand Down
6 changes: 3 additions & 3 deletions src/components/VSearchGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<slot name="media" />

<VMetaSearchForm
<VExternalSearchForm
:type="metaSearchFormType"
:has-no-results="hasNoResults"
:query="query"
Expand All @@ -43,7 +43,7 @@ import { defineEvent } from '~/types/emits'
import type { ApiQueryParams } from '~/utils/search-query-transform'
import type { FetchState } from '~/models/fetch-state'
import VMetaSearchForm from '~/components/VMetaSearch/VMetaSearchForm.vue'
import VExternalSearchForm from '~/components/VExternalSearch/VExternalSearchForm.vue'
import VErrorSection from '~/components/VErrorSection/VErrorSection.vue'
import VErrorImage from '~/components/VErrorSection/VErrorImage.vue'
import VNoResults from '~/components/VErrorSection/VNoResults.vue'
Expand All @@ -53,7 +53,7 @@ export default defineComponent({
name: 'VSearchGrid',
components: {
VErrorSection,
VMetaSearchForm,
VExternalSearchForm,
VErrorImage,
VNoResults,
VSearchResultsTitle,
Expand Down
6 changes: 3 additions & 3 deletions src/composables/use-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ export default function usePages(isNew = false) {
link: app.localePath('/search-help'),
},
{
id: 'meta-search',
name: 'header.meta-search-nav-item',
link: app.localePath('/meta-search'),
id: 'external-sources',
name: 'header.external-sources-nav-item',
link: app.localePath('/external-sources'),
},
{
id: 'feedback',
Expand Down
39 changes: 20 additions & 19 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"about-nav-item": "Our Story",
"source-nav-item": "Sources",
"search-guide-nav-item": "Search Guide",
"meta-search-nav-item": "Meta Search",
"external-sources-nav-item": "External Sources",
"privacy-nav-item": "Privacy",
"feedback-nav-item": "Feedback",
"support-nav-item": "Support Us",
Expand Down Expand Up @@ -81,7 +81,7 @@
},
"planning": {
"content": "Currently {openverse} only searches images, with search for audio and video provided through {meta}. But we plan to add additional media types such as open texts and audio, with the ultimate goal of providing access to all 1.4 billion CC licensed and public domain works on the web. All of our code is open source ({frontend}, {api}, {catalog}) and we {community}. You can see what {working}.",
"meta": "Meta Search",
"meta": "External Sources",
"frontend": "{openverse} frontend",
"api": "{openverse} API",
"catalog": "{openverse} Catalog",
Expand Down Expand Up @@ -130,42 +130,43 @@
"audio": "Audio Sources"
}
},
"meta-search-page": {
"title": "Meta Search",
"external-sources-page": {
"title": "External Sources",
"intro": "{openverse} is built on top of a catalog that indexes CC-licensed and public domain content from selected sources. Learn more about our {link}.",
"link": "sources",
"license": "The internet is a big place! There are plenty of search portals and collections, hosting CC-licensed and public domain content, which we aren’t able to index or surface results from within the {openverse} interface. These are important sources of CC-licensed and public domain content, and we want to make sure that you are able to find the best openly licensed materials possible, regardless of where they are located.",
"content": "What content types can I search for using the Meta Search feature?",
"content-types": "Meta Search on {openverse} currently supports image, audio, and video search on external sites.",
"link": "sources here",
"license": "However, there are many sources of CC-licensed and public domain media which we aren’t able to surface results from within the {openverse} interface yet. This might be because they do not offer a public API, or that our contributors have not yet had time to integrate them into Openverse. These are valued sources and we want to make sure that you are able to find the best openly licensed materials possible, regardless of where they are located.",
"use": " Use ",
"images": {
"title": "How does the Meta Search feature work for indexed media types?",
"demo-label": "Layout of Meta Search for indexed media type, like images",
"title": "How does the External Sources feature work for indexed media types?",
"demo-label": "Layout of External Sources for indexed media type, like images",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since "External Sources" is so generic (unlike "Meta Search" which was a proper feature name) maybe we should quote it when using in sentences.

"content": "{openverse} supports built-in search for some media types, such as images. When you enter a query on the {openverse} homepage, a page of results will be displayed. Scrolling to the bottom of the page, you have two choices:",
"continue": "{load-more}, and continue browsing in {openverse}.",
"not-finding": "See the section “{not-finding}” below the results.",
"info": "The “{not-finding}” section lists other sources of CC-licensed and public domain content. Your search query will be preloaded, and if supported, you can select a {use} filter to proactively filter your results. Click on the button for the external source you’d like to search, and your results will open in a new tab."
},
"audio-video": {
"title": "How does the Meta Search feature work for non-indexed media types?",
"demo-label": "Layout of Meta Search for non-indexed media type, like video",
"title": "How does the External Sources feature work for non-indexed media types?",
"demo-label": "Layout of External Sources for non-indexed media type, like video",
"content": "{openverse} does not yet support built-in search for some media types, such as videos. For these media types, click on the appropriate tab and you’ll see sources where you can find CC-licensed content.",
"filter": "The Filters bar on the left includes the {use} filter, which may be supported by some meta search sources. Apply these before clicking on the button for the external source you’d like to search."
"filter": "The Filters bar on the left includes the {use} filter, which may be supported by some external Sources sources. Apply these before clicking on the button for the external source you’d like to search."
},
"new": {
"title": "Can I suggest new sources for Meta Search?",
"title": "Can I suggest new sources for External Sources?",
zackkrida marked this conversation as resolved.
Show resolved Hide resolved
"content": "Yes, please! Create an {issue} in our GitHub repository or send us an {email} and tell us about the new sources you’d like to see included.",
"issue": "issue",
"email": "email"
},
"why": {
"title": "Why did you build this?",
"content": "For many years, CC has offered its users a dedicated search portal for searching platforms that have CC licensing filters built in. These platforms included Europeana, Google Images, Flickr, Jamendo, Open Clip Art Library, SpinXpress, Wikimedia Commons, YouTube, ccMixter, and SoundCloud. The search experience looked like this:",
"new": "For users of the legacy CC Meta Search site, the Meta Search feature on {openverse} will look familiar. The goal was to ensure that the functionality is not lost, but is updated and embedded within our new search engine for openly licensed content. In addition, the Meta Search feature builds on this functionality, allowing us to quickly add new sources to Meta Search as we discover them, and support new content types in the future, as we expand.",
"content": "For many years, Creative Commons has offered its users a dedicated search portal for searching platforms that have CC licensing filters built in. In fact, this is still maintained at {old}.",
"old": "oldsearch.creativecommons.org",
"new": "For users of the legacy CC Meta Search site, the External Sources feature on {openverse} will look familiar. The goal was to ensure that the functionality is not lost, but is updated and embedded within our new search engine for openly licensed content. In addition, the External Sources feature builds on this functionality, allowing us to quickly add new sources to External Sources as we discover them, and support new content types in the future, as we expand.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking for this PR, but I think this statement is probably not true since we've removed the filters from the External Sources.

"aria-label": "feedback",
"feedback-suggestions": "We hope you enjoy, and if you have suggestions for improvement, leave us {feedback}.",
"feedback-link": "feedback"
}
},
"relationships": "This functionality also allows us to start conversations and build relationships with sources that may like to be included in {openverse} in the future. Finally, we can also offer external sources of media types we do not include in {openverse} yet, but plan to.",
"explanation": "You can find links to external sources at the bottom of every {openverse} search results page; on pages for searches which return no results; and on pages for media types we do not yet support but intend to."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"explanation": "You can find links to external sources at the bottom of every {openverse} search results page; on pages for searches which return no results; and on pages for media types we do not yet support but intend to."
"explanation": "You can find links to external sources at the bottom of every {openverse} search results page, on pages for searches which return no results, and on pages for media types we do not yet support but intend to."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would comma be better here?

},
"search-guide": {
"title": "{openverse} Syntax Guide",
Expand Down Expand Up @@ -542,7 +543,7 @@
"right": "→"
}
},
"meta-search": {
"external-sources": {
"caption": "{openverse} can not guarantee the accuracy of license information. Always verify that the work is actually under a CC license.",
"button": "Source list",
"title": "External sources",
Expand Down Expand Up @@ -687,7 +688,7 @@
},
"footer": {
"wordpress-affiliation": "Powered by {wordpress}",
"wip": "\uD83D\uDEA7"
"wip": "🚧"
zackkrida marked this conversation as resolved.
Show resolved Hide resolved
},
"language": {
"language": "Language"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/about.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<i18n path="about.planning.content" tag="p">
<template #openverse>Openverse</template>
<template #meta>
<VLink href="/meta-search">{{ $t('about.planning.meta') }}</VLink>
<VLink href="/external-sources">{{ $t('about.planning.meta') }}</VLink>
</template>
<template #frontend>
<VLink href="https://github.com/wordpress/openverse-frontend/">{{
Expand Down
Loading