-
Notifications
You must be signed in to change notification settings - Fork 62
feat(query): create new work item dialog #2791
Conversation
Ike Plugins (test-keeper)Thank you @sahil143 for this contribution! It appears that no tests have been added or updated in this PR. Automated tests give us confidence in shipping reliable software. Please add some as part of this change. If you are an admin or the reviewer of this PR and you are sure that no test is needed then you can use the command Your plugin configuration is stored in the file. |
@sahil143 this PR has lint errors, please resolve them. And is the PR ready for review or is it work-in-progress? |
[workItemTypes]="quickAddWorkItemTypes" | ||
[selectedType]="quickAddWorkItemTypes[0]" | ||
[selectedIteration]="selectedIterationSource | async"> | ||
</alm-work-item-quick-add> |
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.
Please indent alm-work-item-quick-add
properly
} | ||
} | ||
|
||
|
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.
Please remove extra lines
@@ -202,6 +204,14 @@ export class PlannerQueryComponent implements OnInit, OnDestroy, AfterViewChecke | |||
}); | |||
} | |||
|
|||
closeCreateWorkItemDialog(event) { |
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.
Please add the type for parameter event
src/app/effects/work-item.effects.ts
Outdated
@@ -14,6 +15,7 @@ import { WorkItemService as WIService } from './../services/work-item.service'; | |||
import { AppState } from './../states/app.state'; | |||
import * as util from './work-item-utils'; | |||
|
|||
|
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.
Remove this extra line
type: NotificationType.SUCCESS | ||
} as Notification); | ||
} catch (e) { | ||
console.log('Work item is added.'); |
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.
@sahil143 if the try
block throws error that means the notification is not generated, so are you sure this is the correct way of handling it in catch
?
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, I think so. If the notification is not generated then the success will be logged on the console.
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.
- Do we really need try catch for notification service?
- We should not use console logs anywhere in production.
- Lastly, if we are using console logs then the user needs to open console to check if the work item was added. I don't think this is the correct user experience.
@sahil143 functional tests are failing. |
Yes @divyanshiGupta I'm working on them |
[test] |
@sahil143 Your image is available in the registry. Run |
src/app/effects/work-item.effects.ts
Outdated
// Add item success notification | ||
let currentURL = document.location.pathname; | ||
let detailURL = currentURL.indexOf('/plan/query') > -1 ? currentURL.split('/plan/query')[0] : currentURL; | ||
const routeURL = detailURL + '/plan/detail/' + wItem.number; |
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.
@sahil143 do we need plan here in '/plan/detail/' ?
@sahil143 Your image is available in the registry. Run |
type: NotificationType.SUCCESS | ||
} as Notification); | ||
} catch (e) { | ||
console.log('Work item is added.'); |
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.
- Do we really need try catch for notification service?
- We should not use console logs anywhere in production.
- Lastly, if we are using console logs then the user needs to open console to check if the work item was added. I don't think this is the correct user experience.
dropdownToggle> | ||
Create WorkItem | ||
</button> | ||
<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.
There is still some weird indentation in this file.
@sahil143 Your image is available in the registry. Run |
[test] |
2 similar comments
[test] |
[test] |
@sahil143 Your image is available in the registry. Run |
2 similar comments
@sahil143 Your image is available in the registry. Run |
@sahil143 Your image is available in the registry. Run |
<!--Quick Add for Query Tab--> | ||
|
||
<div class="f8-quickadd-query__wrapper" *ngIf="wilistview === 'wi-query-view'"> | ||
<input class="" |
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.
Why is class attribute empty here? Or if we do not need this you can remove this.
@@ -55,6 +56,7 @@ export class WorkItemQuickAddComponent implements OnInit, OnDestroy, AfterViewIn | |||
linkObject: object; | |||
addDisabled: Observable<boolean> = | |||
this.permissionQuery.isAllowedToAdd(); | |||
workItemTitle= new FormControl(''); |
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.
add space between workItemTitle
and =
@sahil143 I have added a few review comments here and there apart from that the code looks good to me. And please make sure to remove console logs before merging this to master. |
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.
- After clicking create button creating a workitem popup should close.
- Create and CreateAndOpen button is disabled after creating 1 workitem
Steps-
- Create a workitem (It is displayed If it matches the query)
- Try creating another work item , create button is disabled.
- If a newly created work item is not matching the query, Can we display some notification saying that "Work Item is created but It doesn't match the Query"
Newly created workitem is not shown at all in the list. we only show a notification.
This is fixed in commit 13efa60
No, It should not be because user might want to add another workitem right after a workitem is created |
@sahil143 Your image is available in the registry. Run |
1 similar comment
@sahil143 Your image is available in the registry. Run |
/ok-without-tests |
Note: If there are pending changes to the PR, prefix the PR title with "WIP" and add the label "DO NOT MERGE"
Mandatory
https://openshift.io/openshiftio/Openshift_io/plan/detail/531
Optional
Is the documentation Included?
Are the Release Notes included?