-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
In the current version of RepoSense, props are declared explicitly for Vue components as an array of strings. Let's declare props using the object syntax so that we can document the prop types. This will also show a warning in the browser console if props of the wrong type are passed to the component. Let's also define classes for `Segment` and `User` for stricter type validation.
- Loading branch information
1 parent
e6c40fb
commit af7a05d
Showing
10 changed files
with
189 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export default class Segment { | ||
authored: boolean; | ||
|
||
lineNumbers: Array<number>; | ||
|
||
lines: Array<string>; | ||
|
||
constructor(isAuthored: boolean, lineNumbers: Array<number>, lines: Array<string>) { | ||
this.authored = isAuthored; | ||
this.lineNumbers = lineNumbers; | ||
this.lines = lines; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
export default class User { | ||
checkedFileTypeContribution : number; | ||
|
||
commits: Array<object>; | ||
|
||
dailyCommits: Array<object>; | ||
|
||
displayName: string; | ||
|
||
fileTypeContribution: object; | ||
|
||
location: string; | ||
|
||
name: string; | ||
|
||
repoId: string; | ||
|
||
repoName: string; | ||
|
||
searchPath: string; | ||
|
||
variance: number; | ||
|
||
constructor(userObj: User) { | ||
this.checkedFileTypeContribution = userObj.checkedFileTypeContribution || 0; | ||
this.commits = userObj.commits || []; | ||
this.dailyCommits = userObj.dailyCommits || []; | ||
this.displayName = userObj.displayName || ''; | ||
this.fileTypeContribution = userObj.fileTypeContribution || {}; | ||
this.location = userObj.location || ''; | ||
this.name = userObj.name || ''; | ||
this.repoId = userObj.repoId || ''; | ||
this.repoName = userObj.repoName || ''; | ||
this.searchPath = userObj.searchPath || ''; | ||
this.variance = userObj.variance || 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters