Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleaning up search filter names between EDU and WWW #587

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
<script lang="ts">
// @ts-nocheck
import isEqual from 'lodash/isEqual.js'
import { mapStores } from 'pinia'
import { useThemeStore } from '../../store/theme'
import { lookupContentType } from './../../utils/lookupContentType'

export default {
Expand Down Expand Up @@ -99,6 +101,7 @@ export default {
}
},
computed: {
...mapStores(useThemeStore),
// to sync both ways parent <--> child
// ensures accurate filter visual state when using URL query strings
filterByHandler: {
Expand Down Expand Up @@ -156,7 +159,10 @@ export default {
}
},
prettyFilterNames(key) {
const name = lookupContentType(key, 'model', 'label')
let name = lookupContentType(key, 'model', 'label')
if (this.themeStore.isEdu && name) {
name = name.replace('EDU ', '')
}
return name ? name : key
}
}
Expand Down
34 changes: 19 additions & 15 deletions packages/vue/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,63 +162,67 @@ export const contentTypes: contentTypeObject[] = [
},
{
model: 'edu_information_pages.EDUContentPage',
label: 'Information Pages'
label: 'EDU Information Pages'
},
{
model: 'edu_news.EDUNewsIndexPage',
label: 'News Index'
label: 'EDU News Index'
},
{
model: 'edu_events.EDUEventsIndexPage',
label: 'Events Index'
label: 'EDU Events Index'
},
{
model: 'edu_events.EDUEventPage',
label: 'Events'
label: 'EDU Events'
},
{
model: 'edu_news.EDUNewsPage',
label: 'News'
label: 'EDU News'
},
{
model: 'edu_resources.EDUExplainerArticlePage',
label: 'Explainer Articles'
label: 'EDU Explainer Articles'
},
{
model: 'edu_resources.EDUResourceLibraryIndexPage',
label: 'Resource Library Index'
label: 'EDU Resource Library Index'
},
{
model: 'edu_resources.EDULessonPage',
label: 'Lesson Plans'
label: 'EDU Lesson Plans'
},
{
model: 'edu_resources.EDUStudentProjectPage',
label: 'EDU Student Projects'
},
{
model: 'edu_resources.EDUTeachableMomentPage',
label: 'Teachable Moments'
label: 'EDU Teachable Moments'
},
{
model: 'edu_resources.EDUCollectionsDetailPage',
label: 'Collections'
label: 'EDU Collections'
},
{
model: 'edu_resources.EDUGalleryDetailPage',
label: 'Galleries'
label: 'EDU Galleries'
},
{
model: 'edu_resources.EDUImageDetailPage',
label: 'Images'
label: 'EDU Images'
},
{
model: 'edu_resources.EDUInfographicDetailPage',
label: 'Infographics'
label: 'EDU Infographics'
},
{
model: 'edu_resources.EDUDocumentDetailPage',
label: 'Documents'
label: 'EDU Documents'
},
{
model: 'edu_resources.EDUVideoDetailPage',
label: 'Videos'
label: 'EDU Videos'
}
]

Expand Down
Loading