-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add GereralContentPage * feat: typo * feat: add cypress test * feat: add nested test * feat: refactor general content pages * fix: Add parent data for generalcontent page to be used in navbreadcrumb component * fix: trying preview url * fix: remove preview urls and update the package.json * test: will add nested path after craft pr is merged which will fix the path issue in the data * test: svg icon menu not found error Co-authored-by: pghorpade <pghorpade@library.ucla.edu>
- Loading branch information
1 parent
e733f8e
commit 0848c2e
Showing
8 changed files
with
138 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
describe("General Content page", () => { | ||
it("Visits a General Content Page", () => { | ||
cy.visit("/privacy-terms-of-use") | ||
cy.get(".logo-ucla").should("be.visible") | ||
cy.get("h1.title").should("contain", "Privacy & Terms of Use") | ||
cy.percySnapshot({ widths: [768, 992, 1200] }) | ||
}) | ||
|
||
it("Visits a Nested General Content Page", () => { | ||
/*cy.visit("/accessibility/emergency") | ||
cy.get(".logo-ucla").should("be.visible") | ||
cy.get("h1.title").should("contain", "Emergency") | ||
cy.percySnapshot({ widths: [768, 992, 1200] })*/ | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#import "~/gql/fragments/Image" | ||
#import "~/gql/fragments/collections/AllFpb" | ||
|
||
query GeneralContentDetail($slug: [String!]) { | ||
entry(section: "generalContentPage", slug: $slug) { | ||
... on generalContentPage_generalContentPage_Entry { | ||
id | ||
title | ||
slug | ||
uri | ||
summary | ||
heroImage { | ||
... on heroImage_heroImage_BlockType { | ||
id | ||
image { | ||
...Image | ||
} | ||
} | ||
} | ||
} | ||
parent { | ||
slug | ||
title | ||
} | ||
...AllFpb | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<template lang="html"> | ||
<main | ||
id="main" | ||
class="page page-general-content" | ||
> | ||
<nav-breadcrumb | ||
v-if="page" | ||
:title="page.title" | ||
class="breadcrumb" | ||
/> | ||
<banner-text | ||
v-if="page && (!page.heroImage || page.heroImage.length == 0)" | ||
class="banner-text" | ||
:category="page.format" | ||
:title="page.title" | ||
:text="page.summary" | ||
/> | ||
|
||
<section-wrapper class="section-banner"> | ||
<banner-header | ||
v-if="page && page.heroImage && page.heroImage.length == 1" | ||
:image="page.heroImage[0].image[0]" | ||
:category="page.format" | ||
:title="page.title" | ||
:text="page.summary" | ||
/> | ||
</section-wrapper> | ||
|
||
<section-wrapper theme="divider"> | ||
<divider-way-finder | ||
class="divider-way-finder" | ||
color="visit" | ||
/> | ||
</section-wrapper> | ||
|
||
<flexible-blocks | ||
v-if="page" | ||
class="flexible-content" | ||
:blocks="page.blocks" | ||
/> | ||
</main> | ||
</template> | ||
|
||
<script> | ||
// GQL | ||
import GENERAL_CONTENT_DETAIL from "~/gql/queries/GeneralContentDetail" | ||
// Helpers | ||
import _get from "lodash/get" | ||
export default { | ||
async asyncData({ $graphql, params }) { | ||
// Do not remove testing live preview | ||
const data = await $graphql.default.request(GENERAL_CONTENT_DETAIL, { | ||
slug: params.pathMatch.substring( | ||
params.pathMatch.lastIndexOf("/") + 1 | ||
), | ||
}) | ||
return { | ||
page: _get(data, "entry", {}), | ||
} | ||
}, | ||
head() { | ||
let title = this.page ? this.page.title : "... loading" | ||
return { | ||
title: title, | ||
} | ||
}, | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.page-general-content { | ||
.banner-text, | ||
.banner-header { | ||
--color-theme: var(--color-visit-fushia-03); | ||
} | ||
::v-deep .divider-way-finder { | ||
--color-border: var(--color-visit-fushia-03); | ||
} | ||
.section-banner { | ||
margin-top: 0; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0848c2e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π Published on https://uclalibrary-test.library.ucla.edu as production
π Deployed on https://631b6487ae51bb2128873b23--uclalibrary-test.netlify.app
0848c2e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π Published on https://uclalibrary.library.ucla.edu as production
π Deployed on https://631bdb605fa5954f57ff8dda--uclalibrary.netlify.app