From f9f549beace4f76480c8cbf1e91d8940a0aeef2b Mon Sep 17 00:00:00 2001 From: Zack Krida Date: Fri, 21 Jan 2022 00:44:57 -0500 Subject: [PATCH] All results grid (#618) * Update figma links in README * Search results title (#577) * Fix ci tests by restoring scopedSlots param in search results title spec * Fix search result title casing * Updated load more button (#578) * Update `content-types` test with load more button changes * VHeader (#488) * Add VHeader stub Rename VSearchBar and VSearchButton and move to VHeader Add VLogoLoader to VHeader and adjust header styles * Extract search route handling into composable, set Logo loading when fetching * Update pnpm lockfile * Add VFilterButton (#489) Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com> Co-authored-by: Zack Krida * Add searchbar to header (#491) Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com> Co-authored-by: Zack Krida * Update references to `InputField` to point to `VInputField` (#586) * New 404 page (#583) Co-authored-by: Krystle Salazar Co-authored-by: Zack Krida Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com> Co-authored-by: Dhruv Bhanushali Co-authored-by: Krystle Salazar * Fix video tab The media store query.mediaType is null for video, so it's not possible to use it as a key to look up results in the store * Fix filters e2e tests by opening the sidebar * Fix openverse.pot after-merge problems * Fix e2e tests * Show a generated artwork when the audio thumbnail is absent (#600) * Fix single result back links * Fix photo detail test * Fix photo-details test * Combine layouts into a single default (#599) * Add header icons (#604) * Fix error when `` dimensions are negative (#605) * Default to all from the homepage; init * Add `VContentLink` component (#560) Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com> Co-authored-by: Olga Bulat * Prevent unsupported media types causing header errors * Better video tab fix * Fix homepage test * Remove sample audio data (#571) * Modify "fetchState" mutations to support ALL_MEDIA * All_MEDIA state working except for SET_MEDIA * all media state init * UI suppoort for media count * wip * ugh * Mobile box layout adjustments * Fix image clicks * Content links * Add debugging comment * Remove dead code * Result rounded corners * Update src/utils/srand.js * Focus states * Small styling improvements to image grid title and horizontal spacing * Refactor fetching for all media (#621) * Refactor all fetching to use getters more * Disable failing tests * Revert index/key rename in image cell v-for Co-authored-by: Zack Krida * Add a wrapper to FETCH_MEDIA to simplify fetching all content (#640) Add a wrapper to FETCH_MEDIA to simplify fetching all content * Double number of skeleton boxes * Progress * Remove unused filter display component * Set query when using filters * Fix tests * truncate audio box text Co-authored-by: Krystle Salazar Co-authored-by: Olga Bulat Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com> Co-authored-by: Dhruv Bhanushali Co-authored-by: Krystle Salazar --- nuxt.config.js | 6 + package.json | 6 +- pnpm-lock.yaml | 16 ++ src/components/ImageGrid/ImageCell.vue | 2 +- src/components/ImageGrid/ImageGrid.vue | 7 +- src/components/SearchGridCell.vue | 2 +- src/components/SearchTypeTabs.vue | 5 +- src/components/SearchTypeToggle.vue | 17 +- src/components/Skeleton/GridSkeleton.vue | 9 +- .../VAllResultsGrid/VAllResultsGrid.vue | 158 ++++++++++++++ src/components/VAllResultsGrid/VAudioCell.vue | 38 ++++ src/components/VAllResultsGrid/VImageCell.vue | 77 +++++++ src/components/VAudioTrack/VAudioTrack.vue | 31 ++- .../VAudioTrack/layouts/VBoxLayout.vue | 11 +- src/components/VContentLink/VContentLink.vue | 53 +---- .../VContentLink/meta/VContentLink.stories.js | 3 +- src/components/VFilters/VFilterDisplay.vue | 37 ---- src/components/VFilters/VSearchGridFilter.vue | 32 ++- src/components/VHeader/VHeader.vue | 32 +-- src/components/VHeader/VHeaderMenu.vue | 41 +++- src/components/VHeroSection.vue | 15 +- src/components/VImageGrid/VImageCell.vue | 92 -------- src/components/VSearchGrid.vue | 48 ++--- src/composables/use-load-more.js | 21 +- src/constants/action-types.js | 2 + src/locales/en.json | 3 +- src/locales/po-files/openverse.pot | 18 +- src/pages/index.vue | 6 +- src/pages/search.vue | 81 ++----- src/pages/search/audio.vue | 45 ++-- src/pages/search/image.vue | 9 +- src/pages/search/index.vue | 13 +- src/store/media.js | 203 +++++++++++++----- src/store/search.js | 49 ++--- src/store/types.d.ts | 2 + src/utils/env.js | 2 - src/utils/prepare-search-query-params.js | 6 +- src/utils/search-query-transform.js | 8 +- src/utils/srand.js | 30 +++ tailwind.config.js | 2 +- .../__snapshots__/filter-display.spec.js.snap | 33 --- .../specs/components/filter-display.spec.js | 41 ---- .../specs/components/hero-section.spec.js | 2 +- .../specs/components/search-grid-cell.spec.js | 2 +- .../components/search-grid-filter.spec.js | 2 + .../unit/specs/components/search-grid.spec.js | 2 +- .../specs/components/v-content-link.spec.js | 4 +- test/unit/specs/store/media-store.spec.js | 24 +-- test/unit/specs/store/search-store.spec.js | 4 +- 49 files changed, 782 insertions(+), 570 deletions(-) create mode 100644 src/components/VAllResultsGrid/VAllResultsGrid.vue create mode 100644 src/components/VAllResultsGrid/VAudioCell.vue create mode 100644 src/components/VAllResultsGrid/VImageCell.vue delete mode 100644 src/components/VFilters/VFilterDisplay.vue delete mode 100644 src/components/VImageGrid/VImageCell.vue create mode 100644 src/utils/srand.js delete mode 100644 test/unit/specs/components/__snapshots__/filter-display.spec.js.snap delete mode 100644 test/unit/specs/components/filter-display.spec.js diff --git a/nuxt.config.js b/nuxt.config.js index b621a54cde..0d9ccc9d97 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -208,6 +208,12 @@ export default { autoprefixer: {}, }, }, + // Enables use of IDE debuggers + extend(config, ctx) { + if (ctx.isDev) { + config.devtool = ctx.isClient ? 'source-map' : 'inline-source-map' + } + }, }, storybook: { port: 6006, // standard port for Storybook diff --git a/package.json b/package.json index acc9809f8e..63a070faf6 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "author": "sebworks", "private": true, "scripts": { - "dev": "pnpm i18n:create-locales-list && pnpm i18n:update-locales && cross-env ENABLE_AUDIO=true nuxt", + "dev": "pnpm i18n:create-locales-list && pnpm i18n:update-locales && cross-env nuxt", "build": "pnpm i18n:get-translations && nuxt build", "generate": "nuxt generate", "start": "nuxt start", @@ -22,7 +22,7 @@ "test:watch": "jest --collectCoverage=false --watch", "test:unit": "jest --collectCoverage=false", "test:e2e": "playwright test", - "run-server": "cross-env ENABLE_AUDIO=true nuxt build && pnpm start", + "run-server": "cross-env nuxt build && pnpm start", "e2e:ci": "start-server-and-test run-server http://localhost:8443 test:e2e", "generate-e2e-tests": "playwright codegen localhost:8443/", "types": "tsc --noEmit", @@ -48,6 +48,7 @@ "@nuxtjs/sitemap": "^2.4.0", "@nuxtjs/svg": "^0.3.0", "@popperjs/core": "^2.11.2", + "@tailwindcss/line-clamp": "^0.3.1", "axios": "^0.21.2", "axios-mock-adapter": "^1.20.0", "babel-core": "^7.0.0-bridge.0", @@ -72,6 +73,7 @@ "node-html-parser": "^5.1.0", "nuxt": "^2.15.4", "reakit-utils": "^0.15.2", + "seeded-rand": "^2.0.1", "uuid": "^8.3.2", "vue-i18n": "^8.26.5" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9c2b12b016..e428053b7a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,6 +18,7 @@ specifiers: '@nuxtjs/svg': ^0.3.0 '@playwright/test': ^1.16.2 '@popperjs/core': ^2.11.2 + '@tailwindcss/line-clamp': ^0.3.1 '@testing-library/jest-dom': ^5.16.1 '@testing-library/user-event': ^13.2.1 '@testing-library/vue': ^5.8.2 @@ -65,6 +66,7 @@ specifiers: reakit-utils: ^0.15.2 sass: ^1.34.0 sass-loader: ^10.1.1 + seeded-rand: ^2.0.1 start-server-and-test: ^1.14.0 tailwindcss: ^3.0.7 tailwindcss-rtl: ^0.8.0 @@ -86,6 +88,7 @@ dependencies: '@nuxtjs/sitemap': 2.4.0 '@nuxtjs/svg': 0.3.0 '@popperjs/core': 2.11.2 + '@tailwindcss/line-clamp': 0.3.1_tailwindcss@3.0.9 axios: 0.21.4 axios-mock-adapter: 1.20.0_axios@0.21.4 babel-core: 7.0.0-bridge.0 @@ -110,6 +113,7 @@ dependencies: node-html-parser: 5.1.0 nuxt: 2.15.8_typescript@4.5.4 reakit-utils: 0.15.2 + seeded-rand: 2.0.1 uuid: 8.3.2 vue-i18n: 8.26.7 @@ -5323,6 +5327,14 @@ packages: - webpack-command dev: true + /@tailwindcss/line-clamp/0.3.1_tailwindcss@3.0.9: + resolution: {integrity: sha512-pNr0T8LAc3TUx/gxCfQZRe9NB2dPEo/cedPHzUGIPxqDMhgjwNm6jYxww4W5l0zAsAddxr+XfZcqttGiFDgrGg==} + peerDependencies: + tailwindcss: '>=2.0.0 || >=3.0.0 || >=3.0.0-alpha.1' + dependencies: + tailwindcss: 3.0.9_67faf65efc23bbcb8667813493b8c465 + dev: false + /@testing-library/dom/7.31.2: resolution: {integrity: sha512-3UqjCpey6HiTZT92vODYLPxTBWlM8ZOOjr3LX5F37/VRipW2M1kX6I/Cm4VXzteZqfGfagg8yXywpcOgQBlNsQ==} engines: {node: '>=10'} @@ -15901,6 +15913,10 @@ packages: resolution: {integrity: sha512-M9gnWtn3J0W+UhJOHmBxBTwv8mZCan5i1Himp60t6vvZcor0wr+IM0URKmIglsWJ7bRujNAVVN77fp+uZaWoKg==} dev: false + /seeded-rand/2.0.1: + resolution: {integrity: sha512-OoNSbS3HH7tFIcE3zsn9BkyfjV6Of4L8b0HZU69WiqOQsMTXBTe83MNnIxmgTx9ABmOoTBhPwst+SN96twgDvA==} + dev: false + /select/1.1.2: resolution: {integrity: sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=} dev: false diff --git a/src/components/ImageGrid/ImageCell.vue b/src/components/ImageGrid/ImageCell.vue index d717a25849..3c79aa36a5 100644 --- a/src/components/ImageGrid/ImageCell.vue +++ b/src/components/ImageGrid/ImageCell.vue @@ -115,7 +115,7 @@ export default { if (!event.metaKey && !event.ctrlKey) { event.preventDefault() const detailRoute = this.localeRoute({ - name: 'photo-detail-page', + name: 'PhotoDetailPage', params: { id: image.id, location: window.scrollY }, }) this.$router.push(detailRoute) diff --git a/src/components/ImageGrid/ImageGrid.vue b/src/components/ImageGrid/ImageGrid.vue index df1a8d2714..d5b369d2af 100644 --- a/src/components/ImageGrid/ImageGrid.vue +++ b/src/components/ImageGrid/ImageGrid.vue @@ -1,9 +1,12 @@