Skip to content

Commit

Permalink
Updated Tasks
Browse files Browse the repository at this point in the history
Added a "pending complete" Ensemble to in-memory repo at startup
  • Loading branch information
tedyoung committed Oct 2, 2023
1 parent cc0c60b commit 943329d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 20 deletions.
46 changes: 29 additions & 17 deletions Tasks.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
# Tasks

[X] Ensemble: Add "Spectators" (as Set<MemberId>)
[X] void joinAsSpectator(MemberId memberId)
[X] remove from Accepted
[X] remove from Declined
[X] Set<MemberId> spectators()
[X] Accept removes from Spectators
[X] Decline removes from Spectators
[X] EnsembleService: joinAsSpectator(EnsembleId, MemberId)
[ ] Add "Spectators" column to the member-register template
[X] Dummy copy of spectators: use copy of participants
[X] Add the real Spectators to the EnsembleSummaryView object
[X] Add new POST endpoint to MemberController for joinAsSpectator
[X] Add button for "Join as Spectator"
[ ] Only show "Spectate" when it makes sense (when not already Spectator)
[ ] If you are Spectator, show "Leave" button instead
[ ] Update schema and DB adapter for "Spectators" data from Ensemble
[ ] Show Zoom/Calendar link when spectating

[ ] Hide both Join & Participate buttons when the Ensemble is in the past (e.g., "pending_complete")
[ ] Test against EnsembleSummaryView, adding a "show" boolean for each of the Actions

[ ] Replace EnsembleSummaryView.memberStatus with ActionLinks (for right-most column)
[ ] Remove deprecated EnsembleSummaryView.memberStatus() method
[ ] Remove showing memberStatus from member-register.html

[ ] Start writing HTML tests??

# Optional

[ ] Add notification when joining as spectator

[ ] Don't show "Spectate" button if ensemble is ineligible
Expand All @@ -36,4 +29,23 @@
## UI

* Change table to fixed width grid instead of flex to avoid columns changing size and moving around
*

# DONE

[X] Ensemble: Add "Spectators" (as Set<MemberId>)
[X] void joinAsSpectator(MemberId memberId)
[X] remove from Accepted
[X] remove from Declined
[X] Set<MemberId> spectators()
[X] Accept removes from Spectators
[X] Decline removes from Spectators
[X] EnsembleService: joinAsSpectator(EnsembleId, MemberId)
[X] Add "Spectators" column to the member-register template
[X] Dummy copy of spectators: use copy of participants
[X] Add the real Spectators to the EnsembleSummaryView object
[X] Add new POST endpoint to MemberController for joinAsSpectator
[X] Add button for "Join as Spectator"
[X] Only show "Spectate" when it makes sense (when not already Spectator)
[X] If you are Spectator, show "Leave" button instead
[X] Show Zoom/Calendar link when spectating

9 changes: 7 additions & 2 deletions src/main/java/com/jitterted/mobreg/MobRegApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.jitterted.mobreg.application.port.InMemoryMemberRepository;
import com.jitterted.mobreg.application.port.MemberRepository;
import com.jitterted.mobreg.domain.Ensemble;
import com.jitterted.mobreg.domain.Member;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
Expand All @@ -24,9 +25,13 @@ public static void main(String[] args) {

@Bean
@ConditionalOnProperty("mobreg.repository.inmemory")
public EnsembleRepository ensembleRepository() {
public EnsembleRepository ensembleRepository(MemberRepository memberRepository) {
InMemoryEnsembleRepository inMemoryEnsembleRepository = new InMemoryEnsembleRepository();
inMemoryEnsembleRepository.save(new Ensemble("Automatic", URI.create("https://zoom.us"), ZonedDateTime.now().plusHours(1)));
inMemoryEnsembleRepository.save(new Ensemble("Created by App Startup: Future Event", URI.create("https://zoom.us"), ZonedDateTime.now().plusHours(1)));
Ensemble pendingComplete = new Ensemble("Created by App Startup: Pending Complete", URI.create("https://zoom.us"), ZonedDateTime.now().minusDays(1));
Member member = memberRepository.save(new Member("Ted", "tedyoung", "ROLE_USER", "ROLE_MEMBER", "ROLE_ADMIN"));
pendingComplete.acceptedBy(member.getId());
inMemoryEnsembleRepository.save(pendingComplete);
return inMemoryEnsembleRepository;
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/templates/member-register.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ <h2 class="text-xl font-medium leading-7 text-gray-900 sm:text-2xl sm:truncate">
class="whitespace-nowrap rounded bg-blue-600 shadow-md px-4 py-2 text-xs font-semibold uppercase leading-normal text-white hover:bg-blue-500 focus:outline-none focus:ring-1 focus:ring-offset-1 active:bg-blue-400">
spectator &#x1F440; button text
</button>
<p th:text="${ensemble.memberStatus}">Member Status</p>
<!-- UNCOMMENT TO SHOW MEMBER STATUS -->
<!-- <p th:text="${ensemble.memberStatus}">Member Status</p>-->
</form>
</td>

Expand Down

0 comments on commit 943329d

Please sign in to comment.