Skip to content

Commit

Permalink
v3.11.0-beta3 (#141)
Browse files Browse the repository at this point in the history
* Add chartjs demo

* update node and remove commit.txt

* v3.9.0 (#116)

* Dynamically load team challenge data when it's requested.

* Dynamically load team challenge data when it's requested.

* Refactor feedback form to reduce dependency on observable inputs. Resolves Gameboard bug 112.

* Foundation of UI for managing manual points

* Add management of bonus points to admin

* update oidc and silent-renew

* Finish MVP of manual challenge bonuses

* Add required field stubs to oidc config in the prod environment.

* Wire up player session events on player admin for game.

* Resolve bug that incorrectly classified sessions as resettable or not.

* return 'view' button. Add copy actions to context menu.

* Usability improvements to player admin

* Refactor gameboard page clock into its own component. Resolve timer issue for the player-session component.

* enable practice challenges

* Remove logging code.

* Fix audit warnings

* Fix issue that prevented feedback form from rendering

* Consolidate cumulative challenge clock into component

* Update countdown clock on session extend in prac.

* Only allow bonuses for started challenges

* Enable testers to admin enroll outside the registration window. Fix bug incorrectly computing whether a player can be unnenrolled vs. reset from admin.
Resolves #154.

* Restore the ability of admins/registrars to unenroll/reset players from admin.

* Clarify player status tooltips.

* Fix URL timestamping for cubespace

* Standardize size of enroll buttons. Allow admin enroll when registration is closed.

* Allow admin enroll/unenroll after registration is over.

---------

Co-authored-by: Jeff Mattson <jmattson@sei.cmu.edu>

* add csp to nginx conf

* Start adding frontend for sync start games.

* Frontend stuff for sync start - new hub service which manages game-level events (on the same signalR hub as the one previously used).

* federate game hub events to game hub service.

* MVP UI for sync start

* Fix enum bug preventing sync start ready update

* Light formatting, finish mvp of sync start

* Trying to reuse the performance summary component

* Reuse performance summary component.

* Add progress bar for players ready in sync start

* Add ready/not ready tags for player list view. Add progress bar to show overall progress toward readiness.

* Additional refinements to sync start - intermediate loading screen

* Styling/refining sync start, remove logs.

* Add sync start guard to gameboard pages.

* Visual cleanup of sync start, remove logging.

* Start players report, remove logging

* Checkpoint for reports revamp.

* More reports revamp frontend

* finish challengespecs parameter control

* More reports plumbing

* Add report share

* Figuring out complex parameter bindings.

* Add support report

* More work on support report

* Polishing support report

* Add new parameter types, add report selector

* Add labels filter to support report

* Convert usages of bypassSecurityTrustHtml to sanitize and reworked some template control flows.

* More work on reports

* cleanup

* - For missing toc.json/settings.json
- Resolved an issue that could cause the player presence widget to fail to display for non-sync-start games.
- Gameboard now only looks for settings.json in production environments (or any env that has the settingsJson property of the environment object defined)

* Fix parameter name for challenges report

* Various bug fixes and add UI for date range in challenges report.

* Add registration date range to challenges report

* Remove logging

* Audit fix vulnerability.

* Bump socket.io-parser from 4.2.2 to 4.2.3

Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.2.2 to 4.2.3.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](socketio/socket.io-parser@4.2.2...4.2.3)

---
updated-dependencies:
- dependency-name: socket.io-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* - For missing toc.json/settings.json
- Resolved an issue that could cause the player presence widget to fail to display for non-sync-start games.
- Gameboard now only looks for settings.json in production environments (or any env that has the settingsJson property of the environment object defined)

* Add eslint, configure rules, and fix critical issues.

* Troubleshooting report binding issue:

* Allow root-relative imports in gameboard-ui

* Fix bugs with date range control

* v3.9.3

- For missing toc.json/settings.json (#123)
- Resolved an issue that could cause the player presence widget to fail to display for non-sync-start games.
- Gameboard now only looks for settings.json in production environments (or any env that has the settingsJson property of the environment object defined)

* Add custom input component to allow for custom components with ngmodel

* Update angular to 15.2.5

* - For missing toc.json/settings.json
- Resolved an issue that could cause the player presence widget to fail to display for non-sync-start games.
- Gameboard now only looks for settings.json in production environments (or any env that has the settingsJson property of the environment object defined)

* Bump socket.io-parser from 4.2.2 to 4.2.3

Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.2.2 to 4.2.3.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](socketio/socket.io-parser@4.2.2...4.2.3)

---
updated-dependencies:
- dependency-name: socket.io-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* - For missing toc.json/settings.json
- Resolved an issue that could cause the player presence widget to fail to display for non-sync-start games.
- Gameboard now only looks for settings.json in production environments (or any env that has the settingsJson property of the environment object defined)

* Add eslint, configure rules, and fix critical issues.

* Allow root-relative imports in gameboard-ui

* Add custom input component to allow for custom components with ngmodel

* Update angular to 15.2.5

* Client-side defense for illegal file uploads

* Improved error handling for illegal mime types. Support area formatting updates.

* Allow escaped html to render in support tickets.

* Added a component that allows inline rendering of links while preserving user-entered text. Resolves #204.

* Revise error message on bad file upload.

* Added handling for multiline strings in ticket comments.

* Start on Enrollment report

* Additional styling for multiselect

* Continued refinement to the enrollment report.

* Refinements to multiselect and general report styling, updates to enrollment report.

* Add paging to enrollment report (and select-pager component

* More work on enrollment report, refactor to remove dynamic component

* Remove logging

* Fix line chart for enrollment report

* Refactor to support parameter management better

* Cleanup, styling, and ignore paging parameters for enrollment csv export

* Add practice mode route guard and change path to /practice. Resolves GB#208.

* Finished query params binding for prac page search bar.

* Add logging of login events to the client. Display last login on the admin/users page. Minor style cleanup.

* code cleanup

* Progress on practice report and adding new sorts to user admin for last login and created on

* More work on practice mode report

* More work on pract

* fix typing issue, update gitignore to exclude local config settings

* Code cleanup

* More work on practice report

* More work on practice mode and modal components.

* Enhancements to the 'by challenges' grouping of practice mode report

* Wrapping up a draft of practice mode

* Add paging controls to some of the practice mode subreports

* improvements to the support report's filter bindings. added a known issue

* Improvements to support report filters

* improvements to support report filters

* Guard against players with no sponsor in enrollment report

* Correct models and debug rendering issue

* remove debugging for enrollment report rendering

* Improve paging experience on enrollment report

* Squash a few filter bugs and update known issues

* Remove logging

* Fix paging bug on enrollment report

* Clean up pager behavior

* Set default paging to 20

* Code cleanup and ensure trend data isn't paged for enrollment report

* Update known issues

* Improving paging behavior

* Cosmetic improvements to reports and added a game filter to the enrollment report.

* Update known issues

* Update known issues

* Correctly resolve image links on practice page

* Standardize game card image rendering and resolve missing images on prac page

* Fix multiselect parameters for practice mode report. Still solving the grouping parameter problem.

* Remove default parameters architecture since it's no longer needed. Only show tickets in "other" status
in the support report doughnut chart if there are any.

* Hide internal testing message for now

* Improve support report styling

* Styling for support report

* Practice mode report formatting

* code cleanup

* Resolve issue where End Session in practice mode failed to update the UI correctly.

* Working on improving relationship between query param directive and the querystring

* Remove redundant base component

* Improve filter/querystring interface

* Fix minor formatting and update known issues

* Refine directory structure. Add stat summary for enrollment report.

* Add game count to enrollment report. Hide practice games on home screen.

* Improve visual clarity of player mode summary tab's modal dialog. Update known issues.

* Visual pass on practice mode report.

* Runaway percentile precision

* Fix filters on user mode performance tab

* Guard against no sponsors in enrollment report.

* Pin gh actions for vs code extension. Add tap and log tool. Update ngx-bootstrap.

* Resolve issue that prevented practice mode from searching when a search term was entered and then deleted.

* Add summary collapser on reports. Fix detection of availability of practice mode with a little low-budget caching.

* Add practice admin

* Remove unused property of game model

* Add game engine mode enum

* Refactoring structure and improving practice mode experience

* Iteration on practice mode and play component.

* Work on autodeploy of practice challenges.

* More work on autostart and new play component.

* Work on autolaunch/play component.

* Finished new play component and autolaunch

* attempt to fix countdown time on practice mode challenges

* Fix to autoplay challenges

* Fixes to practice mode autoplay

* Trying to fix an issue with extend session

* Fix a few rendering issues with practice mode

* Code cleanup

* Update admin to use new font awesome variable

* Fix issue affecting date range parameters in reports and move a couple pipes to core

* Add practice admin

* Improvements to practice admin

* Finished up practice certificates

* Hide practice certificates tab if prac isn't enabled or there's no cert template.

* Standardize look and feel of certificate tables. Don't autoprint certs on open.

* Make game and practice challenge clickable in certificates page.

* Automatically trust admin-created html for competitive certs.

* code clean up and light styling of the active practice challenge widget

* Refactor certificates into their own module and deal with serverside rendered PNG certificates.

* Finish server side generation/management of certificates for prac and comp.

* Bug fixes for various challenge end scenarios in prac.

* Bug fixes to practice mode and certificates

* Addresses GBAPI #236.

* Fixing a few more bugs in practice mode.

* Temporarily hide list of practice challenges in admin and rename 'competitive' tab to 'games'. The practice challenge list will come in a future update.

* Fix minor practice mode bugs with autoprint.

* Fix multiple confirms bug

* Add error display to practice session component.

* Fix for certificate link from modal where basehref is not slash.

* Remove back button from broader admin nav.

* REmove known issues link from reports page

* Remove autoprint from practice certificates for now.

* Add print button to certificate printer page in case people are worried about just CTRL+P'ing for print optimization.

* Code cleanup

* Fix for challenge doc text in practice mode.

* Start work on requiring sponsors on authentication.

* Resolve display bug with Practice Area pager. Move that component into core module.

* Fix broken links which modify seasons parameter in practice report.

* Adjust from "Practice Mode" to "Practice Area"

* change practice-mode urls

* Fixed a rounding issue on the challenge sponsor performance modal of the practice area report

* Fix routing for practice-area urls

* Fixed placeholder values for the timespan picker in reports

* Remove Admin user back button

* Remove back button from Admin interface menus

* Adjust player back buttons

* Fix game filter link in the challenge/game field component.

* Fix a count issue on the 'by challenge' grouping of the practice area report.

* Correct field names on the practice area report

* Fixes for reset filters in reports

* Default navbar background to black if unspecified.

* Hide milliseconds in enrollment report

* Only show Reports tab to admins, registrars, and support.

* Hide the [beta] tag for reporting along with the nav item if the user doesn't have access.

* Hide 'cancel' button on 'About report filters' dialog.

* Always display the pager on the list of practice challenges to allow the user to see how many challenges met their search criteria.

* Format nullish dates more clearly in 'ago' pipe

* Resolved an issue that caused the reports nav item not to show until refresh after logging in.

* More work on sponsor require

* More frontend for require sponsor.

* - Fixed a bug that caused 'game over' to appear before a player session started.
- Added logic to support admin enroll/start for tester, admin, and registrar.
- Improved UI logic in the Player Enroll component.

* simplify display logic for enrollment panel.

* v3.10.2 (#135)

* Convert usages of bypassSecurityTrustHtml to sanitize and reworked some template control flows.

* - For missing toc.json/settings.json
- Resolved an issue that could cause the player presence widget to fail to display for non-sync-start games.
- Gameboard now only looks for settings.json in production environments (or any env that has the settingsJson property of the environment object defined)

* Bump socket.io-parser from 4.2.2 to 4.2.3

Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.2.2 to 4.2.3.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](socketio/socket.io-parser@4.2.2...4.2.3)

---
updated-dependencies:
- dependency-name: socket.io-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* - For missing toc.json/settings.json
- Resolved an issue that could cause the player presence widget to fail to display for non-sync-start games.
- Gameboard now only looks for settings.json in production environments (or any env that has the settingsJson property of the environment object defined)

* Add eslint, configure rules, and fix critical issues.

* Allow root-relative imports in gameboard-ui

* Add custom input component to allow for custom components with ngmodel

* Update angular to 15.2.5

* - For missing toc.json/settings.json
- Resolved an issue that could cause the player presence widget to fail to display for non-sync-start games.
- Gameboard now only looks for settings.json in production environments (or any env that has the settingsJson property of the environment object defined)

* Bump socket.io-parser from 4.2.2 to 4.2.3

Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.2.2 to 4.2.3.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](socketio/socket.io-parser@4.2.2...4.2.3)

---
updated-dependencies:
- dependency-name: socket.io-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* - For missing toc.json/settings.json
- Resolved an issue that could cause the player presence widget to fail to display for non-sync-start games.
- Gameboard now only looks for settings.json in production environments (or any env that has the settingsJson property of the environment object defined)

* Add eslint, configure rules, and fix critical issues.

* Allow root-relative imports in gameboard-ui

* Add custom input component to allow for custom components with ngmodel

* Update angular to 15.2.5

* Client-side defense for illegal file uploads

* Improved error handling for illegal mime types. Support area formatting updates.

* Allow escaped html to render in support tickets.

* Added a component that allows inline rendering of links while preserving user-entered text. Resolves #204.

* Revise error message on bad file upload.

* Added handling for multiline strings in ticket comments.

* Pin gh actions for vs code extension. Add tap and log tool. Update ngx-bootstrap.

* Remove unused property of game model

* Add game engine mode enum

* Addresses GBAPI #236.

* - Fixed a bug that caused 'game over' to appear before a player session started.
- Added logic to support admin enroll/start for tester, admin, and registrar.
- Improved UI logic in the Player Enroll component.

* simplify display logic for enrollment panel.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* v3.10.3 (#136)

* Convert usages of bypassSecurityTrustHtml to sanitize and reworked some template control flows.

* - For missing toc.json/settings.json
- Resolved an issue that could cause the player presence widget to fail to display for non-sync-start games.
- Gameboard now only looks for settings.json in production environments (or any env that has the settingsJson property of the environment object defined)

* Bump socket.io-parser from 4.2.2 to 4.2.3

Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.2.2 to 4.2.3.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](socketio/socket.io-parser@4.2.2...4.2.3)

---
updated-dependencies:
- dependency-name: socket.io-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* - For missing toc.json/settings.json
- Resolved an issue that could cause the player presence widget to fail to display for non-sync-start games.
- Gameboard now only looks for settings.json in production environments (or any env that has the settingsJson property of the environment object defined)

* Add eslint, configure rules, and fix critical issues.

* Allow root-relative imports in gameboard-ui

* Add custom input component to allow for custom components with ngmodel

* Update angular to 15.2.5

* - For missing toc.json/settings.json
- Resolved an issue that could cause the player presence widget to fail to display for non-sync-start games.
- Gameboard now only looks for settings.json in production environments (or any env that has the settingsJson property of the environment object defined)

* Bump socket.io-parser from 4.2.2 to 4.2.3

Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.2.2 to 4.2.3.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](socketio/socket.io-parser@4.2.2...4.2.3)

---
updated-dependencies:
- dependency-name: socket.io-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* - For missing toc.json/settings.json
- Resolved an issue that could cause the player presence widget to fail to display for non-sync-start games.
- Gameboard now only looks for settings.json in production environments (or any env that has the settingsJson property of the environment object defined)

* Add eslint, configure rules, and fix critical issues.

* Allow root-relative imports in gameboard-ui

* Add custom input component to allow for custom components with ngmodel

* Update angular to 15.2.5

* Client-side defense for illegal file uploads

* Improved error handling for illegal mime types. Support area formatting updates.

* Allow escaped html to render in support tickets.

* Added a component that allows inline rendering of links while preserving user-entered text. Resolves #204.

* Revise error message on bad file upload.

* Added handling for multiline strings in ticket comments.

* Pin gh actions for vs code extension. Add tap and log tool. Update ngx-bootstrap.

* Remove unused property of game model

* Add game engine mode enum

* Addresses GBAPI #236.

* - Fixed a bug that caused 'game over' to appear before a player session started.
- Added logic to support admin enroll/start for tester, admin, and registrar.
- Improved UI logic in the Player Enroll component.

* simplify display logic for enrollment panel.

* Improve error rendering in practice area.

* Resolved an issue that caused competitive-mode challenges to fail to render gamespace limit errors. Partially addresses #258.

* Code cleanup

* Corrected a bug that prevented correct resolution of practice challenges.

* Accommodate production config of error message rendering.

* Improve rendering of launch error for gamespace limit.

* Show game title on game/gameboard pages.

* Add warning to game mapper if a spec has 0 points

* Reposition spec points alert

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* v3.10.3.1 (#137)

* Convert usages of bypassSecurityTrustHtml to sanitize and reworked some template control flows.

* - For missing toc.json/settings.json
- Resolved an issue that could cause the player presence widget to fail to display for non-sync-start games.
- Gameboard now only looks for settings.json in production environments (or any env that has the settingsJson property of the environment object defined)

* Bump socket.io-parser from 4.2.2 to 4.2.3

Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.2.2 to 4.2.3.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](socketio/socket.io-parser@4.2.2...4.2.3)

---
updated-dependencies:
- dependency-name: socket.io-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* - For missing toc.json/settings.json
- Resolved an issue that could cause the player presence widget to fail to display for non-sync-start games.
- Gameboard now only looks for settings.json in production environments (or any env that has the settingsJson property of the environment object defined)

* Add eslint, configure rules, and fix critical issues.

* Allow root-relative imports in gameboard-ui

* Add custom input component to allow for custom components with ngmodel

* Update angular to 15.2.5

* - For missing toc.json/settings.json
- Resolved an issue that could cause the player presence widget to fail to display for non-sync-start games.
- Gameboard now only looks for settings.json in production environments (or any env that has the settingsJson property of the environment object defined)

* Bump socket.io-parser from 4.2.2 to 4.2.3

Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.2.2 to 4.2.3.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](socketio/socket.io-parser@4.2.2...4.2.3)

---
updated-dependencies:
- dependency-name: socket.io-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* - For missing toc.json/settings.json
- Resolved an issue that could cause the player presence widget to fail to display for non-sync-start games.
- Gameboard now only looks for settings.json in production environments (or any env that has the settingsJson property of the environment object defined)

* Add eslint, configure rules, and fix critical issues.

* Allow root-relative imports in gameboard-ui

* Add custom input component to allow for custom components with ngmodel

* Update angular to 15.2.5

* Client-side defense for illegal file uploads

* Improved error handling for illegal mime types. Support area formatting updates.

* Allow escaped html to render in support tickets.

* Added a component that allows inline rendering of links while preserving user-entered text. Resolves #204.

* Revise error message on bad file upload.

* Added handling for multiline strings in ticket comments.

* Pin gh actions for vs code extension. Add tap and log tool. Update ngx-bootstrap.

* Remove unused property of game model

* Add game engine mode enum

* Addresses GBAPI #236.

* - Fixed a bug that caused 'game over' to appear before a player session started.
- Added logic to support admin enroll/start for tester, admin, and registrar.
- Improved UI logic in the Player Enroll component.

* simplify display logic for enrollment panel.

* Improve error rendering in practice area.

* Resolved an issue that caused competitive-mode challenges to fail to render gamespace limit errors. Partially addresses #258.

* Code cleanup

* Corrected a bug that prevented correct resolution of practice challenges.

* Accommodate production config of error message rendering.

* Improve rendering of launch error for gamespace limit.

* Show game title on game/gameboard pages.

* Add warning to game mapper if a spec has 0 points

* Reposition spec points alert

* Pass only required info to challenge start/stop endpoints in competitive mode.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* More require sponsor on the frontend

* More frontend for require sponsor.

* Remove unused call in sponsor service.

* Show toast on sponsor browser when sponsor added.

* More refactoring of sponsor - pull extra model properties, adjust to new API shape.

* Refactoring of sponsor UI, updates to sponsor select to show grouped sponsors.

* Management of parent sponsors, improvements to UI layout for profile.

* Remove old sponsors report parameter control to make way for a new one.

* Reshape sponsor endpoint to allow listing with children

* Add custom report filter for new sponsor hierarchy

* Merge from next

* Correct merge for player-enroll

* Add solution guide field to challenge specs for practice mode

* Corrected a bug that prevented the table view from working in the Games tab of admin. Resolves #145

* Add suggested searches to practice area. Partially resolves GBAPI#233.

* Don't persist the 'confirming' state on the gameboard page if the user switches challenges before confirming. Addresses GBAPI#178

* Always show admin enroll if it's available to the current user based on roll (ignore whether we're in the registration window or not

* Code cleanup

* Fix an issue that prevented the new warning about zero-point challenges from hiding upon point value change.

* Add toggle to always show solution guide in competitive mode. Always show solution guide input.

* Fix broken link to profile/history

* Remove client-side correction of relative URLs in challenge docs (we do it server side now.

* Addressed wonky update behavior in the new challenge spec editor component.

* Remove logging

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jeff Mattson <jmattson@sei.cmu.edu>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jarrett Booz <89405171+sei-jbooz@users.noreply.github.com>
  • Loading branch information
4 people authored Oct 6, 2023
1 parent d048911 commit 9ca851f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ <h2 class="m-0 p-0 fs-11">{{ spec.name }}</h2>
</div>
<hr class="my-2">
<div class="d-flex align-items-center justify-content-end">
<app-confirm-button btnClass="btn btn-sm btn-danger">Delete</app-confirm-button>
<app-confirm-button btnClass="btn btn-sm btn-danger"
(confirm)="handleSpecDeleted(spec)">Delete</app-confirm-button>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,26 @@ import { Subject, debounceTime, filter, firstValueFrom, switchMap, tap } from 'r
})
export class ChallengeSpecEditorComponent implements OnChanges {
@Input() spec?: Spec;
@Output() specDelete = new EventEmitter<Spec>();
@Output() specUpdate = new EventEmitter<Spec>();

protected fa = fa;
protected slug = slug;
protected requestUpdateSpec$ = new Subject<Spec>();

constructor(
private specService: SpecService,
private unsub: UnsubscriberService) {
this.unsub.add(
this.requestUpdateSpec$.pipe(
debounceTime(500),
filter(s => s.points >= 0),
switchMap(s => this.specService.update(s)),
tap(s => this.specUpdate.emit(s)),
).subscribe()
);
}
constructor() { }

ngOnChanges(changes: SimpleChanges): void {
if (!this.spec) {
throw new Error("The ChallengeSpecEditor requires a challenge spec.");
}
}

async handleSpecUpdated(spec: Spec) {
this.requestUpdateSpec$.next(spec);
protected handleSpecUpdated(spec: Spec) {
this.specUpdate.emit(spec);
}

protected handleSpecDeleted(spec: Spec) {
this.specDelete.emit(spec);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
<span>Reset</span>
</button>
</app-dropzone>
<div class="form-group pb-1 pt-1">
<!-- <label for="logo-input">Map Image</label> -->
</div>
<div>
Alt+Drag (Option+Drag on Macs) to resize hotspots
</div>
Expand All @@ -61,8 +58,8 @@ <h4>Challenge Specs</h4>

<ul class="spec-list mt-4">
<li *ngFor="let spec of list$ | async">
<app-challenge-spec-editor class="d-block mb-3" [spec]="spec"
(specUpdate)="this.refresh()"></app-challenge-spec-editor>
<app-challenge-spec-editor class="d-block mb-3" [spec]="spec" (specDelete)="this.deleting$.next(spec)"
(specUpdate)="this.updating$.next(spec)"></app-challenge-spec-editor>
</li>
</ul>

Expand Down

0 comments on commit 9ca851f

Please sign in to comment.