Skip to content

Commit

Permalink
hide detailed disclosure information by default (#6587)
Browse files Browse the repository at this point in the history
As requested by @shaul-da, this PR hides the information added by
@hurryabit in #6571 behind a checkbox, and reverts to plain "X"s by
default (checkbox unchecked).

CHANGELOG_BEGIN
- [DAML Studio] The new S/O/W/D information is hidden behind a top-level
  checkbox (next to Show archived). When that checkbox is not checked
  (which is the default), we display X's as before.
CHANGELOG_END
  • Loading branch information
garyverhaegen-da authored Jul 3, 2020
1 parent 817b7ca commit 2cbd498
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
6 changes: 6 additions & 0 deletions compiler/daml-extension/src/webview.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ td.disclosure {
tr.archived td.disclosure {
text-decoration: none;
}
.hidden_disclosure td.disclosed.disclosure span {
display: none;
}
.hidden_disclosure td.disclosed.disclosure:after {
content: 'X';
}
th {
vertical-align: bottom;
}
Expand Down
3 changes: 3 additions & 0 deletions compiler/daml-extension/src/webview.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ const vscode = acquireVsCodeApi();
function show_archived_changed() {
document.body.classList.toggle('hide_archived', !document.getElementById('show_archived').checked);
}
function toggle_detailed_disclosure() {
document.body.classList.toggle('hidden_disclosure', !document.getElementById('show_detailed_disclosure').checked);
}
function toggle_view() {
document.body.classList.toggle('hide_transaction');
document.body.classList.toggle('hide_table');
Expand Down
4 changes: 2 additions & 2 deletions compiler/damlc/tests/src/DA/Test/ShakeIdeClient.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1231,8 +1231,8 @@ scenarioTests mbScenarioService = Tasty.testGroup "Scenario tests"
, "<tr"
, "<td", "tooltip", ">S<", "tooltiptext", ">Signatory<", "</td>"
, "<td", "tooltip", ">O<", "tooltiptext", ">Observer<", "</td>"
, "<td", "tooltip", ">-</div></td>"
, "<td", "tooltip", ">-</div></td>"
, "<td", "tooltip", ">-<", "</td>"
, "<td", "tooltip", ">-<", "</td>"
, "</tr"
, "<tr"
, "<td", "tooltip", ">S<", "tooltiptext", ">Signatory<", "</td>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -857,8 +857,8 @@ renderRow world parties NodeInfo{..} =
| party `S.member` niDivulgences = ("D", Just "Divulged")
| otherwise = ("-", Nothing)
in
H.td H.! A.class_ "disclosure" $ H.div H.! A.class_ "tooltip" $ do
H.text label
H.td H.! A.class_ (H.textValue $ T.unwords $ "disclosure" : ["disclosed" | isJust mbHint]) $ H.div H.! A.class_ "tooltip" $ do
H.span $ H.text label
whenJust mbHint $ \hint -> H.span H.! A.class_ "tooltiptext" $ H.text hint
active = if niActive then "active" else "archived"
row = H.tr H.! A.class_ (H.textValue active) $ mconcat
Expand Down Expand Up @@ -905,7 +905,7 @@ renderScenarioResult world res = TL.toStrict $ Blaze.renderHtml $ do
Nothing -> H.body H.! A.class_ "hide_note" $ do
noteView
transView
Just tbl -> H.body H.! A.class_ "hide_archived hide_transaction hide_note" $ do
Just tbl -> H.body H.! A.class_ "hide_archived hide_transaction hide_note hidden_disclosure" $ do
H.div $ do
H.button H.! A.onclick "toggle_view();" $ do
H.span H.! A.class_ "table" $ H.text "Show transaction view"
Expand All @@ -914,6 +914,9 @@ renderScenarioResult world res = TL.toStrict $ Blaze.renderHtml $ do
H.span H.! A.class_ "table" $ do
H.input H.! A.type_ "checkbox" H.! A.id "show_archived" H.! A.onchange "show_archived_changed();"
H.label H.! A.for "show_archived" $ "Show archived"
H.span H.! A.class_ "table" $ do
H.input H.! A.type_ "checkbox" H.! A.id "show_detailed_disclosure" H.! A.onchange "toggle_detailed_disclosure();"
H.label H.! A.for "show_detailed_disclosure" $ "Show detailed disclosure"
noteView
tbl
transView
Expand Down

0 comments on commit 2cbd498

Please sign in to comment.