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
Fixes #5858,bz 109961 - Updated cv published content count #4467
Conversation
| versionIds = _.map($scope.contentView.versions, function(ver) { | ||
| return ver.id; | ||
| }), | ||
| versionIndex = _.indexOf(versionIds, version.id); |
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 could use the native versionIds.indexOf(version.id) here.
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.
ContentViewVersion.get is an async operation. You'll want to put the update logic into a then function to ensure that new version has been loaded from the server properly.
After a content view is published, the package/errata counts of the newly created content view version was not getting updated in the ui. This commit aims to fix that by forcefully reloading that specific version of the content view when the publish is completed.
| @@ -106,6 +109,18 @@ angular.module('Bastion.content-views').controller('ContentViewDetailsController | |||
| .replace('%ver', version.version); | |||
| } | |||
|
|
|||
| function updateVersion(version) { | |||
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 would change this to pass in the versions.
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.
Not as straight forward because there are 2 "versions" objects that need to be in sync .
$scope.contentView.versions[versionIndex] = newVersion;
$scope.versions[versionIndex] = newVersion;
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.
Why are we managing two separate sets of the same information?
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.
@ehelms theres some code in content-views/deletion/content-view-deletion.controller.js that is relying on this versions variable to be set with code that looks like,
if ($scope.versions === undefined) {
$scope.reloadVersions();
}
and other references. This PR may not be the right place to remove these references.. That being said I can look into it further if you want me to play with changing the versions references in all the sub controllers and testing em..
|
ACK from me, tested and worked great |
|
ACK |
Fixes #5858,bz 109961 - Updated cv published content count
After a content view is published, the package/errata counts of the
newly created content view version was not getting updated in the ui.
This commit aims to fix that by forcefully reloading that specific
version of the content view when the publish is completed.