Skip to content

Commit

Permalink
hidden not needed popups (#577)
Browse files Browse the repository at this point in the history
* Removed fetch test green button

* Hidden green pop up

* Hide find task button

---------

Co-authored-by: Shubham Sharma <[email protected]>
  • Loading branch information
skv93-coder and Shubham Sharma authored Feb 20, 2024
1 parent 9901f9b commit f6fede8
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 33 deletions.
57 changes: 36 additions & 21 deletions app/components/task/modal.hbs
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
{{#if @showModal}}
<div class="overlay">
<div class="modal" data-test-modal>
<button type="button" class="close" {{on "click" @goBack}} disabled={{@closeDisabled}} data-test-closeBtn>
<i class="fa fa-close"></i>
</button>
<p class="modal-title" data-test-title>{{@message}}</p>
{{#if @isUpdating}}
<Spinner data-test-spinner />
{{/if}}
{{#if @buttonRequired}}
<button type="button" class={{if (eq @dev true) "not-assign" "proceed-btn" }} {{on "click" @markComplete}}
data-test-notAssignBtn>
{{if (eq @dev true) "Don't assign task" "Proceed" }}
</button>
{{#if @dev}}
<button type="button" class="proceed-btn" {{on "click" @markCompleteAndAssignTask}} data-test-assignBtn>
Assign task
</button>
{{/if}}
{{/if}}
<div class='overlay'>
<div class='modal' data-test-modal>
<button
type='button'
class='close'
{{on 'click' @goBack}}
disabled={{@closeDisabled}}
data-test-closeBtn
>
<i class='fa fa-close'></i>
</button>
<p class='modal-title' data-test-title>{{@message}}</p>
{{#if @isUpdating}}
<Spinner data-test-spinner />
{{/if}}
{{#if @buttonRequired}}
<button
type='button'
class='proceed-btn'
{{on 'click' @markComplete}}
data-test-notAssignBtn
>
Proceed
</button>
{{#if @dev}}
<button
type='button'
class='proceed-btn hidden'
{{on 'click' @markCompleteAndAssignTask}}
data-test-assignBtn
>
Assign task
</button>
{{/if}}
{{/if}}
</div>
</div>
</div>
{{/if}}
2 changes: 1 addition & 1 deletion app/components/tasks.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class='tasks-container'>
{{#if @dev}}
{{#if @noInProgressTask}}
<div class='fetch-task' data-test-fetchSection>
<div class='fetch-task hidden' data-test-fetchSection>
<p>You have no task in progress! click below to fetch tasks</p>
<Button
@onClick={{@handleAssignment}}
Expand Down
3 changes: 1 addition & 2 deletions app/constants/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ const TABS_TASK_STATUS_LIST = [
},
];
export const TASK_MESSAGES = {
MARK_DONE:
'This task will be marked as done and a new task will be assigned to you',
MARK_DONE: 'This task will be marked as Done',
UPDATE_TASK: 'Updating task',
FIND_TASK: 'Finding new task for you!',
};
Expand Down
3 changes: 3 additions & 0 deletions app/styles/tasks.css
Original file line number Diff line number Diff line change
Expand Up @@ -736,3 +736,6 @@ div.buttons {
align-content: center;
justify-content: center;
}
.hidden {
display: none;
}
4 changes: 2 additions & 2 deletions tests/integration/components/tasks-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { module, test } from 'qunit';
import { module, skip, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { find, render, waitUntil, fillIn } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
Expand All @@ -17,7 +17,7 @@ module('Integration | Component | tasks', function (hooks) {
assert.ok(this.element.textContent.trim().includes('tasks'));
});

test('there is a fetch task button if no in progress task are there', async function (assert) {
skip('there is a fetch task button if no in progress task are there', async function (assert) {
this.setProperties({
onTaskChange: () => {},
onTaskUpdate: () => {},
Expand Down
9 changes: 2 additions & 7 deletions tests/integration/components/tasks/modal-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ module('Integration | Component | tasks/modal', function (hooks) {
showModal: true,
buttonRequired: true,
dev: false,
message:
'This task will be marked as done and a new task will be assigned to you',
message: 'This task will be marked as Done',
});

await render(hbs`
Expand All @@ -219,11 +218,7 @@ module('Integration | Component | tasks/modal', function (hooks) {

assert.dom('[data-test-notAssignBtn]').exists();
assert.dom('[data-test-notAssignBtn]').hasProperty('button');
assert
.dom('[data-test-title]')
.hasText(
'This task will be marked as done and a new task will be assigned to you'
);
assert.dom('[data-test-title]').hasText('This task will be marked as Done');
assert.dom('[data-test-notAssignBtn]').hasText('Proceed');
});
});

0 comments on commit f6fede8

Please sign in to comment.