-
Notifications
You must be signed in to change notification settings - Fork 5
feat(TimedSteps): New type of step containing a series of timed components #2198
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
Aaron-Detre
wants to merge
12
commits into
develop
Choose a base branch
from
timed-steps
base: develop
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
12 commits
Select commit
Hold shift + click to select a range
bb05d15
Basic timed step
Aaron-Detre c0faa05
Disable step tools for unfinished timed steps
Aaron-Detre a06fdf7
Skip previously viewed components
Aaron-Detre df16628
Timed step authoring
Aaron-Detre 8875e38
Don't count below zero
Aaron-Detre d6373aa
Basic styling for timer and proceed button
Aaron-Detre 1128bde
Fix timed step preview
Aaron-Detre e551991
Fix node authoring time limit inputs only appear after reloading
Aaron-Detre c246fa8
Write tests
Aaron-Detre 62db0d3
Updated messages
github-actions[bot] ad06ca4
Minor code improvement
Aaron-Detre c371588
Merge branch 'timed-steps' of https://github.com/WISE-Community/WISE-…
Aaron-Detre 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { Subject } from 'rxjs'; | ||
|
||
@Injectable() | ||
export class TimedNodeService { | ||
isNodeCompletedBroadcast: Subject<boolean> = new Subject<boolean>(); | ||
|
||
broadcastIsNodeCompleted(isCompleted: boolean): void { | ||
this.isNodeCompletedBroadcast.next(isCompleted); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,5 +1,5 @@ | ||||||
import { CommonModule } from '@angular/common'; | ||||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core'; | ||||||
import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core'; | ||||||
import { FlexLayoutModule } from '@angular/flex-layout'; | ||||||
import { FormsModule } from '@angular/forms'; | ||||||
import { MatButtonModule } from '@angular/material/button'; | ||||||
|
@@ -14,6 +14,7 @@ import { NodeStatusService } from '../../../../services/nodeStatusService'; | |||||
import { ProjectService } from '../../../../services/projectService'; | ||||||
import { StudentDataService } from '../../../../services/studentDataService'; | ||||||
import { Subscription } from 'rxjs'; | ||||||
import { TimedNodeService } from '../../../../services/timedNodeService'; | ||||||
|
||||||
@Component({ | ||||||
encapsulation: ViewEncapsulation.None, | ||||||
|
@@ -43,14 +44,17 @@ export class StepToolsComponent implements OnInit { | |||||
protected nodeStatus: any; | ||||||
protected nodeStatuses: any; | ||||||
protected prevId: string; | ||||||
@Input() private timedStep: boolean; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of making timedStep an input to this component, can we set this in updateModel()?
Suggested change
|
||||||
protected timedStepCompleted: boolean; | ||||||
private subscriptions: Subscription = new Subscription(); | ||||||
protected toNodeId: string; | ||||||
|
||||||
constructor( | ||||||
private nodeService: NodeService, | ||||||
private nodeStatusService: NodeStatusService, | ||||||
private projectService: ProjectService, | ||||||
private studentDataService: StudentDataService | ||||||
private studentDataService: StudentDataService, | ||||||
private timedNodeService: TimedNodeService | ||||||
) {} | ||||||
|
||||||
ngOnInit(): void { | ||||||
|
@@ -76,6 +80,11 @@ export class StepToolsComponent implements OnInit { | |||||
this.updateModel(); | ||||||
}) | ||||||
); | ||||||
this.subscriptions.add( | ||||||
this.timedNodeService.isNodeCompletedBroadcast.subscribe( | ||||||
(isStepCompleted) => (this.timedStepCompleted = isStepCompleted) | ||||||
) | ||||||
); | ||||||
} | ||||||
|
||||||
ngOnDestroy(): void { | ||||||
|
@@ -124,4 +133,17 @@ export class StepToolsComponent implements OnInit { | |||||
protected closeNode(): void { | ||||||
this.nodeService.closeNode(); | ||||||
} | ||||||
|
||||||
protected isArrowDisabled(direction: 'prev' | 'next'): boolean { | ||||||
const noNode = direction === 'prev' ? !this.prevId : !this.nextId; | ||||||
return noNode || this.isUnfinishedTimedStep(); | ||||||
} | ||||||
|
||||||
protected isUnfinishedTimedStep(): boolean { | ||||||
if (this.timedStep) { | ||||||
return !this.timedStepCompleted; | ||||||
} else { | ||||||
return false; | ||||||
} | ||||||
Comment on lines
+143
to
+147
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Write in one line? |
||||||
} | ||||||
} |
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.
Simplify?