forked from ontoportal/ontoportal_web_ui
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into feature/add-agent-model-ui-components
- Loading branch information
Showing
19 changed files
with
240 additions
and
104 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
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,64 @@ | ||
|
||
.switch-filter{ | ||
display:flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
margin-bottom: 20px; | ||
} | ||
.switch-filter p{ | ||
font-size: 16px; | ||
color: #666666; | ||
margin-bottom: 0; | ||
margin-right: 10px; | ||
} | ||
|
||
|
||
|
||
/* Toggle switch css */ | ||
.switch { | ||
position: relative; | ||
display: inline-block; | ||
width: 40px; | ||
height: 20px; | ||
margin-bottom: 0; | ||
} | ||
.switch input { | ||
opacity: 0; | ||
width: 0; | ||
height: 0; | ||
} | ||
.slider { | ||
position: absolute; | ||
cursor: pointer; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
background-color: #ccc; | ||
-webkit-transition: .4s; | ||
transition: .4s; | ||
border-radius: 34px; | ||
} | ||
.slider:before { | ||
position: absolute; | ||
content: ""; | ||
height: 13px; | ||
width: 13px; | ||
left: 4px; | ||
bottom: 4px; | ||
background-color: white; | ||
-webkit-transition: .4s; | ||
transition: .4s; | ||
border-radius: 50%; | ||
} | ||
input:checked + .slider { | ||
background-color: var(--primary-color); | ||
} | ||
input:focus + .slider { | ||
box-shadow: 0 0 1px var(--primary-color); | ||
} | ||
input:checked + .slider:before { | ||
-webkit-transform: translateX(19px); | ||
-ms-transform: translateX(19px); | ||
transform: translateX(19px); | ||
} |
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
11 changes: 7 additions & 4 deletions
11
app/components/switch_input_component/switch_input_component.html.haml
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,6 +1,9 @@ | ||
%div.custom-control.custom-switch | ||
%div.switch-filter | ||
- if @boolean_switch | ||
= hidden_field_tag @name, @value | ||
= check_box_tag check_box_name, @value, @checked, class: 'custom-control-input', id: check_box_id, onChange: "#{boolean_switch_action}" | ||
%label.custom-control-label{for: check_box_id} | ||
= content || @label | ||
- if content || [email protected]? | ||
%p | ||
= content || @label | ||
%label.switch{for: check_box_id} | ||
= check_box_tag check_box_name, @value, @checked, class: '', id: check_box_id, onChange: "#{boolean_switch_action}" | ||
%span.slider |
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,21 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
import {FairScorePrincipleBar, FairScoreCriteriaRadar, FairScoreChartContainer} from "../mixins/useFairScore"; | ||
// Connects to data-controller="fair-score-home" | ||
export default class extends Controller { | ||
connect() { | ||
let fairScoreBar = new FairScorePrincipleBar( 'ont-fair-scores-canvas') | ||
let fairScoreRadar = new FairScoreCriteriaRadar( 'ont-fair-criteria-scores-canvas') | ||
let fairContainer = new FairScoreChartContainer('fair-score-charts-container' , [ fairScoreRadar , fairScoreBar]) | ||
let ontologies = jQuery("#ontology_ontologyId"); | ||
|
||
fairContainer.getFairScoreData("all") | ||
ontologies.change( (e) => { | ||
if(ontologies.val() !== null){ | ||
fairContainer.getFairScoreData(ontologies.val().join(',')) | ||
} else if(ontologies.val() === null){ | ||
fairContainer.getFairScoreData("all") | ||
} | ||
e.preventDefault() | ||
}) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
app/javascript/controllers/fair_score_landscape_controller.js
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,20 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
import { FairScoreChartContainer, FairScoreCriteriaBar } from "../mixins/useFairScore"; | ||
// Connects to data-controller="fair-score-landscape" | ||
export default class extends Controller { | ||
connect() { | ||
let fairCriteriaBars = new FairScoreCriteriaBar('ont-fair-scores-criteria-bars-canvas') | ||
let fairContainer = new FairScoreChartContainer('fair-score-charts-container' , [fairCriteriaBars]) | ||
let ontologies = jQuery("#ontology_ontologyId"); | ||
|
||
fairContainer.getFairScoreData("all") | ||
ontologies.change( (e) => { | ||
if(ontologies.val() !== null){ | ||
fairContainer.getFairScoreData(ontologies.val().join(',')) | ||
} else if(ontologies.val() === null){ | ||
fairContainer.getFairScoreData("all") | ||
} | ||
e.preventDefault() | ||
}) | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
app/javascript/controllers/fair_score_summary_controller.js
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,12 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
import {FairScorePrincipleBar, FairScoreCriteriaRadar, FairScoreChartContainer} from "../mixins/useFairScore"; | ||
// Connects to data-controller="fair-score-summary" | ||
export default class extends Controller { | ||
connect() { | ||
let fairScoreBar = new FairScorePrincipleBar( 'ont-fair-scores-canvas') | ||
let fairScoreRadar = new FairScoreCriteriaRadar( 'ont-fair-criteria-scores-canvas') | ||
let fairContainer = new FairScoreChartContainer('fair-score-charts-container' , [ fairScoreRadar , fairScoreBar]) | ||
|
||
fairContainer.getFairScoreData(window.location.pathname.split('/')[2]) | ||
} | ||
} |
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.