Skip to content

Commit

Permalink
Merge branch 'development' into stage
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Nov 30, 2023
2 parents e44b77b + 9d99d87 commit 6f41921
Show file tree
Hide file tree
Showing 63 changed files with 1,150 additions and 526 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker-image-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ jobs:
uses: docker/metadata-action@v4
with:
images: |
agroportal/ontologies_api
ghcr.io/agroportal/ontoloportal_web_ui
agroportal/ontoportal_web_ui
ghcr.io/${{ github.repository }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/arm64
build-args: |
RUBY_VERSION=2.7
RUBY_VERSION=2.7.8
push: true
tags: ${{ steps.meta.outputs.tags }}-${{ env.BRANCH_NAME }}-arm64
labels: ${{ steps.meta.outputs.labels }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ jobs:
uses: docker/metadata-action@v4
with:
images: |
agroportal/ontoloportal_web_ui
ghcr.io/agroportal/ontoloportal_web_ui
agroportal/ontoportal_web_ui
ghcr.io/${{ github.repository }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64
build-args: |
RUBY_VERSION=2.7
RUBY_VERSION=2.7.8
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
11 changes: 5 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
bundler-cache: true

- name: Run OntoPortal API
run: bin/run_api -k ${{ env.REMOTE_API_KEY }} -r agroportal -t stage -s STY -u ${{ env.REMOTE_API_URL }}
run: bin/run_api -k ${{ env.REMOTE_API_KEY }} -r agroportal -t development -s STY -u ${{ env.REMOTE_API_URL }}

# Add or replace database setup steps here
- name: set up config file
Expand All @@ -55,8 +55,7 @@ jobs:
# Add or replace test runners here
- name: Run tests
run: COVERAGE=true RAILS_ENV=test bin/rails test -v
- name: Upload Code Coverage
uses: actions/upload-artifact@v2
with:
name: code-coverage
path: coverage/
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ ENV RAILS_LOG_TO_STDOUT="1" \
BUNDLE_WITHOUT="${BUNDLE_WITHOUT}"

# fix for ruby v2.7.8 only
RUN gem install uri -v 0.12.2 --no-document
RUN gem install uri --no-document

COPY Gemfile* .
RUN bundle install

RUN echo "--modules-folder /node_modules" > .yarnrc
COPY package.json *yarn* ./
RUN yarn install
RUN yarn install && yarn build

COPY . .

Expand Down
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,12 @@ group :test do
gem 'capybara'
gem 'selenium-webdriver'
gem 'simplecov', require: false
gem 'simplecov-cobertura' # for codecov.io
#gem 'webdrivers'
end


gem "net-ftp", "~> 0.2.0", require: false
gem "net-http"
gem "net-http", "~> 0.3.2"


15 changes: 7 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2023.1003)
mini_mime (1.1.5)
mini_portile2 (2.8.5)
minitest (5.20.0)
msgpack (1.7.2)
multi_json (1.15.0)
Expand All @@ -289,7 +288,7 @@ GEM
net-ftp (0.2.0)
net-protocol
time
net-http (0.4.0)
net-http (0.3.2)
uri
net-imap (0.4.6)
date
Expand All @@ -307,9 +306,6 @@ GEM
newrelic_rpm (9.6.0)
base64
nio4r (2.6.1)
nokogiri (1.15.5)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.15.5-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.15.5-x86_64-linux)
Expand Down Expand Up @@ -480,6 +476,9 @@ GEM
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-cobertura (2.1.0)
rexml
simplecov (~> 0.19)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
smart_properties (1.17.0)
Expand All @@ -503,7 +502,7 @@ GEM
temple (0.10.3)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
terser (1.1.19)
terser (1.1.20)
execjs (>= 0.3.0, < 3)
thin (1.8.2)
daemons (~> 1.0, >= 1.0.9)
Expand Down Expand Up @@ -548,7 +547,6 @@ GEM
zeitwerk (2.6.12)

PLATFORMS
ruby
x86_64-darwin-23
x86_64-linux
x86_64-linux-musl
Expand Down Expand Up @@ -591,7 +589,7 @@ DEPENDENCIES
multi_json
mysql2
net-ftp (~> 0.2.0)
net-http
net-http (~> 0.3.2)
newrelic_rpm
oj
omniauth
Expand All @@ -618,6 +616,7 @@ DEPENDENCIES
select2-rails
selenium-webdriver
simplecov
simplecov-cobertura
sprockets-rails
stackprof
stimulus-rails
Expand Down
33 changes: 29 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
### Configuration
# Run ontologies_web_ui

## Using OntoPortal UI utilities script
### See help

```bash
bin/ontoportal help
```

```
cp .env.sample .env
Usage: bin/ontoportal {dev|test|run|help} [--reset-cache] [--api-url API_URL] [--api-key API_KEY]
dev : Start the Ontoportal Web UI development server.
Example: bin/ontoportal dev --api-url http://localhost:9393 --api-key my_api_key
Use --reset-cache to remove volumes: bin/ontoportal dev --reset-cache
test : Run tests. Specify either a test file:line_number or empty for 'all'.
Example: $0 test test/integration/login_flows_test.rb:22
run : Run a command in the Ontoportal Web UI Docker container.
help : Show this help message.
Description:
This script provides convenient commands for managing an Ontoportal Web UI
application using Docker Compose. It includes options for starting the development server,
running tests, and executing commands within the Ontoportal Web UI Docker container.
Goals:
- Simplify common tasks related to Ontoportal Web UI development using Docker.
- Provide a consistent and easy-to-use interface for common actions.
```


### Run dev
```bash
bin/ontoportal dev
bin/ontoportal dev --api-url <an ontoportal api url> --api-key <my_api_key>
```

### Run test with a local OntoPortal API
### Run test with a local OntoPortal API
```bash
bin/ontoportal test
```
Expand Down
4 changes: 4 additions & 0 deletions app/assets/images/icons/law.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/layout/asc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/layout/desc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions app/assets/stylesheets/bioportal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,32 @@ body{

}

.disabled-link{
color: #888888 !important;
span{
opacity: 0.6;
}
a {
color: #888888 !important;
}
svg path{
fill: #888888 !important;
}
}
.text-truncate-scroll{
overflow: scroll;
white-space: nowrap;
}


.bg-warning-light{
background-color: var(--bg-warning-light-color) !important;
}

.bg-danger-light{
background-color: var(--bg-danger-light-color) !important;
}

@keyframes gradient {
0% {
background-position: 0% 50%;
Expand Down
14 changes: 7 additions & 7 deletions app/assets/stylesheets/components/alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,26 @@
align-items: center;
padding: 20px;
border-radius: 5px;


}

.alert-container.alert-info-type{
background-color: rgba(59, 130, 246, 0.1);
background-color: var(--bg-info-light-color);
}
.alert-container.alert-warning-type {
background-color: rgba(234, 179, 8, 0.1);
background-color: var(--bg-warning-light-color);
}
.alert-container.alert-danger-type {
background-color: rgba(239, 68, 68, 0.1);
background-color: var(--bg-danger-light-color);
}
.alert-container.alert-success-type {
background-color: rgba(34, 197, 94, 0.1);
background-color: var(--bg-success-light-color);
}





.alert-message{
font-size: 16px;
margin: 0 10px;
Expand All @@ -43,8 +45,6 @@
}




.alert-icon svg{
width: 25px;
margin: 0 !important;
Expand Down
11 changes: 10 additions & 1 deletion app/assets/stylesheets/theme-variables.scss.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
--primary-color: #5499a4;
--hover-color: #6B96B7;
--secondary-color: #ffc107;
--light-color: #F0F5F6;
--admin-color: #145FF4;
--light-color: #F1F6FA;
--error-color: #EB4335;
Expand All @@ -44,6 +43,16 @@



// common variables
:root{
--container-max-width: 1248px;
--bg-info-light-color: rgba(59, 130, 246, 0.1);
--bg-danger-light-color: rgba(239, 68, 68, 0.1);
--bg-warning-light-color: rgba(234, 179, 8, 0.1);
--bg-success-light-color: rgba(34, 197, 94, 0.1);
}





4 changes: 2 additions & 2 deletions app/components/agent_search_input_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

class AgentSearchInputComponent < ViewComponent::Base

def initialize(id:, agent_type: nil, name_prefix: nil, parent_id: , edit_on_modal: false, deletable: false)
super
def initialize(id:, agent_type: nil, name_prefix: nil, parent_id: , show_affiliations: true, edit_on_modal: false, deletable: false)
@id = id
@agent_type = agent_type
@name_prefix = name_prefix
@parent_id = parent_id
@edit_on_modal = edit_on_modal
@show_affiliations = show_affiliations
@deletable = deletable
end
end
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
= render SearchInputComponent.new(name:'agent' + @id, ajax_url: "/ajax/agents?agent_type=#{@agent_type}&name=",
= hidden_field_tag "#{@name_prefix}[#{@id}]"
= render SearchInputComponent.new(id: 'agent' + @id, name:'agent' + @id, ajax_url: "/ajax/agents?agent_type=#{@agent_type}&name=",
item_base_url:"/agents/#{@id}?parent_id=#{@parent_id}&edit_on_modal=#{@edit_on_modal}&name_prefix=#{@name_prefix}&deletable=#{@deletable}&agent_id=", id_key: 'id',
use_cache: false,
actions_links: {create_new_agent: {link: "/agents/new?name=&id=#{@id}&parent_id=#{@parent_id}&new_agent=false&type=#{@agent_type}&show_affiliations=false&edit_on_modal=#{@edit_on_modal}&name_prefix=#{@name_prefix}[#{@id}]", target:'_self'}}) do |s|
actions_links: {create_new_agent: {link: "/agents/new?name=&id=#{@id}&parent_id=#{@parent_id}&type=#{@agent_type}&show_affiliations=#{@show_affiliations}&deletable=#{@deletable}&edit_on_modal=#{@edit_on_modal}&name_prefix=#{@name_prefix}[#{@id}]", target:'_self'}}) do |s|
- s.template do
%a{href: "LINK", class: "search-content", 'data-turbo-frame': '_self'}
%p.search-element.home-searched-ontology
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- if @type == "static"
%span.chip_button_container{@html_options}
= @text || content
%span.chip_button_container{@html_options}
= @text || content
- else
%a.chip_button_container_clickable{@html_options}= @text || content
%span.chip_button_container_clickable{@html_options}
= @text || content
8 changes: 5 additions & 3 deletions app/components/input/select_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@

class Input::SelectComponent < Input::InputFieldComponent

def initialize(id: nil, label: '', name:, value: [], selected: '', placeholder: '', error_message: '', helper_text: '', multiple: false, open_to_add_values: false, data: {}, tooltip: nil)
def initialize(id: nil, label: '', name:, value: [], selected: '', placeholder: '', error_message: '', helper_text: '', multiple: false, open_to_add_values: false, required: false, data: {}, tooltip: nil)
super(label: label, name: name, value: value, placeholder: placeholder, error_message: error_message,
helper_text: helper_text, data: data)
@values = value
@selected = selected
@open_to_add_values = open_to_add_values
@multiple = multiple
@id = id
@required = required
end

def call
render Input::InputFieldComponent.new(name: @name, error_message: @error_message, helper_text: @helper_text, label: @label) do
render SelectInputComponent.new(id: @id, name: @name, values: @values, selected: @selected,
placeholder: @placeholder,
multiple: @multiple, open_to_add_values: @open_to_add_values, data: @data)
placeholder: @placeholder, required: @required,
multiple: @multiple, open_to_add_values: @open_to_add_values,
data: @data)
end
end
end
2 changes: 1 addition & 1 deletion app/components/layout/horizontal_list_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def call
content_tag(:div, class: 'd-flex flex-wrap align-items-center') do
out = ''
elements.each do |element|
out = out + content_tag(:div, element, class: 'mr-1 mb-1 text-truncate overflow-hidden')
out = out + content_tag(:div, element, class: 'mr-1 mb-1 text-truncate-scroll')
end
raw out
end
Expand Down
Loading

0 comments on commit 6f41921

Please sign in to comment.