Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions apps/dashboard/app/javascript/workflows.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ class WorkflowState {
this.job_hash = {};
}

resetWorkflow(e) {
clearWorkflow() {
this.boxes.forEach(b => b.el.remove());
this.boxes.clear();
this.edges.forEach(e => e.el.remove());
this.edges.length = 0;
this.dag.reset();
this.pointer.resetZoom();
this.#clearSession();
alert('Workflow reset.');
}

saveToSession() {
Expand Down Expand Up @@ -529,7 +528,8 @@ class DragController {
const zoomResetButton = document.getElementById('zoom-reset');
const selectedLauncher = document.getElementById('select_launcher');
const submitWorkflowButton = document.getElementById('btn-submit-workflow');
const resetWorkflowButton = document.getElementById('btn-reset-workflow');
const restoreWorkflowButton = document.getElementById('btn-restore-workflow');
const clearWorkflowButton = document.getElementById('btn-clear-workflow');
const saveWorkflowButton = document.getElementById('btn-save-workflow');
const projectId = document.getElementById('project-id').value;
const workflowId = document.getElementById('workflow-id').value;
Expand Down Expand Up @@ -806,10 +806,12 @@ class DragController {
deleteLauncherButton.addEventListener('click', deleteSelectedLauncher);
deleteEdgeButton.addEventListener('click', deleteSelectedEdge);

submitWorkflowButton.addEventListener('click', debounce(async () => {
await workflowState.saveToBackend(true);
submitWorkflowButton.addEventListener('click', debounce(() => workflowState.saveToBackend(true), 300));
restoreWorkflowButton.addEventListener('click', debounce(() => {
workflowState.clearWorkflow();
workflowState.restorePreviousState(makeLauncher, createEdge);
}, 300));
resetWorkflowButton.addEventListener('click', debounce(e => workflowState.resetWorkflow(e), 300));
clearWorkflowButton.addEventListener('click', debounce(() => workflowState.clearWorkflow(), 300));
saveWorkflowButton.addEventListener('click', debounce(() => workflowState.saveToBackend(), 300));

zoomInButton.addEventListener('click', () => { pointer.zoomIn(); });
Expand Down
5 changes: 3 additions & 2 deletions apps/dashboard/app/views/workflows/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
<button id="btn-delete-edge" class="danger" title="Delete selected edge (Del/Backspace)">Delete Edge</button>

<div class="workflow-actions">
<button id="btn-submit-workflow" class: 'btn btn-primary'><%= I18n.t('dashboard.jobs_workflow_submit') %></button>
<button id="btn-reset-workflow" class: 'btn btn-danger'><%= I18n.t('dashboard.reset') %></button>
<button id="btn-submit-workflow" class: 'btn btn-primary'><%= I18n.t('dashboard.submit') %></button>
<button id="btn-restore-workflow" class: 'btn btn-danger'><%= I18n.t('dashboard.restore') %></button>
<button id="btn-clear-workflow" class: 'btn btn-danger'><%= I18n.t('dashboard.clear') %></button>
<button id="btn-save-workflow" class: 'btn btn-info'><%= I18n.t('dashboard.save') %></button>
<%= link_to I18n.t('dashboard.back'), project_path(params[:project_id]), class: 'btn btn-default', title: 'Return to projects page' %>
<span class="hint">Click title to select and drag. Connect via clicking two launchers.</span>
Expand Down
4 changes: 3 additions & 1 deletion apps/dashboard/config/locales/en-CA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ en-CA:
breadcrumbs_home: Home
breadcrumbs_my_sessions: My Interactive Sessions
breadcrumbs_support_ticket: Support Ticket
clear: Clear
close: Close
custom_pages:
invalid: 'Invalid page code: %{page}. This page has not been configured'
Expand Down Expand Up @@ -203,7 +204,6 @@ en-CA:
jobs_workflow_name_placeholder: Workflow name
jobs_workflow_name_validation: Workflow name may only contain letters, digits, dashes, underscores, and spaces
jobs_workflow_not_found: Cannot find workflow %{workflow_id}
jobs_workflow_submit: Submit Workflow
jobs_workflow_submitted: Workflow successfully submitted!
jobs_workflows: Workflows
launch: Launch
Expand Down Expand Up @@ -255,6 +255,7 @@ en-CA:
recently_used_apps_title: Recently Used Apps
remove: Remove
reset: Reset
restore: Restore
restart_msg_html: |
Your group membership has changed, which affects your access to apps. Your dashboard should restart automatically.
If it doesn't please, click: <a href="%{restart_url}">restart web server</a>.
Expand Down Expand Up @@ -282,6 +283,7 @@ en-CA:
skip_navigation: Skip Navigation
soft_tabs: Soft Tabs
soft_tabs_info: Soft tabs are spaces in the file instead of actual tab characters.
submit: Submit
support_ticket:
creation_success: 'Support ticket email sent to: %{to}'
generic_error: 'There was an error processing your request: %{error}'
Expand Down
4 changes: 3 additions & 1 deletion apps/dashboard/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ en:
breadcrumbs_home: Home
breadcrumbs_my_sessions: My Interactive Sessions
breadcrumbs_support_ticket: Support Ticket
clear: Clear
close: Close
custom_pages:
invalid: 'Invalid page code: %{page}. This page has not been configured'
Expand Down Expand Up @@ -206,7 +207,6 @@ en:
jobs_workflow_name_placeholder: Workflow name
jobs_workflow_name_validation: Workflow name may only contain letters, digits, dashes, underscores, and spaces
jobs_workflow_not_found: Cannot find workflow %{workflow_id}
jobs_workflow_submit: Submit Workflow
jobs_workflow_submitted: Workflow successfully submitted!
jobs_workflows: Workflows
launch: Launch
Expand Down Expand Up @@ -258,6 +258,7 @@ en:
recently_used_apps_title: Recently Used Apps
remove: Remove
reset: Reset
restore: Restore
restart_msg_html: |
Your group membership has changed, which affects your access to apps. Your dashboard should restart automatically.
If it doesn't please, click: <a href="%{restart_url}">restart web server</a>.
Expand Down Expand Up @@ -285,6 +286,7 @@ en:
skip_navigation: Skip Navigation
soft_tabs: Soft Tabs
soft_tabs_info: Soft tabs are spaces in the file instead of actual tab characters.
submit: Submit
support_ticket:
creation_success: 'Support ticket email sent to: %{to}'
generic_error: 'There was an error processing your request: %{error}'
Expand Down
1 change: 0 additions & 1 deletion apps/dashboard/config/locales/fr-CA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ fr-CA:
jobs_workflow_name_placeholder: Nom du flux de travail
jobs_workflow_name_validation: Le nom du flux de travail ne peut contenir que des lettres, des chiffres, des tirets, des traits de soulignement et des espaces
jobs_workflow_not_found: Impossible de trouver le flux de travail %{workflow_id}
jobs_workflow_submit: Soumettre le flux de travail
jobs_workflow_submitted: Flux de travail soumis avec succès !
jobs_workflows: Flux de travail
launch: Lancer
Expand Down
1 change: 0 additions & 1 deletion apps/dashboard/config/locales/ja_JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ ja_JP:
jobs_workflow_name_placeholder: ワークフロー名
jobs_workflow_name_validation: ワークフロー名には、文字、数字、ダッシュ、アンダースコア、スペースのみを含めることができます
jobs_workflow_not_found: ワークフロー %{workflow_id} が見つかりません
jobs_workflow_submit: ワークフローを送信
jobs_workflow_submitted: ワークフローが正常に送信されました!
jobs_workflows: ワークフロー
launch: 起動
Expand Down
1 change: 0 additions & 1 deletion apps/dashboard/config/locales/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ zh-CN:
jobs_workflow_name_placeholder: 工作流名称
jobs_workflow_name_validation: 工作流名称只能包含字母、数字、短横线、下划线和空格
jobs_workflow_not_found: 找不到工作流 %{workflow_id}
jobs_workflow_submit: 提交工作流
jobs_workflow_submitted: 工作流提交成功!
jobs_workflows: 工作流
launch: 启动
Expand Down