diff --git a/client/directives/modals/modalChooseOrganization/chooseOrganizationModalController.js b/client/directives/modals/modalChooseOrganization/chooseOrganizationModalController.js index 817695a26..25801b606 100644 --- a/client/directives/modals/modalChooseOrganization/chooseOrganizationModalController.js +++ b/client/directives/modals/modalChooseOrganization/chooseOrganizationModalController.js @@ -35,6 +35,7 @@ function ChooseOrganizationModalController( $rootScope.featureFlags = featureFlags.flags; COMC.allAccounts = grantedOrgs; COMC.whitelistedOrgs = whitelistedOrgs; + COMC.personalAccountOnly = whitelistedOrgs.length === 1; COMC.demoOrg = null; COMC.defaultBasePanel = 'orgSelection'; diff --git a/client/directives/modals/modalChooseOrganization/orgSelectModalView.jade b/client/directives/modals/modalChooseOrganization/orgSelectModalView.jade index a7aef4423..3fff1493f 100644 --- a/client/directives/modals/modalChooseOrganization/orgSelectModalView.jade +++ b/client/directives/modals/modalChooseOrganization/orgSelectModalView.jade @@ -4,10 +4,10 @@ .grid-block.vertical.org-select-view p.p( - ng-if = "!$root.featureFlags.noOrgs" + ng-if = "!COMC.personalAccountOnly" ) Select your team to get started. ol.grid-block.vertical.list( - ng-if = "!$root.featureFlags.noOrgs" + ng-if = "!COMC.personalAccountOnly" ) li.grid-block.align-center.list-item.btn.white( data-event-name = "Org Selected" @@ -26,10 +26,10 @@ xlink:href = "#icons-arrow-down" ) p.p( - ng-if = "!$root.featureFlags.noOrgs" + ng-if = "!COMC.personalAccountOnly" ) Don’t see your team? p.p( - ng-if = "$root.featureFlags.noOrgs" + ng-if = "COMC.personalAccountOnly" ) Runnable is made for teams, br | but you haven’t added any yet. diff --git a/client/services/featureFlagService.js b/client/services/featureFlagService.js index 8db74fc46..ab9c72615 100644 --- a/client/services/featureFlagService.js +++ b/client/services/featureFlagService.js @@ -48,7 +48,6 @@ function featureFlags( newUserPrompt: false, // modal for new users nextPayment: false, // show the next payment date under payment summary noBuildLogs: true, - noOrgs: false, // if no organizations have been authorized optionsInModal: false, // allows delete in modal personalAccounts: true, // allows users with personal accounts to create Runnable teams personalAccountsPhase2: true, diff --git a/test/unit/directives/modals/chooseOrganizationModal/chooseOrganizationModalController.unit.js b/test/unit/directives/modals/chooseOrganizationModal/chooseOrganizationModalController.unit.js index 4cb5fa397..0fc06dd0b 100644 --- a/test/unit/directives/modals/chooseOrganizationModal/chooseOrganizationModalController.unit.js +++ b/test/unit/directives/modals/chooseOrganizationModal/chooseOrganizationModalController.unit.js @@ -191,6 +191,20 @@ describe('ChooseOrganizationModalController', function () { }); }); + describe('Personal accounts', function () { + it('should set true if there is one account', function () { + initialize(); + setup(); + expect(COMC.personalAccountOnly).to.equal(true); + }); + it('should set false if there is more than one account', function () { + initialize(); + mockWhitelistedOrgs = [codenowWhitelistedOrg, 0] + setup(); + expect(COMC.personalAccountOnly).to.equal(false); + }); + }) + describe('Polling stuff', function () { beforeEach(function () { initialize();