Skip to content

Commit

Permalink
disable the agent delete button if the agent is used
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Nov 27, 2023
1 parent b9bb256 commit 678d7da
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests-system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,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 Down
2 changes: 1 addition & 1 deletion .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 Down
6 changes: 5 additions & 1 deletion app/views/agents/_show_line.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@
%span.mx-1
= link_to_agent_edit_modal(agent)
%span
= button_to "Delete", CGI.unescape(agent_path(agent.id.split('/').last)), method: :delete, class: 'btn btn-link', form: {data: { turbo: true, turbo_confirm: "Are you sure?", turbo_frame: '_top'}}
- if count.zero?
= button_to "Delete", CGI.unescape(agent_path(agent.id.split('/').last)), method: :delete, class: 'btn btn-link', form: {data: { turbo: true, turbo_confirm: "Are you sure?", turbo_frame: '_top'}}
- else
%span{data: { controller: 'tooltip' }, title: "Can't delete this #{agent.agentType} because still used"}
= link_to "Delete", "", class: 'btn btn-link disabled'

0 comments on commit 678d7da

Please sign in to comment.