Skip to content

Commit

Permalink
Merge branch 'development' into feature/add-agent-model-ui-components
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Jul 28, 2023
2 parents 4fcf11d + e768933 commit 4439b71
Show file tree
Hide file tree
Showing 19 changed files with 240 additions and 104 deletions.
1 change: 0 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
//= require bp_property_tree
//= require concepts
//= require home
//= require fair_score
//= require_tree ./helpers
//= require_tree ./components
//= require ontologies
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/components/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
@import 'input_field';
@import 'file_input_loader';
@import 'text_area_field';
@import 'search_input';
@import "switch";
@import "table";
@import "concept_details";
64 changes: 64 additions & 0 deletions app/assets/stylesheets/components/switch.scss
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);
}
4 changes: 2 additions & 2 deletions app/assets/stylesheets/footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
background-color: var(--primary-color);
}
footer{
width: 1280px;
width: 1248px;
background-color: var(--primary-color);
padding: 40px 100px;
padding: 40px 50px;
}

.footer-header{
Expand Down
57 changes: 49 additions & 8 deletions app/assets/stylesheets/home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ i.fa.fa-caret-square-o-down {
.home-header-title{
position: absolute;
z-index: 4;
width: 481px;
width: 500px;
margin-right: 664px;
margin-top: 123px;
opacity: 0;
transform: translateY(-100%);
animation: slide-and-fade 1s ease forwards;
}
.home-header-title h4{
font-size: 40px;
font-size: 38px;
font-weight: 800;
color: white;
}
Expand Down Expand Up @@ -130,8 +130,9 @@ i.fa.fa-caret-square-o-down {
align-items: center;
}
.home-section{
padding: 0 50px;
margin-top: 70px;
width: 1138px;
width: 1248px;
}
.home-section > h4{
font-size: 20px;
Expand All @@ -148,7 +149,6 @@ i.fa.fa-caret-square-o-down {
}
.home-statistics{
display: flex;
justify-content: space-between;
}
.home-statistics-container{
border-radius: 8px;
Expand All @@ -159,7 +159,7 @@ i.fa.fa-caret-square-o-down {
.home-statistics-container > div {
display: flex;
align-items: center;

flex-wrap: wrap;
}
.home-agroportal-figures{
margin-bottom: 20px;
Expand All @@ -174,7 +174,10 @@ i.fa.fa-caret-square-o-down {
.home-statistics-item{
display: flex;
align-items: center;


}
.home-statistics> :not(:last-child){
margin-right: 49px;
}
.home-statistics-item hr{
height: 83px;
Expand Down Expand Up @@ -315,10 +318,10 @@ i.fa.fa-caret-square-o-down {
justify-content: space-between;
}
.home-sub-section-left{
width: 533px;
width: 550px;
}
.home-sub-section-right{
width: 533px;
width: 550px;
}
.home-sub-section-left h4, .home-sub-section-right h4{
font-size: 20px;
Expand Down Expand Up @@ -415,5 +418,43 @@ i.fa.fa-caret-square-o-down {
to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1300px) {
.home-section{
width: 100%;
}
.home-section-sub-sections-container{
flex-direction: column;
}
.home-random-bubbles{
display: none;
}
.home-header-title{

margin:128px 50px;
width: 500px;

opacity: 0;
transform: translateY(-100%);
animation: slide-and-fade 1s ease forwards;
}
.home-header-title-container{
justify-content: start;
}
.home-sub-section-left {
width: 100%;
}

.home-sub-section-right {
width: 100%;
margin-top: 50px;
}
.home-fair-scores div{
padding: 0 10%;
}
.home-fair-scores{
height: unset;
}
}



26 changes: 21 additions & 5 deletions app/assets/stylesheets/nav_bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
background-color: var(--primary-color);
align-items: center;
height: 62px;
padding: 8px 50px;
width: 60%;
padding: 8px 42px;
width: 1248px;
}
.nav-responsiveness-container{
.nav-responsiveness-container{
display: flex;
justify-content: space-between;
}
Expand All @@ -30,12 +30,13 @@
display: flex;
justify-content: space-between;
align-items:center;
width: 85%;
width: 1020px;
}
.nav-items > ul {
display: flex;
list-style: none;
margin-bottom: 0;
padding: 0;
}

.nav-items > ul > li {
Expand Down Expand Up @@ -132,7 +133,7 @@
}


@media (max-width: 1200px){
@media (max-width: 1300px){
.top-nav .menu-btn i{
display: block;
}
Expand All @@ -146,6 +147,14 @@
position: absolute;
right: 40px;
}
.right-nav-items{
flex-direction: column;
align-items: baseline !important;
}
.nav-search-container .nav-input{
margin-bottom: 0 !important;

}

}
.top-nav.show-responsive {
Expand All @@ -172,3 +181,10 @@
.supportMenuDropdownLink.show-responsive {
margin-bottom: 15px;
}

.right-nav-items{
display: flex;
align-items: center;
justify-content: space-between;
width: 50%
}
2 changes: 1 addition & 1 deletion app/components/switch_input_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class SwitchInputComponent < ViewComponent::Base


def initialize(id:, name: , label: nil, value: '', checked: false, boolean_switch: false)
def initialize(id:, name: , label: '', value: '', checked: false, boolean_switch: false)
super
@id = id
@name = name
Expand Down
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
21 changes: 21 additions & 0 deletions app/javascript/controllers/fair_score_home_controller.js
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 app/javascript/controllers/fair_score_landscape_controller.js
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 app/javascript/controllers/fair_score_summary_controller.js
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])
}
}
12 changes: 9 additions & 3 deletions app/javascript/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ application.register("class-search-auto-complete", ClassSearchAutoCompleteContro
import ContainerSplitterController from "./container_splitter_controller"
application.register("container-splitter", ContainerSplitterController)

import FairScoreHomeController from "./fair_score_home_controller"
application.register("fair-score-home", FairScoreHomeController)

import FairScoreLandscapeController from "./fair_score_landscape_controller"
application.register("fair-score-landscape", FairScoreLandscapeController)

import FairScoreSummaryController from "./fair_score_summary_controller"
application.register("fair-score-summary", FairScoreSummaryController)

import FormAutoCompleteController from "./form_auto_complete_controller"
application.register("form-auto-complete", FormAutoCompleteController)

Expand Down Expand Up @@ -55,9 +64,6 @@ application.register("skos-collection-colors", SkosCollectionColorsController)
import TextTruncateController from "./text_truncate_controller"
application.register("text-truncate", TextTruncateController)

import Ontology_viewer_tabs_controller from "./ontology_viewer_tabs_controller"
application.register("ontology-viewer-tabs", Ontology_viewer_tabs_controller)

import TooltipController from "./tooltip_controller"
application.register("tooltip", TooltipController)

Expand Down
Loading

0 comments on commit 4439b71

Please sign in to comment.