-
Notifications
You must be signed in to change notification settings - Fork 6
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
Give an option to be an 'external link' for story #735
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
41ad6fa
Start work for external link
hanbyul-here d1f0a2c
Add example story, Add default data for storiesBanner, fix type
hanbyul-here 581e354
Fix types
hanbyul-here f1c2f3b
Revert type change back, Add style to external flag
hanbyul-here 99a1ae7
Move external link logic to card level, type fix
hanbyul-here 17a6c6a
Style External link
hanbyul-here bdcd56e
Adjust excessive zindex
hanbyul-here da4527b
Throw error if aslink story is accessed on the single level
hanbyul-here 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 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
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
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
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
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 @@ | ||
--- | ||
featured: true | ||
id: 'external-link-test' | ||
name: External Link Test | ||
description: Story to test external link | ||
media: | ||
src: ::file ./img-placeholder-6.jpg | ||
alt: Generic placeholder by Unsplash | ||
author: | ||
name: Unsplash | ||
url: https://unsplash.com/ | ||
pubDate: 2023-02-09 | ||
taxonomy: | ||
- name: Topics | ||
values: | ||
- Agriculture | ||
- name: Source | ||
values: | ||
- Development Seed | ||
related: | ||
- type: dataset | ||
id: no2 | ||
- type: story | ||
id: air-quality-and-covid-19 | ||
asLink: | ||
url: 'https://developmentseed.org' | ||
--- |
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 @@ | ||
--- | ||
featured: true | ||
id: 'internal-link-test' | ||
name: Internal Link Test | ||
description: Story to test internal link. Link to cata catalog. | ||
media: | ||
src: ::file ./img-placeholder-6.jpg | ||
alt: Generic placeholder by Unsplash | ||
author: | ||
name: Unsplash | ||
url: https://unsplash.com/ | ||
pubDate: 2023-02-09 | ||
taxonomy: | ||
- name: Topics | ||
values: | ||
- Agriculture | ||
- name: Source | ||
values: | ||
- Development Seed | ||
related: | ||
- type: dataset | ||
id: no2 | ||
- type: story | ||
id: air-quality-and-covid-19 | ||
asLink: | ||
url: '/data-catalog' | ||
--- |
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 |
---|---|---|
@@ -1,20 +1,28 @@ | ||
const { defaults, mapValues } = require('lodash'); | ||
|
||
const defaultStrings = { | ||
const defaultStrings = ensureOneOther({ | ||
stories: { | ||
one: 'Story', | ||
other: 'Stories' | ||
} | ||
}; | ||
}, | ||
storiesBanner: | ||
'Explore the guided narratives below to discover how NASA satellites and other Earth observing resources reveal a changing planet.', | ||
dataCatalogBanner: | ||
'This dashboard explores key indicators to track and compare changes over time.' | ||
}); | ||
|
||
/** | ||
* Combine the default strings with the user-provided strings, while converting | ||
* single string values to an object with `one` and `other` keys. | ||
* @param {object} strings | ||
*/ | ||
module.exports.withDefaultStrings = (strings) => { | ||
const objectifiedStrings = mapValues(strings, (value) => | ||
typeof value === 'string' ? { one: value, other: value } : value | ||
); | ||
const objectifiedStrings = ensureOneOther(strings); | ||
return defaults({}, objectifiedStrings, defaultStrings); | ||
}; | ||
|
||
function ensureOneOther(objectWithStrings) { | ||
return mapValues(objectWithStrings, (value) => | ||
typeof value === 'string' ? { one: value, other: value } : value | ||
); | ||
} |
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
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.
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.
So @faustoperez shared this cool trick on how to derive the value for nested border-radius, which should be (outside border-radius - gap ): https://www.30secondsofcode.org/css/s/nested-border-radius/ But if we take it as it is, the value becomes 0, so I halved the value for the gap here. :[