Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

feat(query): create new work item dialog #2791

Merged
merged 17 commits into from
Oct 23, 2018
Merged

Conversation

sahil143
Copy link
Contributor

@sahil143 sahil143 commented Oct 1, 2018

Note: If there are pending changes to the PR, prefix the PR title with "WIP" and add the label "DO NOT MERGE"

Mandatory


Optional

  • Is the documentation Included?

  • Are the Release Notes included?

  • @mention(s) to expected reviewer(s) included

@alien-ike
Copy link
Collaborator

alien-ike commented Oct 1, 2018

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 /ok-without-tests as a comment to make the status green.

Your plugin configuration is stored in the file.

@divyanshiGupta
Copy link
Contributor

@sahil143 this PR has lint errors, please resolve them. And is the PR ready for review or is it work-in-progress?

@sahil143 sahil143 requested review from divyanshiGupta and sanbornsen and removed request for divyanshiGupta October 1, 2018 11:09
[workItemTypes]="quickAddWorkItemTypes"
[selectedType]="quickAddWorkItemTypes[0]"
[selectedIteration]="selectedIterationSource | async">
</alm-work-item-quick-add>
Copy link
Contributor

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

}
}


Copy link
Contributor

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) {
Copy link
Contributor

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

@@ -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';


Copy link
Contributor

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.');
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@divyanshiGupta
Copy link
Contributor

@sahil143 functional tests are failing.

@sahil143
Copy link
Contributor Author

sahil143 commented Oct 1, 2018

@sahil143 functional tests are failing.

Yes @divyanshiGupta I'm working on them

@sahil143
Copy link
Contributor Author

sahil143 commented Oct 1, 2018

[test]

@centos-ci
Copy link
Collaborator

@sahil143 Your image is available in the registry. Run docker pull quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2791 && docker run -it -p 5000:8080 quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2791 and visit http://localhost:5000 to access it.

// 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;
Copy link
Contributor

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/' ?

@centos-ci
Copy link
Collaborator

@sahil143 Your image is available in the registry. Run docker pull quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2791 && docker run -it -p 5000:8080 quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2791 and visit http://localhost:5000 to access it.

type: NotificationType.SUCCESS
} as Notification);
} catch (e) {
console.log('Work item is added.');
Copy link
Contributor

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
Copy link
Contributor

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.

@centos-ci
Copy link
Collaborator

@sahil143 Your image is available in the registry. Run docker pull quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2791 && docker run -it -p 5000:8080 quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2791 and visit http://localhost:5000 to access it.

@sahil143
Copy link
Contributor Author

[test]

2 similar comments
@sahil143
Copy link
Contributor Author

[test]

@Raunak1203
Copy link
Contributor

[test]

@centos-ci
Copy link
Collaborator

@sahil143 Your image is available in the registry. Run docker pull quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2791 && docker run -it -p 5000:8080 quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2791 and visit http://localhost:5000 to access it.

2 similar comments
@centos-ci
Copy link
Collaborator

@sahil143 Your image is available in the registry. Run docker pull quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2791 && docker run -it -p 5000:8080 quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2791 and visit http://localhost:5000 to access it.

@centos-ci
Copy link
Collaborator

@sahil143 Your image is available in the registry. Run docker pull quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2791 && docker run -it -p 5000:8080 quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2791 and visit http://localhost:5000 to access it.

<!--Quick Add for Query Tab-->

<div class="f8-quickadd-query__wrapper" *ngIf="wilistview === 'wi-query-view'">
<input class=""
Copy link
Contributor

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('');
Copy link
Contributor

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 =

@divyanshiGupta
Copy link
Contributor

@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.

Copy link
Contributor

@Raunak1203 Raunak1203 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sahil143

  1. After clicking create button creating a workitem popup should close.
  2. 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.
    peek 2018-10-23 12-20
  1. 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"

@sahil143
Copy link
Contributor Author

@Raunak1203

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.

Create and CreateAndOpen button is disabled after creating 1 workitem

This is fixed in commit 13efa60

After clicking create button creating a workitem dropdown should close.

No, It should not be because user might want to add another workitem right after a workitem is created

@centos-ci
Copy link
Collaborator

@sahil143 Your image is available in the registry. Run docker pull quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2791 && docker run -it -p 5000:8080 quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2791 and visit http://localhost:5000 to access it.

1 similar comment
@centos-ci
Copy link
Collaborator

@sahil143 Your image is available in the registry. Run docker pull quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2791 && docker run -it -p 5000:8080 quay.io/openshiftio/fabric8-ui-fabric8-planner:SNAPSHOT-PR-2791 and visit http://localhost:5000 to access it.

@sudsen
Copy link
Collaborator

sudsen commented Oct 23, 2018

/ok-without-tests

@sudsen sudsen merged commit 2c33363 into fabric8-ui:master Oct 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants