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 #28781 - Disable Auto attach on Host #8529

Merged
merged 7 commits into from Jan 28, 2020

Conversation

parthaa
Copy link
Contributor

@parthaa parthaa commented Jan 16, 2020

This commit does a couple of things

  1. It disables auto attach setup in Simple Content Access enabled orgs.
  2. It sets it auto attach status to 'Not Applicable'
  3. Changed contentAccessMode=== 'org_enviroment' to
    'simpleContentAccessEnabled' when Simple Content Access is enabled.

@theforeman-bot
Copy link

Issues: #28781

This commit does a couple of things
1) It disables auto attach setup in Simple Content Access enabled orgs.
2) It sets it auto attach status to 'Not Applicable'
3) Changed contentAccessMode=== 'org_enviroment' to
   'simpleContentAccessEnabled' when Simple Content Access is enabled.
@sseelam2
Copy link
Member

I am seeing the content access mode banner for hosts and host collections which are not simple content enabled.

@parthaa
Copy link
Contributor Author

parthaa commented Jan 21, 2020

I am seeing the content access mode banner for hosts and host collections which are not simple content enabled.

ah found the issue. good catch :) . Updated the PR. This should not occur anymore

@@ -7,7 +7,7 @@ describe('Directive: contentAccessModeBanner', function() {
));

beforeEach(module(function($provide) {
$provide.value('contentAccessMode', 'org_environment');
$provide.value('simContentAccessEnabled', true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'simple' :)

@@ -82,12 +82,12 @@ <h4 translate>Subscriptions</h4>
</dd>

<dt translate>Auto-Attach</dt>
<dd bst-edit-checkbox="host.subscription_facet_attributes.autoheal"
<dd ng-if= "simpleContentAccessEnabled" translate> Not Applicable </dd>
<dd ng-if= "!simpleContentAccessEnabled" bst-edit-select="host.subscription_facet_attributes.autoheal"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@parthaa I see Not Applicable for hosts which are not simple content access enabled. I feel that this is incorrect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I don't see this behaviour. Can you pull and try again.

<span translate>Auto-Attach</span>
</button>

<p class="help-text" ng-show="table.numSelected === 0 && contentAccessMode != 'org_environment'">
<p class="help-text" ng-show="table.numSelected === 0 && !simpleContentAccessEnabled'">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@parthaa There is an unbalanced single quote near simpleContentAccessEnabled which is breaking the functionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@@ -18,7 +18,7 @@
angular.module('Bastion.features').value('FeatureSettings', angular.fromJson(<%= SETTINGS[:features].nil? ? {} : SETTINGS[:features].to_json.html_safe %>));
angular.module('Bastion').value('currentLocale', '<%= I18n.locale %>');
angular.module('Bastion').value('CurrentOrganization', "<%= Organization.current.id if Organization.current %>");
angular.module('Bastion').value('contentAccessMode', "<%= Organization.current.try(:content_access_mode) if Organization.current %>");
angular.module('Bastion').value('simpleContentAccessEnabled', "<%= Organization.current.simple_content_access? if Organization.current %>")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a missing semi colon in this line and an extra space right before "<%= Organization.current.simple_content_access?

@@ -7,7 +7,7 @@ describe('Directive: contentAccessModeBanner', function() {
));

beforeEach(module(function($provide) {
$provide.value('contentAccessMode', 'org_environment');
$provide.value('simContentAccessEnabled', true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in line10 which is causing the tests to fail.

@sseelam2
Copy link
Member

Tested the functionality and it is working as expected in both Host and Host collections.

@@ -18,7 +18,7 @@
angular.module('Bastion.features').value('FeatureSettings', angular.fromJson(<%= SETTINGS[:features].nil? ? {} : SETTINGS[:features].to_json.html_safe %>));
angular.module('Bastion').value('currentLocale', '<%= I18n.locale %>');
angular.module('Bastion').value('CurrentOrganization', "<%= Organization.current.id if Organization.current %>");
angular.module('Bastion').value('contentAccessMode', "<%= Organization.current.try(:content_access_mode) if Organization.current %>");
angular.module('Bastion').value('simpleContentAccessEnabled', <%= Organization.current.simple_content_access? if Organization.current %>)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An extra space in front of <%= Organization and a semi-colon is missing in this statement. Just to be consistent :)
Apart from this the PR looks good.

@sseelam2
Copy link
Member

APJ 👍

Copy link
Member

@jturel jturel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM per Swetha's testing!

@parthaa parthaa merged commit 97589ec into Katello:master Jan 28, 2020
@parthaa parthaa deleted the auto-attach-golden branch January 28, 2020 20:53
jturel pushed a commit to jturel/katello that referenced this pull request Feb 28, 2020
* Fixes #28781 - Disable Auto attach on Host

This commit does a couple of things
1) It disables auto attach setup in Simple Content Access enabled orgs.
2) It sets it auto attach status to 'Not Applicable'
3) Changed contentAccessMode=== 'org_enviroment' to
   'simpleContentAccessEnabled' when Simple Content Access is enabled.

(cherry picked from commit 97589ec)
jturel pushed a commit that referenced this pull request Feb 28, 2020
* Fixes #28781 - Disable Auto attach on Host

This commit does a couple of things
1) It disables auto attach setup in Simple Content Access enabled orgs.
2) It sets it auto attach status to 'Not Applicable'
3) Changed contentAccessMode=== 'org_enviroment' to
   'simpleContentAccessEnabled' when Simple Content Access is enabled.

(cherry picked from commit 97589ec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants