-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a new page for displaying SSA diagrams
- Add a new stylesheet - Add a new JS module - Add mermaid as a dependency - Add a loading message to be shown while mermaid intialises - Add a link from the simple smart answer edition view to the diagram visualisation page.
- Loading branch information
1 parent
6c04518
commit 4a99766
Showing
7 changed files
with
2,161 additions
and
1,092 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//= require mermaid/dist/mermaid | ||
|
||
(function (Modules) { | ||
'use strict' | ||
|
||
Modules.SmartAnswerFlowchart = function () { | ||
this.start = function (element) { | ||
var diagram = element.find('.flowchart') | ||
var flowchartLoading = element.find('.flowchart__loading') | ||
|
||
// eslint-disable-next-line | ||
mermaid.initialize( | ||
{ | ||
startOnLoad: true, | ||
flowchart: { | ||
useMaxWidth: false | ||
} | ||
} | ||
) | ||
|
||
diagram.removeClass('flowchart--hidden') | ||
flowchartLoading.addClass('flowchart__loading--hidden') | ||
} | ||
} | ||
})(window.GOVUKAdmin.Modules) |
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,14 @@ | ||
.smart-answer-flowchart { | ||
.mermaid { | ||
background-color: #ffffff; | ||
} | ||
|
||
.flowchart--hidden, | ||
.flowchart__loading--hidden { | ||
display: none; | ||
} | ||
|
||
pre { | ||
word-break: normal; | ||
} | ||
} |
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
Oops, something went wrong.