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

[Fix] - Task Card Enhacement (milestone-1) #510

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 44 additions & 13 deletions app/components/task-tabs.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,50 @@
{{if @showTasks "task-tabs__dropdown-active"}}'
>
{{#each @taskStatusList as |status|}}
<button
data-test-task-tabs-button
href='#'
class='task-tabs__dropdown-container__button
{{if
(eq @userSelectedTaskText status.displayLabel)
"task-tabs__dropdown-container__button-active"
}}'
{{on 'click' (fn @changeUserSelectedTask status)}}
type='button'
>
{{status.displayLabel}}
</button>
{{#if @dev}}

{{#if
(and
(not-eq status.key 'VERIFIED')
(not-eq status.key 'RELEASED')
(not-eq status.key 'REGRESSION_CHECK')
(not-eq status.key 'SANITY_CHECK')
(not-eq status.key 'APPROVED')
(not-eq status.key 'SMOKE_TESTING')
(not-eq status.key 'NEEDS_REVIEW')
)
}}
shubhamsinghbundela marked this conversation as resolved.
Show resolved Hide resolved
Pratiyushkumar marked this conversation as resolved.
Show resolved Hide resolved
<button
data-test-task-tabs-button
href='#'
class='task-tabs__dropdown-container__button
{{if
(eq @userSelectedTaskText status.displayLabel)
"task-tabs__dropdown-container__button-active"
}}'
{{on 'click' (fn @changeUserSelectedTask status)}}
type='button'
>
{{status.displayLabel}}
</button>
{{/if}}

{{else}}
<button
data-test-task-tabs-button
href='#'
class='task-tabs__dropdown-container__button
{{if
(eq @userSelectedTaskText status.displayLabel)
"task-tabs__dropdown-container__button-active"
}}'
{{on 'click' (fn @changeUserSelectedTask status)}}
type='button'
>
{{status.displayLabel}}
</button>
{{/if}}

{{/each}}
</div>
{{#unless @showTasks}}
Expand Down
61 changes: 48 additions & 13 deletions app/components/task/holder.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{{/if}}
{{/if}}

{{#if (not-eq this.status this.TASK_KEYS.VERIFIED)}}
{{#if (not-eq this.status this.TASK_KEYS.COMPLETED)}}
<div class='task-update-container'>
<label id='task-update-label' for='task-update'><b>Status:</b></label>
<select
Expand All @@ -41,24 +41,59 @@
>
{{#each this.availabletaskStatusList as |taskStatus|}}
{{#if (not-eq taskStatus.key this.TASK_KEYS.ALL)}}
<option
value={{taskStatus.key}}
selected={{eq taskStatus.key this.status}}
>
{{taskStatus.displayLabel}}
</option>
{{#if @dev}}
{{#if
(and
(not-eq taskStatus.key 'VERIFIED')
(not-eq taskStatus.key 'RELEASED')
(not-eq taskStatus.key 'REGRESSION_CHECK')
(not-eq taskStatus.key 'SANITY_CHECK')
(not-eq taskStatus.key 'APPROVED')
(not-eq taskStatus.key 'SMOKE_TESTING')
(not-eq taskStatus.key 'NEEDS_REVIEW')
)
}}
<option
value={{taskStatus.key}}
selected={{eq taskStatus.key this.status}}
>
{{taskStatus.displayLabel}}
</option>
{{/if}}

{{else}}
<option
value={{taskStatus.key}}
selected={{eq taskStatus.key this.status}}
>
{{taskStatus.displayLabel}}
</option>
{{/if}}

{{/if}}
{{/each}}
</select>
</div>
{{/if}}

<button
class='task-card__extensionForm-button'
data-test-task-extensionForm-button
type='button'
{{on 'click' this.toggleExtensionForm}}
>Extension Status</button>
{{#if @dev}}
{{#if (not-eq @task.status 'COMPLETED')}}
<button
class='task-card__extensionForm-button'
data-test-task-extensionForm-button
type='button'
{{on 'click' this.toggleExtensionForm}}
> Request Extension </button>
{{/if}}
{{else}}
<button
class='task-card__extensionForm-button'
data-test-task-extensionForm-button
type='button'
{{on 'click' this.toggleExtensionForm}}
> Extension Status</button>

{{/if}}

{{#if this.isLoading}}
<div data-test-task-spinner class='task-card__loader-container'>
Expand Down
4 changes: 4 additions & 0 deletions app/constants/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ const TABS_TASK_STATUS_LIST = [
displayLabel: 'Merged',
key: MERGED,
},
{
displayLabel: 'Done',
key: COMPLETED,
},
Pratiyushkumar marked this conversation as resolved.
Show resolved Hide resolved
{
displayLabel: 'Verified',
key: VERIFIED,
Expand Down
2 changes: 1 addition & 1 deletion app/styles/tasks.css
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@
color: var(--primary-text-color);
transition: 0.25s ease-in-out;
height: 2.5rem;
width: 10rem;
width: auto;
flex-shrink: 0;
}

Expand Down
1 change: 1 addition & 0 deletions app/templates/tasks.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@userSelectedTaskText={{this.userSelectedTask.displayLabel}}
@showTasks={{this.showTasks}}
@toggleTasks={{this.toggleTasks}}
@dev={{this.dev}}
/>

<Tasks
Expand Down
13 changes: 5 additions & 8 deletions tests/integration/components/tasks/holder-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,20 @@ module('Integration | Component | Tasks Holder', function (hooks) {
this.set('isLoading', false);
this.set('disabled', false);
this.set('defaultType', DEFAULT_TASK_TYPE);
this.set('dev', true);

await render(hbs`<Task::Holder
@task={{this.task}}
@onTaskChange={{this.mock}}
@onStausChange={{this.mock}}
@onTaskUpdate={{this.mock}}
@isLoading={{this.isLoading}}
@userSelectedTask={{this.defaultType}}
@disabled={{this.disabled}}
@dev={{this.dev}}
/>`);
await waitUntil(() => find('[data-test-task-extensionForm-button]'));

assert.equal(
this.element.querySelector('[data-test-task-extensionForm-button]')
.innerText,
'Extension Status'
);
assert
.dom('[data-test-task-extensionForm-button]')
.hasText('Request Extension');
});

test('Render Task holder and check wether it has progress bar', async function (assert) {
Expand Down
Loading