Skip to content
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 #36373 - Add metadata expire option for custom repo to UI #10545

Merged
merged 1 commit into from May 10, 2023

Conversation

chris1984
Copy link
Member

@chris1984 chris1984 commented May 4, 2023

What are the changes introduced in this pull request?

What are the testing steps for this pull request?

  • Create a custom repo and set the metadata expiration
  • View the repo details and check if you can see and edit the custom repo metadata expire
  • View a RH repo to make sure the value is hidden

@theforeman-bot
Copy link

Issues: #36352

@chris1984
Copy link
Member Author

@parthaa updated

@parthaa
Copy link
Contributor

parthaa commented May 9, 2023

Suggested patch. Add the X clear option.

diff --git a/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js b/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js
index 30bc43fba8..ffb77b4263 100644
--- a/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js
+++ b/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js
@@ -232,6 +232,11 @@ angular.module('Bastion.repositories').controller('RepositoryDetailsInfoControll
                 $scope.save($scope.repository);
             };
 
+            $scope.clearMetadataExpire = function () {
+                $scope.repository['metadata_expire'] = null;
+                $scope.save($scope.repository);
+            };
+
             $scope.clearAnsibleCollectionAuth = function () {
                 $scope.repository['ansible_collection_auth_url'] = null;
                 $scope.repository['ansible_collection_auth_token'] = null;
diff --git a/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html b/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html
index 8b3e8e92e7..c12c1c4ddf 100644
--- a/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html
+++ b/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html
@@ -25,8 +25,10 @@
 
       <dt translate>Type</dt>
       <dd>{{ repository.content_type }}</dd>
-      <dt ng-if="product.redhat != true" translate>Metadata Expiration</dt>
-      <dd bst-edit-number="repository.metadata_expire" on-save="save(repository)" readonly="product.redhat || denied('edit_products', product)">
+      <dt ng-if="product.redhat != true" translate>Metadata Expiration (Seconds)</dt>
+      <dd bst-edit-number="repository.metadata_expire" on-save="save(repository)" readonly="product.redhat || denied('edit_products', product)"
+          deletable="repository.metadata_expire !== null"
+          on-delete="clearMetadataExpire()">
       </dd>
     </dl>

@chris1984
Copy link
Member Author

@parthaa updated

@chris1984 chris1984 changed the title Refs #36352 - Add metadata_expire to repo details page Fixes 36373 - Add metadata expire option for custom repo to UI May 9, 2023
@chris1984 chris1984 changed the title Fixes 36373 - Add metadata expire option for custom repo to UI Fixes #36373 - Add metadata expire option for custom repo to UI May 9, 2023
@chris1984 chris1984 merged commit 7f4aa62 into Katello:master May 10, 2023
5 checks passed
@chris1984 chris1984 deleted the patch branch May 10, 2023 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants