(core) Allow adding a single link at the bottom of a document tour card

Summary:
Checks for new special columns in GristDocTour: Link_Text, Link_URL, and Link_Icon.

No link is generated if Link_Text is blank or Link_URL cannot be parsed as a URL.

No icon is shown if Link_Icon is not the name of an icon in IconList.ts

Test Plan: Expanded tests, but they now assert things about HTML which may be brittle

Reviewers: georgegevoian, dsagal

Reviewed By: georgegevoian, dsagal

Subscribers: dsagal

Differential Revision: https://phab.getgrist.com/D2947
This commit is contained in:
Alex Hall
2021-07-28 20:20:14 +02:00
parent 37eed2d3c2
commit aec360498c
2 changed files with 44 additions and 5 deletions

View File

@@ -143,17 +143,17 @@ const cssInfo = styled('div', `
line-height: 1.6;
`);
const cssButtons = styled('div', `
export const cssButtons = styled('div', `
display: flex;
`);
const cssLinkBtn = styled(cssLink, `
export const cssLinkBtn = styled(cssLink, `
&:not(:last-child) {
margin-right: 32px;
}
`);
const cssLinkIcon = styled(icon, `
export const cssLinkIcon = styled(icon, `
margin-right: 8px;
margin-top: -2px;
`);