(core) Improve snapshot listing, and add compare snapshot links

Summary:
- When viewing a snapshot, list all snapshots for a doc, highlighting the current one.
- Include links in per-snapshot menu to compare-to-current and compare-to-previous.
- Compare links include "beta" tags.
- Set order of comparison to have older on the left, and newer on the right.

Test Plan: Moved out DocHistory test from Snapshots, and added some test cases.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D2681
This commit is contained in:
Dmitry S
2020-12-09 00:59:42 -05:00
parent 8f023a6446
commit 92224084e4
3 changed files with 81 additions and 34 deletions

View File

@@ -255,6 +255,10 @@ export function menuItemCmd(cmd: Command, label: string, ...args: DomElementArg[
);
}
export function menuAnnotate(text: string) {
return cssAnnotateMenuItem('Beta');
}
export const menuDivider = styled(weasel.cssMenuDivider, `
margin: 8px 0;
`);
@@ -374,3 +378,17 @@ const cssCmdKey = styled('span', `
color: ${colors.slate};
margin-right: -12px;
`);
const cssAnnotateMenuItem = styled('span', `
color: ${colors.lightGreen};
text-transform: uppercase;
font-size: 8px;
vertical-align: super;
margin-top: -4px;
margin-left: 4px;
font-weight: bold;
.${weasel.cssMenuItem.className}-sel > & {
color: white;
}
`);