Skip to content

Commit

Permalink
Feature: Add contextual go to API icons in admin sections (#530)
Browse files Browse the repository at this point in the history
* create function to render rounded icon

* use the function of rounded button into the admin sections

* fix the color of rounded button icon

* add api key to correct the urls

* fix the style of json rouned button

* rename render_rounded_button_with_style to rounded_button_component

* Feature: Update ontologies selector component  (#508)

* init ontologies selector design

* ontologies selector options

* display ontologies in ontologies selector

* finalize ontologies selector design

* put ontologies selector in the modal component

* fix ontologies result display in ontologies selector

* Make ontologies selector search bar work

* show ontologies results count in ontologies selector

* make groups filter work in ontologies selector

* make filter by categories work in ontologies selector

* add ontologies selector loading animation

* make submission related filters work for ontologies selector

* make select all work in ontologies selector

* make retired ontologies and views filters work in ontologies selector

* fix ontologies style in ontologies selector

* add unselect all in ontologies selector

* show tab selected checks count in ontologies selector

* Clean ontologies selector js controller code

* Add loading animation to ontologies selector

* make ontology selection work in ontologies selector

* add clear selection to ontologies selector

* make ontologies selector component

* remove duplicated cross icon in ontologies selector

* clean ontologies controller code

* use rails cache in ontologies selector

* replace use cases of the old ontologies selector

* delete old ontologies selector code

* convert ontologies selector ui component into a helper

* replace the usages of the ontologies selector ui component by the ontologies selector helper

* replace 'selector' by 'ontologies_selector' in ontologies controller

* add internationalisation to ontologies selector

* remove the usage of static cache in ontologies selector

* extract save and cancel buttons to a reusable helper in ontologies selector

* undo extract save and cancel buttons to a reusable helper

* add another type to the loader component that uses the style of the three dots

* don't use display all in submissions fetching to make it faster in ontologies controller

* remove ontology_picker_single code and replace its usages

* give type argument in loader component a more significant value

* replace ontologies selector text input by text input helper

* replace ontologies selector chips components by chips components helpers

* extract save and cancel buttons to helpers in the ontologies selector

* fix ontologies selector name fild in search annotator and recommender page

* fix text input helper label

---------

Co-authored-by: Syphax bouazzouni <[email protected]>

* move the admin go to api button next to the action buttons

---------

Co-authored-by: Syphax bouazzouni <[email protected]>
Co-authored-by: Bilel Kihal <[email protected]>
  • Loading branch information
3 people committed Mar 25, 2024
1 parent 7e2ac60 commit 9962096
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 14 deletions.
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ GEM
netrc (0.11.0)
newrelic_rpm (9.7.1)
nio4r (2.7.0)
nokogiri (1.15.5-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.15.5-x86_64-linux)
racc (~> 1.4)
oauth2 (2.0.9)
Expand Down Expand Up @@ -562,6 +564,7 @@ GEM
zeitwerk (2.6.13)

PLATFORMS
x86_64-darwin-23
x86_64-linux

DEPENDENCIES
Expand Down
3 changes: 2 additions & 1 deletion app/assets/stylesheets/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ table.dataTable tbody tr.selected {

.ontologies_list_container {
padding: 1em;
position: relative;
}

/* Datatables */
Expand Down Expand Up @@ -162,4 +163,4 @@ table.dataTable tbody tr.selected {
div.groupFormError {
color: red;
padding-top: 3px;
}
}
4 changes: 4 additions & 0 deletions app/helpers/components_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ def resolvability_check_tag(url)
content_tag(:span, check_resolvability_container(url), style: 'display: inline-block;')
end

def rounded_button_component(link)
render RoundedButtonComponent.new(link: link, target: '_blank',size: 'small',title: t("components.go_to_api"))
end

def copy_link_to_clipboard(url, show_content: false)
content_tag(:span, style: 'display: inline-block;') do
render ClipboardComponent.new(message: url, show_content: show_content)
Expand Down
12 changes: 7 additions & 5 deletions app/views/admin/categories/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
= turbo_frame_tag 'categories-list' do
= link_to_modal(t('admin.categories.index.create_a_new_category'),
new_admin_category_path,
id: "new_category_btn",
class: "btn btn-default mb-3",
data: { show_modal_title_value: t('admin.categories.index.create_a_new_category')})
.d-flex
= link_to_modal(t('admin.categories.index.create_a_new_category'),
new_admin_category_path,
id: "new_category_btn",
class: "btn btn-default mb-3",
data: { show_modal_title_value: t('admin.categories.index.create_a_new_category')})

= rounded_button_component("#{$REST_URL}/categories?display=all&apikey=#{get_apikey}")
%div.my-1.border-radius-0
= render_alerts_container
= render TableComponent.new(id: 'admin_categories', custom_class: 'border rounded p-1') do |t|
Expand Down
2 changes: 2 additions & 0 deletions app/views/admin/groups/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
data: { show_modal_title_value: t('admin.groups.index.create_a_new_group')})

= action_button(t('admin.groups.index.synchronize_groups_slices'), admin_groups_synchronize_groups_url)
= rounded_button_component("#{$REST_URL}/groups?display=all&apikey=#{get_apikey}")

%div.my-1
= render_alerts_container

= render TableComponent.new(id: 'admin_groups', custom_class: 'border rounded p-1') do |t|
- t.header do |h|
- h.th {t('admin.groups.form.name')}
Expand Down
17 changes: 10 additions & 7 deletions app/views/agents/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
= turbo_frame_tag 'agents-list' do
= link_to_modal(t("agents.index.create_new_agent"),
new_agent_path,
id: "new_agent_btn",
role: "button",
class: "btn btn-default mb-3",
data: { show_modal_title_value: t("agents.index.create_new_agent"), show_modal_size_value: 'modal-xl' },
)
.d-flex
= link_to_modal(t("agents.index.create_new_agent"),
new_agent_path,
id: "new_agent_btn",
role: "button",
class: "btn btn-default mb-3",
data: { show_modal_title_value: t("agents.index.create_new_agent"), show_modal_size_value: 'modal-xl' },
)
= rounded_button_component("#{$REST_URL}/agents?display=all&apikey=#{get_apikey}")

= render_alerts_container(AgentsController)
= render TableComponent.new(id: 'admin_agents', custom_class: 'border rounded p-1') do |t|
- t.header do |h|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
%div.mt-5.d-flex
%div.mt-5
.rounded-json-button
= rounded_button_component("#{$REST_URL}/submissions?display=all&apikey=#{get_apikey}")
%div.mx-auto.w-75
= form_tag("/ontologies_metadata_curator/result", method: "post", data: { turbo: true, turbo_frame: 'selection_metadata_form'}) do
%div
Expand Down
2 changes: 2 additions & 0 deletions app/views/users/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
= turbo_frame_tag 'users-list' do
%div.my-1
= render_alerts_container
.d-flex.justify-content-end
= rounded_button_component("#{$REST_URL}/users?display=all&apikey=#{get_apikey}")
= render TableComponent.new(id: 'admin_users', custom_class: 'border rounded p-1') do |t|
- t.header do |h|
- h.th {t('users.index.first_name')}
Expand Down

0 comments on commit 9962096

Please sign in to comment.