-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add repository CRUD #346
Add repository CRUD #346
Conversation
6e1f411
to
c34e516
Compare
37f074f
to
b1c1855
Compare
6ec2d67
to
52d1630
Compare
fc47314
to
d1aa247
Compare
@ZitaNemeckova validation message on URL field on form should show in Red, currently it is showing in grey text. |
@ZitaNemeckova title header on the downloaded repo summary should say "Repository" Title header on Edit repository form needs to be fixed too. |
message = __("Unable to add Repository ") + vm.repositoryModel.name + " ." + response.results[0].message; | ||
} | ||
else { | ||
message = sprintf(__("Addition of Repository \"%s\" was successfully initialized."), vm.repositoryModel.name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change this to "Add of ..." to make it consistent with other forms in UI
message = __("Unable to update Repository") + vm.repositoryModel.name + " ." + response.message; | ||
} | ||
else { | ||
message = sprintf(__("Update of Repository \"%s\" was successfully initialized."), vm.repositoryModel.name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here "Edit of ..." to be consistent
AnsibleRepositoryController.model.where(:id => checked).each do |repo| | ||
begin | ||
repo.delete_in_provider_queue | ||
add_flash(_("Deletion of Repository \"%{name}\" was successfully initiated.") % {:name => repo.name}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this to "Delete of ..."
}; | ||
|
||
$scope.cancelClicked = function() { | ||
var message = repositoryId === 'new' ? __("Addition of Repository canceled by user.") : sprintf(__("Addition of Repository \"%s\" canceled by user."), vm.repositoryModel.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be "Add of Repository cancelled by user." : "Edit of Repository "%s" cancelled by user."
options_for_select([["#{_('GIT')}", "git"]], 'git'), | ||
"ng-model" => "vm.repositoryModel.scm_type", | ||
:disabled => true) | ||
.form-group |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to add a class here to get validation message to show in red color
.form-group{"ng-class" => "{'has-error': angularForm.scm_url.$invalid}"}
@ZitaNemeckova can you also address code climate errors, most of them look easy to address. I was successfully able to add/edit/delete repositories 👍 |
@h-kataria PDF issue addressed in ManageIQ/manageiq#14485 |
487426f
to
adfae8a
Compare
Codeclimate failures related to using |
e51eaa7
to
2b70bdd
Compare
@h-kataria I will add them in separate PR due to time pressure. |
Url validation needed because default ng url validation was positive for any web protocol but it was needed to be positive only for http or https
2b70bdd
to
3c4b3c4
Compare
@jameswnl Please review. I think you are most familiar with this from the provider side. |
:javascript | ||
ManageIQ.angular.app.value('repositoryId', '#{@id}'); | ||
miq_bootstrap('#form_div'); | ||
$("#form-div").submit(function (e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is broken since you should never be submitting the form (old-style) .. Better to just put miqSparkleOn()
in addClicked
and saveClicked
.
|
||
$scope.addClicked = function() { | ||
API.post('/api/configuration_script_sources/', vm.repositoryModel) | ||
.then(getBack) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 spaces, not three please
}; | ||
|
||
var validUrl = function(s) { | ||
debugger; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wink wink, nudge nudge
(travis failure unrelated - gitter March 24, 2017 5:54 PM) |
scm_type: 'git', | ||
manager_resource: {}, | ||
scm_url: '', | ||
scm_credentials: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Potentially a silly question as I am not familiar with UI code)
There can be 0 or 1 scm_credential
associated with a repo/project
. Here the pluralized form, does it mean multiple values expected? Or it is the list of values to be selected from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jameswnl there are no stupid questions :) I must have missed some change because scm_credentials
no longer exists and there's authentication_id
instead. Thanks :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, feel good to be useful in UI land 😄
@miq-bot remove_label wip |
4a4c362
to
1c965d1
Compare
c4bc261
to
42cee8f
Compare
14aafe3
to
0682857
Compare
Checked commits ZitaNemeckova/manageiq-ui-classic@a727871~...b905166 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/helpers/application_helper/toolbar/ansible_repositories_center.rb
app/helpers/application_helper/toolbar/ansible_repository_center.rb
|
@ZitaNemeckova merging this PR, please add jasmine spec tests in an additional PR. |
New functionality for Repository in Automation -> Ansible -> Repositories.
Added Configuration button in toolbar with Add/Edit/Delete options.
Add form:
Edit form:
@miq-bot add_label wip
TODO:
manager_id
http://
prefix in URL