-
Notifications
You must be signed in to change notification settings - Fork 97
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
Adding DONE to task status options #499
base: develop
Are you sure you want to change the base?
Changes from all commits
56bda08
70971c6
cad584e
53d935f
afd9f37
d25e635
51d7cad
9d2c982
0d93af1
a6c862f
e31c3ea
f620715
e82b4a2
67d6573
b116a97
1d94049
f24d0e0
202bfcc
d84b4cc
2a94838
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,12 +14,21 @@ | |
<div class='task-card__status-update-container'> | ||
|
||
{{#if this.extensionFormOpened}} | ||
<Task::ExtensionForm | ||
@task={{@task}} | ||
@closeForm={{this.closeExtensionForm}} | ||
@title='Form for extension Request' | ||
@closeModel={{this.closeExtensionModel}} | ||
/> | ||
{{#if @dev}} | ||
<Task::MultipleExtensionForm | ||
@task={{@task}} | ||
@closeForm={{this.closeExtensionForm}} | ||
@title='Extension Details' | ||
@closeModel={{this.closeExtensionModel}} | ||
/> | ||
{{else}} | ||
<Task::ExtensionForm | ||
@task={{@task}} | ||
@closeForm={{this.closeExtensionForm}} | ||
@title='Form for extension Request' | ||
@closeModel={{this.closeExtensionModel}} | ||
/> | ||
{{/if}} | ||
{{/if}} | ||
|
||
{{#if (not-eq this.status this.TASK_KEYS.VERIFIED)}} | ||
|
@@ -32,12 +41,25 @@ | |
> | ||
{{#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 (not (or (eq taskStatus.key this.TASK_KEYS.AVAILABLE) (eq taskStatus.key this.TASK_KEYS.COMPLETED)))}} | ||
<option | ||
value={{taskStatus.key}} | ||
selected={{eq taskStatus.key this.status}} | ||
> | ||
{{taskStatus.displayLabel}} | ||
</option> | ||
{{/if}} | ||
{{else}} | ||
{{#if (not (or (eq taskStatus.key this.TASK_KEYS.DONE)))}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we add new logic under the old flow, won't it defeat the purpose of adding a feature flag? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have added new task status to constants file. So have to do this. |
||
<option | ||
value={{taskStatus.key}} | ||
selected={{eq taskStatus.key this.status}} | ||
> | ||
{{taskStatus.displayLabel}} | ||
</option> | ||
{{/if}} | ||
{{/if}} | ||
{{/if}} | ||
{{/each}} | ||
</select> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<div class='latest-extension-info__content' data-test-extension-info-content> | ||
<table class="latest-table"> | ||
<tbody class="latest-table"> | ||
<tr> | ||
<th>Request : </th> | ||
<td>{{#if (eq this.extension.requestNumber undefined)}} | ||
#1 | ||
{{else}} | ||
#{{this.extension.requestNumber}} | ||
{{/if}} | ||
</td> | ||
</tr> | ||
<tr> | ||
<th >Reason : </th> | ||
<td>{{this.extension.reason}}</td> | ||
</tr> | ||
<tr> | ||
<th>Title : </th> | ||
<td>{{this.extension.title}}</td> | ||
</tr> | ||
<tr> | ||
<th>Old Ends On : </th> | ||
<td>{{this.oldEndsOn}}</td> | ||
</tr> | ||
<tr> | ||
<th>New Ends On : </th> | ||
<td>{{this.newEndsOn}}</td> | ||
</tr> | ||
<tr> | ||
<th>Status : </th> | ||
<td>{{this.extension.status}}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Component from '@glimmer/component'; | ||
|
||
export default class LatestExtensionInfoComponent extends Component { | ||
extension = this.args.extension; | ||
newEndsOn = this.localTime(this.extension.newEndsOn); | ||
oldEndsOn = this.localTime(this.extension.oldEndsOn); | ||
|
||
localTime(time) { | ||
return new Date(time * 1000).toLocaleString(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
<div class='extension-form__container-parent'> | ||
<div | ||
role='button' | ||
id='create' | ||
class='extension-form__container-back' | ||
data-test-extension-form-container-back | ||
{{on 'click' @closeModel}} | ||
></div> | ||
<div class='extension-form__container-main'> | ||
<h2 data-test-title> | ||
{{#if this.createExtensionRequest}} | ||
Extension Request Form | ||
{{else}} | ||
Extension Details | ||
{{/if}} | ||
</h2> | ||
{{#if this.createExtensionRequest}} | ||
<div class='extension-form__content' data-test-extension-from-content> | ||
<form {{on 'submit' this.submitExtensionRequest}}> | ||
<label for='reason'>Reason</label> | ||
<textarea | ||
required | ||
type='text-box' | ||
id='reason' | ||
name='reason' | ||
data-test-extension-form-reason-input | ||
></textarea> | ||
<p>Old ETA - {{this.oldETA}}</p> | ||
<label for='newEndsOn'>New ETA</label> | ||
<input | ||
required | ||
type='datetime-local' | ||
id='newEndsOn' | ||
name='newEndsOn' | ||
{{on 'change' this.changeExtensionRequestETA}} | ||
data-test-extension-form-newEndsOn-input | ||
/> | ||
<label for='title'>Title</label> | ||
<textarea | ||
required | ||
type='text-box' | ||
id='title' | ||
name='title' | ||
data-test-extension-form-title-input | ||
></textarea> | ||
<div class='error-container' id='error'> | ||
<span | ||
class='error-placeholder' | ||
data-test-extension-from-error | ||
></span> | ||
</div> | ||
<div class='buttons' id='form'> | ||
<button | ||
class='multiple-extension-form__container-close' | ||
data-test-extension-form-container-close | ||
type='button' | ||
{{on 'click' @closeForm}} | ||
> | ||
Cancel | ||
</button> | ||
|
||
<button | ||
class='multiple-extension-form__create-button primary-button-style' | ||
disabled={{this.isSubmitButtonDisabled}} | ||
type='submit' | ||
>Submit</button> | ||
</div> | ||
</form> | ||
</div> | ||
{{else}} | ||
<div class='extension-form__content' data-test-extension-from-content> | ||
{{#if this.extensionData.value}} | ||
<div class='extension-form__content-wrapper'> | ||
{{#each this.extensionData.value as |extension|}} | ||
<Task::LatestExtensionInfo @extension={{extension}} /> | ||
{{#if extension.reviewedBy}} | ||
<p data-reviewed-log>Your request was | ||
{{#if | ||
(eq extension.status 'APPROVED') | ||
}}approved{{else}}denied{{/if}} | ||
by | ||
{{extension.reviewedBy}} | ||
{{convertDate (array extension.timestamp) end_date=0}}. | ||
</p> | ||
{{/if}} | ||
{{/each}} | ||
</div> | ||
|
||
<div class='buttons' id='detail'> | ||
<button | ||
class='multiple-extension-form__container-close' | ||
data-test-extension-form-container-close | ||
type='button' | ||
{{on 'click' @closeForm}} | ||
> | ||
Close | ||
</button> | ||
|
||
{{#if | ||
(or | ||
(eq this.previousExtensionStatus 'APPROVED') | ||
(eq this.previousExtensionStatus 'DENIED') | ||
) | ||
}} | ||
<button | ||
class='multiple-extension-form__open-button primary-button-style' | ||
data-test-create-another-extension | ||
type='button' | ||
{{on 'click' this.createNewExtensionRequest}} | ||
> | ||
Request Extension | ||
</button> | ||
{{/if}} | ||
</div> | ||
{{else if this.extensionData.isLoading}} | ||
<div class='task-card__loader-container'> | ||
<Spinner /> | ||
</div> | ||
{{else if this.extensionData.error}} | ||
<h4>{{this.extensionData.error}}</h4> | ||
<div class='buttons' id='create'> | ||
<button | ||
class='multiple-extension-form__container-close' | ||
data-test-extension-form-container-close | ||
type='button' | ||
{{on 'click' @closeForm}} | ||
> | ||
Close | ||
</button> | ||
<button | ||
class='multiple-extension-form__open-button primary-button-style' | ||
data-test-create-extension-button | ||
type='button' | ||
{{on 'click' this.createNewExtensionRequest}} | ||
> | ||
Request Extension | ||
</button> | ||
</div> | ||
{{/if}} | ||
</div> | ||
{{/if}} | ||
</div> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding conditions inside a loop to populate the task status, can we just have two separate availableTaskStatusList?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You meant to maintain two seperate lists in the constants file itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Something like that where we don't have to write extra logic to maintain the old flow.