Skip to content
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

Development #1679

Merged
merged 61 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
ded893c
NPM updates
Lykos Oct 28, 2024
5232f28
Merge branch 'master' into development
Lykos Oct 29, 2024
41decf4
Updated ngrx
Lykos Oct 29, 2024
c33d4cb
Readded package lock
Lykos Oct 29, 2024
bb5ca51
Update typescript.yml to use node 22.
Lykos Oct 31, 2024
ef402a0
Update ruby.yml to use Node 22.
Lykos Oct 31, 2024
ecf4c2a
Merge branch 'master' into development
Lykos Oct 31, 2024
65e28cb
Merge branch 'development' of github.com:Lykos/cube_trainer into deve…
Lykos Oct 31, 2024
31261da
Updated Angular.
Lykos Oct 31, 2024
f6b7f1d
Updated rubocop
Lykos Oct 31, 2024
3a497d0
Updated rails
Lykos Oct 31, 2024
b084a25
Fixed package-lock
Lykos Oct 31, 2024
e530180
Merge branch 'master' into development
Lykos Oct 31, 2024
efc0e23
Merge branch 'master' into development
Lykos Nov 8, 2024
007fefb
Updated eslint
Lykos Nov 8, 2024
62643a7
Slightly updated angular
Lykos Nov 8, 2024
d2ad9cd
Extended sleep for flaky new_training_session_spec.
Lykos Nov 8, 2024
bbb26c1
Updated package-lock.json
Lykos Nov 8, 2024
f72c754
Updated NPM
Lykos Nov 8, 2024
ade80c9
Updated package-lock.json
Lykos Nov 8, 2024
2d725d3
Merge branch 'master' into development
Lykos Nov 14, 2024
ac3ac44
Upgradet typescript-eslint
Lykos Nov 14, 2024
9b343fc
Upgraded rspec-rails
Lykos Nov 14, 2024
9a6fa3e
Upgraded @rails/actioncable
Lykos Nov 14, 2024
fbbc3bd
Updated gems
Lykos Nov 14, 2024
d16251f
New cop
Lykos Nov 14, 2024
007b031
Merge branch 'master' into development
Lykos Nov 14, 2024
cce142b
Merge branch 'master' into development
Lykos Dec 14, 2024
4bc3339
Merge branch 'master' into development
Lykos Dec 14, 2024
c9f3c9b
New cops
Lykos Dec 14, 2024
c11dc4c
Updated selenium webdriver
Lykos Dec 14, 2024
7eb40d9
Merge branch 'master' into development
Lykos Dec 14, 2024
c31ba4b
Merge branch 'master' into development
Lykos Dec 20, 2024
7370217
Updated angular
Lykos Dec 20, 2024
ca56d6a
Made all components and pipes NOT standalone (for migration to Angula…
Lykos Dec 21, 2024
74315ec
Revert "Made all components and pipes NOT standalone (for migration t…
Lykos Dec 21, 2024
1a7c333
Removed unused delete-user-button (note that delete-account-button is…
Lykos Dec 21, 2024
9c7a4aa
Migrated to standalone components properly
Lykos Dec 21, 2024
acafecb
Migrated control flows
Lykos Dec 21, 2024
933a384
Added new dependencies now that we have standalone components
Lykos Dec 21, 2024
ad518a9
Deduplicated browser module a bit
Lykos Dec 21, 2024
bfab121
REmoved browser module a bit more
Lykos Dec 21, 2024
4beb250
REmoved browser module a bit more
Lykos Dec 21, 2024
5229c2a
Export async pipe via shared
Lykos Dec 21, 2024
a9d2e9e
Fixed typescript tests
Lykos Dec 21, 2024
9069b34
Fixed more missing dependencies not visible in tests
Lykos Dec 21, 2024
295fb66
Updated stuff.
Lykos Dec 21, 2024
03c9538
Tried to migrate to standalone app component
Lykos Dec 21, 2024
a511ec6
Unmigrated main.ts
Lykos Dec 21, 2024
ecfae8b
Partially migrated away from shared module
Lykos Dec 21, 2024
4d34f00
Migrated bootstrapping
Lykos Dec 21, 2024
7e9e59e
All dependencies for standalone modules! Yay
Lykos Dec 21, 2024
3cc915b
Fixed angular.json
Lykos Dec 21, 2024
38c0cb6
Added directives dependencies that weren't noticed at compile time
Lykos Dec 21, 2024
cecf7d7
More invisible directive dependencies fixed
Lykos Dec 21, 2024
2612e6f
Added app config
Lykos Dec 21, 2024
66677fd
Fixed router links
Lykos Dec 21, 2024
cc771ed
More router links
Lykos Dec 21, 2024
de6134c
Add package libmagic-dev
Lykos Dec 21, 2024
a71af50
Reordered packages to be installed before ruby
Lykos Dec 21, 2024
e642f8e
Sleep less since it doesn't help much anyway
Lykos Dec 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Update packages
run: sudo apt update

- name: Install OS Package Dependencies
uses: mstksg/get-package@v1
with:
apt-get: libpq-dev
apt-get: libpq-dev libmagic-dev

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Install Bundler
run: gem install bundler
Expand Down
6 changes: 3 additions & 3 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,18 @@
},
"configurations": {
"production": {
"browserTarget": "cube-trainer:build:production"
"buildTarget": "cube-trainer:build:production"
},
"development": {
"browserTarget": "cube-trainer:build:development"
"buildTarget": "cube-trainer:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "cube-trainer:build"
"buildTarget": "cube-trainer:build"
}
},
"test": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,21 @@ describe('TrainingSessionComponentIntegration', () => {
let router = jasmine.createSpyObj('Router', ['navigate']);

await TestBed.configureTestingModule({
declarations: [
imports: [
NoopAnimationsModule,
HttpClientTestingModule,
MatProgressSpinnerModule,
MatTooltipModule,
MatCheckboxModule,
MatTableModule,
MatPaginatorModule,
StoreModule.forRoot({
trainingSessions: trainingSessionsReducer,
trainer: trainerReducer,
router: routerReducer,
colorScheme: colorSchemeReducer,
}),
EffectsModule.forRoot([TrainingSessionsEffects, TrainerEffects]),
TrainingSessionComponent,
TrainerComponent,
TrainerInputComponent,
Expand All @@ -105,38 +119,20 @@ describe('TrainingSessionComponentIntegration', () => {
ResultsTableComponent,
DurationPipe,
FluidInstantPipe,
StatsTableComponent,
StatsTableComponent,
InstantPipe,
BackendActionLoadErrorComponent,
GithubErrorNoteComponent,
StopwatchDialogComponent,
],
imports: [
NoopAnimationsModule,
HttpClientTestingModule,
MatProgressSpinnerModule,
MatTooltipModule,
MatCheckboxModule,
MatTableModule,
MatPaginatorModule,
StoreModule.forRoot(
{
trainingSessions: trainingSessionsReducer,
trainer: trainerReducer,
router: routerReducer,
colorScheme: colorSchemeReducer,
},
),
EffectsModule.forRoot([TrainingSessionsEffects, TrainerEffects]),
],
providers: [
GithubErrorNoteComponent,
StopwatchDialogComponent,
],
providers: [
{ provide: ActivatedRoute, useValue: { params: of({ trainingSessionId: 1 }) } },
{ provide: MatDialog, useValue: matDialog },
{ provide: MatSnackBar, useValue: matSnackBar },
{ provide: Router, useValue: router },
{ provide: BreakpointObserver, useClass: FakeBreakpointObserver },
],
}).compileComponents();
{ provide: BreakpointObserver, useClass: FakeBreakpointObserver },
],
}).compileComponents();

httpMock = TestBed.inject(HttpTestingController);
});
Expand Down
18 changes: 8 additions & 10 deletions client/src/app/aa-early-tests/training-session.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,29 +71,27 @@ describe('TrainingSessionComponent', () => {
matDialog = jasmine.createSpyObj('MatDialog', ['open']);

await TestBed.configureTestingModule({
declarations: [
imports: [
MatProgressSpinnerModule,
MatTooltipModule,
TrainingSessionComponent,
TrainerComponent,
TrainerInputComponent,
TrainerStopwatchComponent,
StatsTableComponent,
StatsTableComponent,
StopwatchComponent,
HintComponent,
ResultsTableComponent,
DurationPipe,
BackendActionLoadErrorComponent,
],
imports: [
MatProgressSpinnerModule,
MatTooltipModule,
],
providers: [
],
providers: [
{ provide: ActivatedRoute, useValue: { params: of({ trainingSessionId: 1 }) } },
{ provide: TrainerService, useValue: trainerService },
{ provide: MatDialog, useValue: matDialog },
provideMockStore({}),
],
}).compileComponents();
],
}).compileComponents();

store = TestBed.inject(MockStore);
});
Expand Down
10 changes: 4 additions & 6 deletions client/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ import { AppComponent } from './app.component';
import { FooterComponent } from '@core/footer/footer.component';
import { MatToolbarModule } from '@angular/material/toolbar';

describe('AppComponent', () => {
xdescribe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [
AppComponent,
FooterComponent,
],
imports: [
MatToolbarModule
MatToolbarModule,
AppComponent,
FooterComponent
],
}).compileComponents();
});
Expand Down
6 changes: 5 additions & 1 deletion client/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { Component } from '@angular/core';
import { ToolbarComponent } from '@core/toolbar/toolbar.component';
import { FooterComponent } from '@core/footer/footer.component';
import { RouterOutlet } from '@angular/router'

@Component({
selector: 'cube-trainer',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
styleUrls: ['./app.component.css'],
imports: [ToolbarComponent, FooterComponent, RouterOutlet],
})
export class AppComponent {
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
import { importProvidersFrom, ApplicationConfig } from '@angular/core';
import { environment } from '@environment';
import { APP_BASE_HREF } from '@angular/common';
import { AngularTokenModule } from '@angular-token/angular-token.module';
import { BrowserModule } from '@angular/platform-browser';
import { provideAnimations } from '@angular/platform-browser/animations';
import { MethodExplorerModule } from './method-explorer/method-explorer.module';
import { withInterceptorsFromDi, provideHttpClient } from '@angular/common/http';
import { METADATA } from '@shared/metadata.const';
import { StoreModule } from '@ngrx/store';
import { userReducer } from '@store/user.reducer';
import { trainingSessionsReducer } from '@store/training-sessions.reducer';
import { trainerReducer } from '@store/trainer.reducer';
import { routerReducer, StoreRouterConnectingModule } from '@ngrx/router-store';
import { colorSchemeReducer } from '@store/color-scheme.reducer';
import { letterSchemeReducer } from '@store/letter-scheme.reducer';
import { EffectsModule } from '@ngrx/effects';
import { UserEffects } from '@effects/user.effects';
import { TrainingSessionsEffects } from '@effects/training-sessions.effects';
import { TrainerEffects } from '@effects/trainer.effects';
import { ColorSchemeEffects } from '@effects/color-scheme.effects';
import { LetterSchemeEffects } from '@effects/letter-scheme.effects';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { CookieService } from 'ngx-cookie-service';
import { FileSaverModule } from 'ngx-filesaver';
import { HttpClientModule } from '@angular/common/http';
import { AngularTokenService } from '@angular-token/angular-token.service';
import { NgModule } from '@angular/core';
import { MethodExplorerComponent } from './method-explorer/method-explorer/method-explorer.component';
import { UserComponent } from '@core/user/user.component';
import { ResetPasswordComponent } from '@core/reset-password/reset-password.component';
Expand Down Expand Up @@ -31,7 +56,6 @@ import { DisclaimerComponent } from '@core/disclaimer/disclaimer.component';
import { TermsAndConditionsComponent } from '@core/terms-and-conditions/terms-and-conditions.component';
import { NotFoundComponent } from '@core/not-found/not-found.component';
import { RouterModule, Routes, ExtraOptions } from '@angular/router';
import { environment } from '@environment';

const routes: Routes = [
{ path: 'welcome', component: WelcomeComponent },
Expand Down Expand Up @@ -73,10 +97,55 @@ const routerOptions: ExtraOptions = {
enableTracing: !environment.production,
};

@NgModule({
imports: [
RouterModule.forRoot(routes, routerOptions),
],
exports: [RouterModule]
})
export class AppRoutingModule { }
export const appConfig: ApplicationConfig = {
providers: [
CookieService,
importProvidersFrom(
BrowserModule, MethodExplorerModule, FileSaverModule, HttpClientModule,
RouterModule.forRoot(routes, routerOptions),
// TODO: Figure out whether we can move this to the core module.
// TODO: Don't use the host, use Location and PathLocationStrategy.
AngularTokenModule.forRoot({
loginField: 'email',
signInRedirect: 'login',
signInStoredUrlStorageKey: METADATA.signInStoredUrlStorageKey,
apiBase: environment.apiPrefix,
registerAccountCallback: `${environment.redirectProtocol}://${environment.host}/confirm-email`,
resetPasswordCallback: `${environment.redirectProtocol}://${environment.host}/update-password`,
}),
StoreModule.forRoot({
user: userReducer,
trainingSessions: trainingSessionsReducer,
trainer: trainerReducer,
router: routerReducer,
colorScheme: colorSchemeReducer,
letterScheme: letterSchemeReducer,
}, {
runtimeChecks: {
strictStateImmutability: true,
strictActionImmutability: true,
strictStateSerializability: true,
strictActionSerializability: true,
strictActionWithinNgZone: true,
strictActionTypeUniqueness: true,
},
}),
StoreRouterConnectingModule.forRoot(),
EffectsModule.forRoot([
UserEffects,
TrainingSessionsEffects,
TrainerEffects,
ColorSchemeEffects,
LetterSchemeEffects,
]),
StoreDevtoolsModule.instrument({
maxAge: 25, // Retains last 25 states
logOnly: environment.production, // Restrict extension to log-only mode
autoPause: true, // Pauses recording actions and state changes when the extension window is not open
})),
{ provide: APP_BASE_HREF, useValue: '/' },
AngularTokenModule,
provideAnimations(),
provideHttpClient(withInterceptorsFromDi())
]
}
89 changes: 0 additions & 89 deletions client/src/app/app.module.ts

This file was deleted.

Loading
Loading