Skip to content

Commit

Permalink
Merge pull request #1980 from CodeNow/show-org-select-conditionally
Browse files Browse the repository at this point in the history
This fixes an issue where the feature flag noOrgs was the only way to…
  • Loading branch information
henrymollman authored Jan 11, 2017
2 parents d3a69ea + 4b5d6dd commit 4d7eaa8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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.
Expand Down
1 change: 0 additions & 1 deletion client/services/featureFlagService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 4d7eaa8

Please sign in to comment.