-
Notifications
You must be signed in to change notification settings - Fork 39
Add milestone anomaly warnings #502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SAN-MUYUN
wants to merge
13
commits into
CATcher-org:main
Choose a base branch
from
SAN-MUYUN:feature/milestone-anomalies-warnings
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4f579db
Implement milestone anomalies warnings
SAN-MUYUN 93df20d
Fix checkstyle
SAN-MUYUN e7b2bdb
Update documentation and refactor code
SAN-MUYUN 43c3444
Fix minor spelling issue
SAN-MUYUN b1ab768
Add milestone anomaly checks for multiple active milestones and close…
SAN-MUYUN aadf155
Fix typo
SAN-MUYUN 6ea7ba0
Add Anomaly class
SAN-MUYUN 35ee7f5
Merge branch 'main' into feature/milestone-anomalies-warnings
damithc d598421
Update display of milestone anomaly warning card
SAN-MUYUN 0b5543a
Add documentation and remove unused code
SAN-MUYUN 2c75892
Merge branch 'main' of remote branch into feature/milestone-anomalies…
SAN-MUYUN a418e3e
Merge branch 'main' of remote repo into feature/milestone-anomalies-w…
SAN-MUYUN a914cbb
Merge branch 'feature/milestone-anomalies-warnings' of remote repo in…
SAN-MUYUN File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,6 @@ | ||
| export enum MilestoneAnomaliesStatus { | ||
| NoDeadline = 'No Deadline', | ||
| PastDeadline = 'Past Deadline', | ||
| ClosedMilestoneAnomaly = 'Closed milestone with open issues or unmerged pull requests', | ||
| MultipleOpenMilestoneAnomaly = 'Multiple milestones are left open' | ||
| } |
This file contains hidden or 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 @@ | ||
| // Represents an anomaly state of the objects used in the app (e.g. Milestones, Issues etc). | ||
| // Should not be used to represent errors that affects normal functionality of the app. | ||
|
|
||
| export abstract class Anomaly { | ||
| abstract readonly anomalyType: string; | ||
| anomaly: string; | ||
|
|
||
| constructor(anomaly: string) { | ||
| this.anomaly = anomaly; | ||
| } | ||
|
|
||
| abstract getDescription(): string; | ||
| } |
This file contains hidden or 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,40 @@ | ||
| import { Anomaly } from './anomaly.model'; | ||
| import { Milestone } from './milestone.model'; | ||
|
|
||
| export abstract class MilestoneAnomaly extends Anomaly { | ||
| readonly anomalyType = 'MilestoneAnomaly'; | ||
|
|
||
| constructor(anomaly: string) { | ||
| super(anomaly); | ||
| } | ||
| } | ||
|
|
||
| // Represents an anomaly that is related to a single milestone | ||
| export class SingleMilestoneAnomaly extends MilestoneAnomaly { | ||
| milestone: Milestone; | ||
|
|
||
| constructor(milestone: Milestone, anomaly: string) { | ||
| super(anomaly); | ||
| this.milestone = milestone; | ||
| } | ||
|
|
||
| getDescription(): string { | ||
| return `${this.milestone.title}: ${this.anomaly}`; | ||
| } | ||
| } | ||
|
|
||
| // Represents an anomaly that is related to multiple milestones | ||
| export class GeneralMilestoneAnomaly extends MilestoneAnomaly { | ||
| milestones: Milestone[]; | ||
|
|
||
| constructor(milestones: Milestone[], anomaly: string) { | ||
| super(anomaly); | ||
| this.milestones = milestones; | ||
| } | ||
|
|
||
| getDescription(): string { | ||
| const milestoneTitles = this.milestones.map((milestone) => milestone.title).join(', '); | ||
|
|
||
| return `${this.anomaly}: ${milestoneTitles}`; | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Since the only difference between this class and the
SingleMilestoneAnomalyclass is that this holds multiple milestones instead of one, perhaps can call thisMultipleMilestoneAnomalyinstead? Do correct me if I'm understanding this wrongly!