-
Notifications
You must be signed in to change notification settings - Fork 101
Conversation
// Make thread resolved/unresolved | ||
toggleThread(thread: Thread): void { | ||
const isDone: boolean = !thread.getIsDone(); | ||
thread.setIsDone(isDone); |
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.
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.
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.
Maybe rename s/isDone/newIsDone?
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.
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[]; |
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.
what's the difference between threads
and allThreads
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 yes, we're discussing it right now:
https://appstory.slack.com/archives/C8ZHYNGRZ/p1536759146000100
short answer: allThreads = threads + diffThreads
https://github.com/google/startup-os/blob/master/tools/reviewer/local_server/service/code_review.proto#L84
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.
As discussed, let's rename.
displayedColumns = ['discussions']; | ||
@Input() threads: Thread[]; | ||
allThreads: Thread[]; |
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.
As discussed, let's rename.
// Make thread resolved/unresolved | ||
toggleThread(thread: Thread): void { | ||
const isDone: boolean = !thread.getIsDone(); | ||
thread.setIsDone(isDone); |
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.
Maybe rename s/isDone/newIsDone?
// Make thread resolved/unresolved | ||
toggleThread(thread: Thread): void { | ||
const isDone: boolean = !thread.getIsDone(); | ||
thread.setIsDone(isDone); |
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.
When we set thread.setIsDone(isDone);
, how does that change get to this.diff
?
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.
thread
is a link. When we edit its field, it's automatically edited in diff
too.
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.
Example:
const diff = {
thread: {
isDone: true
}
};
const thread = diff.thread;
thread.isDone = false;
console.log(diff.thread.isDone); // false
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.
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 |
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.
s/on the top/on top
tools/reviewer/webapp/README.md
Outdated
[node](https://nodejs.org/) LTS | ||
[npm](https://www.npmjs.com/) | ||
[protoc](https://github.com/protocolbuffers/protobuf/releases) | ||
Optional: |
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.
What do the optionals allow?
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.
firebase
allow to deploy.
angular
allow to use ng
features. For example:
ng lint -fix
or
ng generate component my-component
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 think we should add the information to the README?
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.
Just mention it briefly, so people know if they need it or not.
tools/reviewer/webapp/README.md
Outdated
@@ -1,13 +1,21 @@ | |||
## You need installed | |||
[node](https://nodejs.org/) LTS |
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.
Which versions? :)
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.
LTS :)
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.
Can you mention which versions currently work for you?
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.
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.
import { DiffService } from '../diff.service'; | ||
|
||
// To distinguish diff threads and line threads | ||
interface ThreadFrame { |
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.
We can add a boolean field to Thread.
tools/reviewer/webapp/README.md
Outdated
@@ -1,13 +1,21 @@ | |||
## You need installed | |||
[node](https://nodejs.org/) LTS |
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.
Can you mention which versions currently work for you?
tools/reviewer/webapp/README.md
Outdated
[node](https://nodejs.org/) LTS | ||
[npm](https://www.npmjs.com/) | ||
[protoc](https://github.com/protocolbuffers/protobuf/releases) | ||
Optional: |
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.
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; |
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 some more thought, I think we need an enum: #323
Feel free to copy the changes into your PR.
What's new:
diff
page