forked from ontoportal/ontoportal_web_ui
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: the contexual json icon for to the concept adapt to the select t…
…ab (#539) * refactor concepts json code and put it in a stimulus controller * adjust the position of the concepts json link * remove non related code to concepts json PR * remove non related code to contextual json pull request * pass base class URL directly to concepts json stimulus controller * clean concepts json stimulus code * remove undesired code from concepts json button PR * fix typo in agent_search_input_component.html.haml * rename concepts json button stimulus controller * clean concepts json button controller code * clean concepts json button related code --------- Co-authored-by: Syphax bouazzouni <[email protected]> Co-authored-by: Bilel KIHAL <[email protected]> Co-authored-by: @SirineMhedhbi
- Loading branch information
1 parent
3961528
commit 93cedc7
Showing
8 changed files
with
91 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ | |
%p.search-element.home-searched-ontology | ||
NAME (IDENTIFIERS) | ||
%p.home-result-type | ||
TYPE | ||
TYPE |
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
19 changes: 19 additions & 0 deletions
19
app/javascript/controllers/concepts_json_button_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,19 @@ | ||
import {Controller} from "@hotwired/stimulus" | ||
|
||
export default class extends Controller { | ||
static targets = ['button'] | ||
|
||
update(){ | ||
setTimeout(() => { | ||
const tabsList = this.element.querySelectorAll('.nav-item'); | ||
const jsonLink = Array.from(tabsList).find(tab => tab.classList.contains('active'))?.querySelector('a').getAttribute('data-json-link'); | ||
const conceptsJsonLink = this.buttonTarget.querySelector('a'); | ||
if (jsonLink) { | ||
conceptsJsonLink.href = jsonLink; | ||
conceptsJsonLink.style.display = 'flex' | ||
} else { | ||
conceptsJsonLink.style.display = 'none' | ||
} | ||
}, 1); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -307,3 +307,4 @@ if $HOSTNAME | |
require_relative "bioportal_config_development_#{$HOSTNAME}" | ||
end | ||
end | ||
|