Skip to content

Commit

Permalink
fixes session link with URL params
Browse files Browse the repository at this point in the history
  • Loading branch information
iislucas committed Jan 26, 2024
1 parent e2f2310 commit afcb9bd
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 299 deletions.
25 changes: 12 additions & 13 deletions llm-meditators/webapp/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,52 +18,51 @@
<mat-nav-list class="menu-buttons">
@for (stageName of dataService.user().completedStageNames; track stageName) {
<mat-list-item
[activated]="false"
matListItemTitle
routerLink="/"
routerLinkActive="active"
[routerLink]="['/']"
[queryParams]="{ stage: stageName }"
[class.highlighted]="dataService.session().stage === stageName"
ariaCurrentWhenActive="page"
(click)="updateCurrentStageName(stageName)"
class="menu-item {{ stageName === dataService.user().currentStageName ? 'current-stage' : '' }}"
class="menu-item"
>
<!-- (click)="updateCurrentStageName(stageName)" -->
<div class="menu-item-inner">
{{ stageName }}
<mat-icon class="icon completed" fontIcon="check"></mat-icon>
</div>
</mat-list-item>
}
<mat-list-item
[activated]="false"
matListItemTitle
routerLink="/"
routerLinkActive="active"
[routerLink]="['/']"
ariaCurrentWhenActive="page"
#rla="routerLinkActive"
[routerLinkActiveOptions]="{ exact: true }"
routerLinkActive
class="menu-item working-on-stage"
(click)="updateCurrentStageName(workingOnStageName())"
[class.highlighted]="dataService.session().stage === workingOnStageName() && rla.isActive"
>
<div class="menu-item-inner">
{{ workingOnStageName() }}
<div class="ongoing-badge">ongoing</div>
{{ rla.isActive }}
</div>
</mat-list-item>
@for (stageName of dataService.user().futureStageNames; track stageName) {
<mat-list-item
[disabled]="true"
[activated]="false"
matListItemTitle
routerLink="/"
routerLinkActive="active"
ariaCurrentWhenActive="page"
class="menu-item future-stage"
>
{{ stageName }}
</mat-list-item>
}
<mat-list-item
[activated]="router.url === '/settings'"
matListItemTitle
routerLink="/settings"
routerLinkActive="active"
routerLinkActive="highlighted"
ariaCurrentWhenActive="page"
>
<div class="icon-menu-item"><mat-icon>settings</mat-icon>Settings</div>
Expand Down
10 changes: 7 additions & 3 deletions llm-meditators/webapp/src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,16 @@ $toolbar-height: 60px;
flex: 1 1 auto;
overflow: auto;

.current-stage {
background-color: #3f51b555;
.highlighted {
background-color: #ddd;
}

.working-on-stage {
background-color: #ddd;
.menu-item-inner {}
}

.active {
color: #D00;
}

.menu-item-inner {
Expand Down
2 changes: 1 addition & 1 deletion llm-meditators/webapp/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class AppComponent implements AfterViewInit {
effect(() => {
// document.querySelector('title')!.textContent =
// this.dataService.appName();
document.title = `Rudders: ${this.dataService.appName()}`;
document.title = `Experiment: ${this.dataService.appName()}`;
});
}

Expand Down
2 changes: 2 additions & 0 deletions llm-meditators/webapp/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ import { NgModule } from '@angular/core';
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
import { SavedDataService } from './services/saved-data.service';
import { VertexApiService } from './services/vertex-api.service';
import { RouterModule } from '@angular/router';

@NgModule({
declarations: [AppComponent, AppSettingsComponent, PageNotFoundComponent],
providers: [VertexApiService, SavedDataService, LmApiService, GoogleAuthService, GoogleSheetsService],
bootstrap: [AppComponent],
imports: [
BrowserModule,
RouterModule,
AppRoutingModule,
BrowserAnimationsModule,
MatButtonModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ export class ExpLeaderVoteComponent {
this.dataService.setStageComplete(true);
}
this.votes[userId] = value;
this.dataService.editCurrentExpStageData<Votes>(() => this.votes);
this.dataService.editWorkingOnExpStageData<Votes>(() => this.votes);
}

resetVote(userId: string) {
this.votes[userId] = LeaderVote.NOT_RATED;
this.dataService.editCurrentExpStageData<Votes>(() => this.votes);
this.dataService.editWorkingOnExpStageData<Votes>(() => this.votes);
}
}
43 changes: 0 additions & 43 deletions llm-meditators/webapp/src/app/exp-rating/exp-rating.component.html

This file was deleted.

106 changes: 0 additions & 106 deletions llm-meditators/webapp/src/app/exp-rating/exp-rating.component.scss

This file was deleted.

This file was deleted.

58 changes: 0 additions & 58 deletions llm-meditators/webapp/src/app/exp-rating/exp-rating.component.ts

This file was deleted.

Loading

0 comments on commit afcb9bd

Please sign in to comment.