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

Reviewer - diff threads #296

Merged
merged 9 commits into from
Sep 15, 2018
Merged

Reviewer - diff threads #296

merged 9 commits into from
Sep 15, 2018

Conversation

webdevelopland
Copy link
Contributor

@webdevelopland webdevelopland commented Sep 12, 2018

What's new:

  • Diff threads are displayed on diff page
  • observable onDestroy bug is fixed

@webdevelopland
Copy link
Contributor Author

Display diff threads

@oferb oferb mentioned this pull request Sep 12, 2018
// Make thread resolved/unresolved
toggleThread(thread: Thread): void {
const isDone: boolean = !thread.getIsDone();
thread.setIsDone(isDone);
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's happening here? something like thread.setIsDone(!thread.getIsDone()) ?
I see that you use the variable isDone later too so I guess putting it in a variable is good.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe rename s/isDone/newIsDone?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think isDone looks more natural for boolean variable.
I'll add more comments to make code more clear.

displayedColumns = ['discussions'];
@Input() threads: Thread[];
allThreads: Thread[];
Copy link
Collaborator

Choose a reason for hiding this comment

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

what's the difference between threads and allThreads

Copy link
Contributor Author

@webdevelopland webdevelopland Sep 12, 2018

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed, let's rename.

displayedColumns = ['discussions'];
@Input() threads: Thread[];
allThreads: Thread[];
Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed, let's rename.

// Make thread resolved/unresolved
toggleThread(thread: Thread): void {
const isDone: boolean = !thread.getIsDone();
thread.setIsDone(isDone);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe rename s/isDone/newIsDone?

// Make thread resolved/unresolved
toggleThread(thread: Thread): void {
const isDone: boolean = !thread.getIsDone();
thread.setIsDone(isDone);
Copy link
Contributor

Choose a reason for hiding this comment

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

When we set thread.setIsDone(isDone);, how does that change get to this.diff?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thread is a link. When we edit its field, it's automatically edited in diff too.

Copy link
Contributor Author

@webdevelopland webdevelopland Sep 13, 2018

Choose a reason for hiding this comment

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

Example:

const diff = {
  thread: {
    isDone: true
  }
};

const thread = diff.thread;
thread.isDone = false;
console.log(diff.thread.isDone); // false

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, thanks!

@@ -128,7 +130,7 @@ export class DiffsComponent implements OnInit {
sortDiffs(): void {
for (const diffList of this.diffGroups) {
diffList.sort((a, b) => {
// Newest first
// Newest on the top
Copy link
Contributor

Choose a reason for hiding this comment

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

s/on the top/on top

[node](https://nodejs.org/) LTS
[npm](https://www.npmjs.com/)
[protoc](https://github.com/protocolbuffers/protobuf/releases)
Optional:
Copy link
Contributor

Choose a reason for hiding this comment

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

What do the optionals allow?

Copy link
Contributor Author

@webdevelopland webdevelopland Sep 15, 2018

Choose a reason for hiding this comment

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

firebase allow to deploy.
angular allow to use ng features. For example:

ng lint -fix

or

ng generate component my-component

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You think we should add the information to the README?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just mention it briefly, so people know if they need it or not.

@@ -1,13 +1,21 @@
## You need installed
[node](https://nodejs.org/) LTS
Copy link
Contributor

Choose a reason for hiding this comment

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

Which versions? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

LTS :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you mention which versions currently work for you?

Copy link
Contributor Author

@webdevelopland webdevelopland Sep 15, 2018

Choose a reason for hiding this comment

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

I'm not sure it's necessary. No matter which version we use, until it's LTS everything is ok.
Also, LTS is updated all the time. It may be annoying to update the information. We can just refer to last LTS on nodejs site.

tools/reviewer/webapp/README.md Show resolved Hide resolved
import { DiffService } from '../diff.service';

// To distinguish diff threads and line threads
interface ThreadFrame {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can add a boolean field to Thread.

@@ -1,13 +1,21 @@
## You need installed
[node](https://nodejs.org/) LTS
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you mention which versions currently work for you?

[node](https://nodejs.org/) LTS
[npm](https://www.npmjs.com/)
[protoc](https://github.com/protocolbuffers/protobuf/releases)
Optional:
Copy link
Contributor

Choose a reason for hiding this comment

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

Just mention it briefly, so people know if they need it or not.

@@ -78,7 +78,8 @@ message Diff {
string workspace = 8;
int64 created_timestamp = 9;
int64 modified_timestamp = 10;
repeated Thread thread = 13;
// Threads on a line.
repeated Thread line_thread = 13;
Copy link
Contributor

Choose a reason for hiding this comment

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

After some more thought, I think we need an enum: #323
Feel free to copy the changes into your PR.

@webdevelopland webdevelopland merged commit 2223e5a into master Sep 15, 2018
@oferb oferb deleted the WD18 branch September 15, 2018 21:26
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.

None yet

3 participants