-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Labels Setup Compulsory Labels are now verified and created on login. This goes together with V2 of the app since the initial repository belongs in each student's account, now we can ensure that the repo has been properly setup with the necessary labels. * Code style fixes * Label Color Verification On Login * Refactored Label Data Validation * Code Refactoring * Label Interface to Class Morphing * Lint Fixes * Codestyle Fixes & Assertion Error Implementation * Codestyle Fixes * Further CodeStyle Fixes * Further CodeStyle Fixes * Further Codestyle nit Fixes
- Loading branch information
1 parent
9fd34ec
commit 54c91e2
Showing
5 changed files
with
145 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,25 @@ | ||
export interface Label { | ||
labelValue: string; | ||
labelColor: string; | ||
export class Label { | ||
|
||
labelCategory: string; | ||
labelValue: string; | ||
labelColor: string; | ||
|
||
constructor(labelCategory: string, labelValue: string, labelColor: string) { | ||
this.labelValue = labelValue; | ||
this.labelColor = labelColor; | ||
this.labelCategory = labelCategory; | ||
} | ||
|
||
/** | ||
* Returns the name of the label with the format of | ||
* 'category'.'value' (e.g. severity.Low) | ||
*/ | ||
public getFormattedName(): string { | ||
return this.labelCategory + '.' + this.labelValue; | ||
} | ||
|
||
public equals(label: Label) { | ||
return this.labelValue === label.labelValue | ||
&& this.labelColor === label.labelColor && this.labelCategory === label.labelCategory; | ||
} | ||
} |
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