Skip to content

Commit

Permalink
Merge pull request #517 from Real-Dev-Squad/featureflag_removal
Browse files Browse the repository at this point in the history
Removed feature flag for cancel OOO
  • Loading branch information
shubhamsinghbundela authored Nov 7, 2023
2 parents b6078ed + e48b02d commit ee53203
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 35 deletions.
2 changes: 0 additions & 2 deletions app/components/user-status.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
{{#each this.currentUserStatus as |currentStatus|}}
{{#if (eq @status currentStatus.status)}}
{{#if (eq currentStatus.status "OOO")}}
{{#if @dev}}
<button
data-test-cancel-status-OOO
class='buttons__cancel--ooo'
Expand All @@ -37,7 +36,6 @@
>
<span>Cancel OOO</span>
</button>
{{/if}}
{{else}}
{{#each currentStatus.otherAvailableStatus as |otherPossibleStatus|}}
<button data-test-update-status-OOO class={{otherPossibleStatus.class}} type="button" disabled={{@isStatusUpdating}} {{on "click" (fn this.changeStatus otherPossibleStatus.status )}}>
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,11 @@ const BASE_URL = ENV.BASE_API_URL;

export default class IndexController extends Controller {
@service toast;
@service featureFlag;
@tracked status = this.model;
@tracked isStatusUpdating = false;
@tracked showUserStateModal = false;
@tracked newStatus;

get isDevMode() {
return this.featureFlag.isDevMode;
}

@action toggleUserStateModal() {
this.showUserStateModal = !this.showUserStateModal;
}
Expand Down
1 change: 0 additions & 1 deletion app/templates/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<UserStatus
@status={{this.status}}
@changeStatus={{this.changeStatus}}
@dev={{this.isDevMode}}
@isStatusUpdating={{this.isStatusUpdating}}
@updateStatus={{this.updateStatus}}
/>
Expand Down
28 changes: 1 addition & 27 deletions tests/integration/components/user-status-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,42 +50,18 @@ module('Integration | Component | user-status', function (hooks) {
.hasText('Change your status to OOO');
});

test('show relevant data when status is OOO and not have feature flag', async function (assert) {
test('show relevant data when status is OOO', async function (assert) {
this.setProperties({
status: 'OOO',
isStatusUpdating: false,
changeStatus: () => {},
updateStatus: () => {},
dev: false,
});

await render(hbs`
<UserStatus
@status={{this.status}}
@changeStatus={{this.changeStatus}}
@dev={{this.dev}}
@isStatusUpdating={{this.isStatusUpdating}}
@updateStatus={{this.updateStatus}}
/>
`);

assert.dom('[data-test-status]').hasText(`You are OOO`);
});

test('show relevant data when status is OOO and have feature flag', async function (assert) {
this.setProperties({
status: 'OOO',
isStatusUpdating: false,
changeStatus: () => {},
updateStatus: () => {},
dev: true,
});

await render(hbs`
<UserStatus
@status={{this.status}}
@changeStatus={{this.changeStatus}}
@dev={{this.dev}}
@isStatusUpdating={{this.isStatusUpdating}}
@updateStatus={{this.updateStatus}}
/>
Expand All @@ -105,15 +81,13 @@ module('Integration | Component | user-status', function (hooks) {
const { cancelOoo } = cancelOOOPayload;
assert.equal(cancelOoo, true, 'cancel OOO status');
},
dev: true,
});

await render(hbs`
<UserStatus
@status={{this.status}}
@changeStatus={{this.changeStatus}}
@isStatusUpdating={{this.isStatusUpdating}}
@dev={{this.dev}}
@updateStatus={{this.updateStatus}}
/>
`);
Expand Down

0 comments on commit ee53203

Please sign in to comment.