-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5996 from stsewd/implement-ui-for-automation-rules
Implement UI for automation rules
- Loading branch information
Showing
17 changed files
with
920 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
readthedocs/builds/migrations/0012_add-predefined-match-arg-field.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.25 on 2019-11-05 23:54 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('builds', '0011_version-media-availability'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='versionautomationrule', | ||
name='predefined_match_arg', | ||
field=models.CharField(blank=True, choices=[('all-versions', 'Any version'), ('semver-versions', 'SemVer versions'), (None, 'Custom match')], default=None, help_text='Match argument defined by us, it is used if is not None, otherwise match_arg will be used.', max_length=255, null=True, verbose_name='Predefined match argument'), | ||
), | ||
migrations.AlterField( | ||
model_name='versionautomationrule', | ||
name='action', | ||
field=models.CharField(choices=[('activate-version', 'Activate version'), ('set-default-version', 'Set version as default')], help_text='Action to apply to matching versions', max_length=32, verbose_name='Action'), | ||
), | ||
migrations.AlterField( | ||
model_name='versionautomationrule', | ||
name='version_type', | ||
field=models.CharField(choices=[('branch', 'Branch'), ('tag', 'Tag'), ('external', 'External'), ('unknown', 'Unknown')], help_text='Type of version the rule should be applied to', max_length=32, verbose_name='Version type'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
readthedocs/projects/static-src/projects/js/automation-rules.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// TODO: use knockoutjs instead, and for new code as well. | ||
|
||
var $ = require('jquery'); | ||
|
||
function set_help_text(value) { | ||
var help_texts = { | ||
'all-versions': 'All versions will be matched.', | ||
'semver-versions': 'Versions incremented based on semantic versioning rules will be matched.', | ||
'': '' | ||
}; | ||
$('#id_predefined_match_arg').siblings('.helptext').text(help_texts[value]); | ||
} | ||
|
||
$(function () { | ||
var value = $('#id_predefined_match_arg').val(); | ||
if (value !== '') { | ||
$('#id_match_arg').parent().hide(); | ||
} | ||
set_help_text(value); | ||
|
||
$('#id_predefined_match_arg').bind('change', function (ev) { | ||
if (this.value === '') { | ||
$('#id_match_arg').parent().show(); | ||
} else { | ||
$('#id_match_arg').parent().hide(); | ||
} | ||
set_help_text(this.value); | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.