Skip to content

Commit

Permalink
Remove deprecated legacy job group view
Browse files Browse the repository at this point in the history
The old view has been deprecated 5 years ago.

Related: https://progress.opensuse.org/issues/166310#note-14
  • Loading branch information
kalikiana committed Sep 23, 2024
1 parent d8f5662 commit 2397575
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 65 deletions.
6 changes: 0 additions & 6 deletions assets/javascripts/job_templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
3 changes: 0 additions & 3 deletions lib/OpenQA/WebAPI/Controller/Admin/JobTemplate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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'});
Expand Down
56 changes: 0 additions & 56 deletions templates/webapi/admin/job_template/index.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,15 @@

% title 'Job templates for ' . $group->name;

% unless ($force_yaml_editor) {
<div class="alert alert-danger">
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.
</div>
% }

% 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

<form action="<%= url_for('admin_groups') %>" class="corner-buttons">
% if (!$force_yaml_editor) {
<button type="button" id="toggle-yaml-editor" class="btn btn-light" onclick="toggleTemplateEditor();">
<span>
<i class="fa fa-edit"></i>
% if (is_admin) {
Edit YAML
% }
% else {
Show YAML
% }
</span>
</button>
% }
<button type="button" id="toggle-group-properties" class="btn btn-light" onclick="toggleEdit();">
<span>
<i class="fa fa-edit"></i>
Expand Down Expand Up @@ -74,30 +48,6 @@
<a href="http://open.qa/docs/#_using_job_templates_to_automate_jobs_creation" target="blank">the documentation</a>
for more details.
</p>
% if (!$force_yaml_editor) {
<div id="media">
<p id="loading"><i class="fa fa-spinner fa-spin"></i> Loading…</p>

<select id="machines-template" multiple="true" disabled data-placeholder="None" style="display: none">
% for my $machine (@$machines) {
<option value="<%= $machine->name %>"
data-machine-id="<%= $machine->id %>" >
%= $machine->name
</option>
% }
</select>

<select id="tests-template" disabled style="display: none">
<option value="">Select…</option>
% for my $test (@$tests) {
<option value="<%= $test->name %>" data-test-id="<%= $test->id %>">
%= $test->name
</option>
% }
</select>

</div>
% }
<form action="#" id="editor-form" class="form-horizontal" style="display: none;"
data-put-url="<%= url_for('apiv1_job_templates_schedules' => (id => $group->id)) %>" data-reference="<%= $yaml_template %>">
<div class="row">
Expand Down Expand Up @@ -204,9 +154,3 @@ scenarios:
</div>
</div>
</form>

% if (!$force_yaml_editor && is_admin) {
<p>
<i class="fa fa-plus-square"></i> Please save as YAML to add new medium as part of this group
</p>
% }

0 comments on commit 2397575

Please sign in to comment.