-
Notifications
You must be signed in to change notification settings - Fork 19
Allow customization on homepage and footer #922
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
Open
ChengShi-1
wants to merge
5
commits into
develop
Choose a base branch
from
791-allow-customization-of-the-homepage-remove-harvard-specific-content
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
25c8117
feat: add customization on homepage and footer
ChengShi-1 9693495
fix: footer and usage
ChengShi-1 e00f434
fix: copilot reviews on usage.tsx
ChengShi-1 c6601f2
Merge branch 'develop' into 791-allow-customization-of-the-homepage-r…
ChengShi-1 47bd8db
feat: add usage unit tests
ChengShi-1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "copyright": "Copyright © {{year}}, The President & Fellows of Harvard College | ", | ||
| "copyright": "Copyright © {{year}}, {{copyrightHolder}}", | ||
| "privacyPolicy": "Privacy Policy", | ||
| "poweredBy": "Powered by" | ||
| } |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "copyright": "Copyright © {{year}}, El Presidente y Miembros de la Universidad de Harvard | ", | ||
| "copyright": "Copyright © {{year}}, {{copyrightHolder}}", | ||
| "privacyPolicy": "Política de privacidad", | ||
| "poweredBy": "Desarrollado por" | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,68 @@ | ||
| import { Usage } from '@/sections/homepage/usage/Usage' | ||
| import { applyTestAppConfig } from '@tests/support/bootstrapAppConfig' | ||
| import type { AppConfig } from '@/config' | ||
|
|
||
| describe('Usage', () => { | ||
| const collectionId = 'test-collection-id' | ||
| const defaultHomepageEnv = Cypress.env('homepage') as AppConfig['homepage'] | ||
| const defaultBrandingEnv = Cypress.env('branding') as AppConfig['branding'] | ||
|
|
||
| afterEach(() => { | ||
| Cypress.env('homepage', defaultHomepageEnv) | ||
| Cypress.env('branding', defaultBrandingEnv) | ||
| applyTestAppConfig() | ||
| }) | ||
|
|
||
| it('renders usage cards and links to create dataset and collection routes', () => { | ||
| cy.customMount(<Usage collectionId={collectionId} />) | ||
|
|
||
| cy.findByRole('heading', { | ||
| name: 'Deposit and share your data. Get academic credit.' | ||
| }).should('be.visible') | ||
| cy.findByRole('heading', { | ||
| name: 'Organize datasets and gather metrics in your own repository.' | ||
| }).should('be.visible') | ||
|
|
||
| cy.findByRole('link', { name: 'Add a dataset' }).should( | ||
| 'have.attr', | ||
| 'href', | ||
| `/datasets/${collectionId}/create` | ||
| ) | ||
| cy.findByRole('link', { name: 'Add a collection' }).should( | ||
| 'have.attr', | ||
| 'href', | ||
| `/collections/${collectionId}/create` | ||
| ) | ||
| }) | ||
|
|
||
| it('uses app config branding and support URL for the general card', () => { | ||
| const supportUrl = 'https://example.org/help' | ||
|
|
||
| Cypress.env('branding', { dataverseName: 'Testverse' }) | ||
| Cypress.env('homepage', { supportUrl }) | ||
| applyTestAppConfig() | ||
|
|
||
| cy.customMount(<Usage collectionId={collectionId} />) | ||
|
|
||
| cy.findByRole('heading', { | ||
| name: 'Publishing your data is easy on Testverse!' | ||
| }).should('be.visible') | ||
| cy.findByRole('link', { name: 'Getting started' }) | ||
| .should('have.attr', 'href', supportUrl) | ||
| .and('have.attr', 'target', '_blank') | ||
| .and('have.attr', 'rel', 'noreferrer noopener') | ||
| }) | ||
|
|
||
| it('falls back to the default support URL when config support URL is missing', () => { | ||
| Cypress.env('homepage', {}) | ||
| applyTestAppConfig() | ||
|
|
||
| cy.customMount(<Usage collectionId={collectionId} />) | ||
|
|
||
| cy.findByRole('link', { name: 'Getting started' }).should( | ||
| 'have.attr', | ||
| 'href', | ||
| 'https://guides.dataverse.org/en/latest/user/index.html' | ||
| ) | ||
| }) | ||
| }) |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.