From 2397575c0405fab3a9763f363178d7ac059dc5f2 Mon Sep 17 00:00:00 2001 From: Liv Dywan Date: Mon, 23 Sep 2024 16:58:14 +0200 Subject: [PATCH] Remove deprecated legacy job group view The old view has been deprecated 5 years ago. Related: https://progress.opensuse.org/issues/166310#note-14 --- assets/javascripts/job_templates.js | 6 -- .../WebAPI/Controller/Admin/JobTemplate.pm | 3 - .../webapi/admin/job_template/index.html.ep | 56 ------------------- 3 files changed, 65 deletions(-) diff --git a/assets/javascripts/job_templates.js b/assets/javascripts/job_templates.js index 362a2f2b502..c611cd4902e 100644 --- a/assets/javascripts/job_templates.js +++ b/assets/javascripts/job_templates.js @@ -3,12 +3,6 @@ var job_group_id; var user_is_admin; var editor; -function setupJobTemplates(url, id) { - job_templates_url = url; - job_group_id = id; - $.ajax(url + '?group_id=' + id).done(loadJobTemplates); -} - function loadJobTemplates(data) { var mediagroups = {}; var groups = []; diff --git a/lib/OpenQA/WebAPI/Controller/Admin/JobTemplate.pm b/lib/OpenQA/WebAPI/Controller/Admin/JobTemplate.pm index 3e2ccdf6d86..242e73f3177 100644 --- a/lib/OpenQA/WebAPI/Controller/Admin/JobTemplate.pm +++ b/lib/OpenQA/WebAPI/Controller/Admin/JobTemplate.pm @@ -12,12 +12,9 @@ sub index { return $self->reply->not_found unless $group; my $yaml = $group->template; - my $force_yaml_editor - = defined $yaml || $schema->resultset('JobTemplates')->search({group_id => $group->id}, {rows => 1})->count == 0; $self->stash( group => $group, yaml_template => $yaml, - force_yaml_editor => $force_yaml_editor, ); my @machines = $schema->resultset('Machines')->search(undef, {order_by => 'name'}); diff --git a/templates/webapi/admin/job_template/index.html.ep b/templates/webapi/admin/job_template/index.html.ep index 9280263e119..f69d6615e61 100644 --- a/templates/webapi/admin/job_template/index.html.ep +++ b/templates/webapi/admin/job_template/index.html.ep @@ -6,41 +6,15 @@ % title 'Job templates for ' . $group->name; -% unless ($force_yaml_editor) { -
- The old job group view is deprecated and will be removed from - future versions of openQA. Please save the job templates in YAML - format as soon as possible. -
-% } - % content_for 'ready_function' => begin user_is_admin = <%= is_admin_js %>; - % if ($force_yaml_editor) { toggleTemplateEditor(); - % } - % else { - setupJobTemplates("<%= url_for('apiv1_job_templates') %>", <%= $group->id %>); - % } $('#expand-template').click(function() { submitTemplateEditor('expand'); }); $('#preview-template').click(function() { submitTemplateEditor('preview'); }); $('#save-template').click(function() { submitTemplateEditor('save'); }); % end
- % if (!$force_yaml_editor) { - - % }