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: Update theme switcher to use Angular 18 practices #9250

Merged
merged 40 commits into from
Nov 16, 2024
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
76c0243
Update theme components to use signals
FelixTJDietrich Aug 26, 2024
2df316c
move variables around
FelixTJDietrich Aug 26, 2024
33c849e
move more variables
FelixTJDietrich Aug 26, 2024
ccaef4a
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
FelixTJDietrich Aug 27, 2024
92d26d6
try fixing tests
FelixTJDietrich Aug 27, 2024
639bda7
try fixing tests
FelixTJDietrich Aug 29, 2024
cb5468f
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
FelixTJDietrich Aug 30, 2024
5ddeab5
fix theme service tests
FelixTJDietrich Aug 30, 2024
9da056e
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
FelixTJDietrich Sep 10, 2024
f5ad47e
Merge remote-tracking branch 'origin/chore/performance/angular-18-sig…
FelixTJDietrich Sep 12, 2024
7ed3cbc
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
FelixTJDietrich Sep 12, 2024
ad43212
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
FelixTJDietrich Sep 12, 2024
aca687e
remove effect and replace with RxJS
FelixTJDietrich Sep 12, 2024
d3b2920
fix system preference
FelixTJDietrich Sep 12, 2024
b40ef0c
fix some tests
FelixTJDietrich Sep 12, 2024
378f514
fix naming
FelixTJDietrich Sep 12, 2024
19bd309
try fixing test issues
FelixTJDietrich Sep 12, 2024
78010e0
fix more tests and simplify emoji stuff
FelixTJDietrich Sep 13, 2024
ea144b3
fix theme-switch.component.spec.ts
JohannesWt Sep 18, 2024
3438c37
change signal logic slightly & update client tests
JohannesWt Oct 7, 2024
8ce0858
fix more client tests
JohannesWt Oct 7, 2024
7d78fdd
fix more client tests
JohannesWt Oct 7, 2024
1fd68f4
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
JohannesWt Oct 8, 2024
7b76e35
fix monaco-editor.service.spec.ts
JohannesWt Oct 8, 2024
ccc07c3
fix code-editor-instructor.integration.spec.ts
JohannesWt Oct 8, 2024
2a19411
add track expression & add fix more programming-exercise-instruction.…
JohannesWt Oct 8, 2024
d99223c
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
FelixTJDietrich Nov 7, 2024
c333b95
fix tests
FelixTJDietrich Nov 7, 2024
e5add94
fix programming exercise instructions component
FelixTJDietrich Nov 8, 2024
c4cd5fa
fix translation
FelixTJDietrich Nov 8, 2024
0740832
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
FelixTJDietrich Nov 8, 2024
d4c0335
Merge branch 'chore/performance/angular-18-signal-migration-example' …
FelixTJDietrich Nov 8, 2024
e697bb5
fix modules?
FelixTJDietrich Nov 8, 2024
3320c6c
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
FelixTJDietrich Nov 13, 2024
a2abbdd
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
FelixTJDietrich Nov 13, 2024
2d4f970
fix failing tests
FelixTJDietrich Nov 13, 2024
835f676
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
FelixTJDietrich Nov 13, 2024
605c833
Merge branch 'chore/performance/angular-18-signal-migration-example' …
FelixTJDietrich Nov 13, 2024
cfacf8b
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
FelixTJDietrich Nov 13, 2024
7a4ff5d
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
krusche Nov 16, 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
Prev Previous commit
Next Next commit
fix more client tests
JohannesWt committed Oct 7, 2024
commit 7d78fdd326bb83c679bb47ab3de581bbf0a029a0
3 changes: 2 additions & 1 deletion src/main/webapp/app/core/theme/theme-switch.component.ts
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ import { PlacementArray } from '@ng-bootstrap/ng-bootstrap/util/positioning';
import { Theme, ThemeService } from 'app/core/theme/theme.service';
import { fromEvent } from 'rxjs';
import { faSync } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';

/**
* Displays a sun or a moon in the navbar, depending on the current theme.
@@ -15,7 +16,7 @@ import { faSync } from '@fortawesome/free-solid-svg-icons';
selector: 'jhi-theme-switch',
templateUrl: './theme-switch.component.html',
styleUrls: ['theme-switch.component.scss'],
imports: [TranslateModule, NgbModule],
imports: [TranslateModule, NgbModule, FontAwesomeModule],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
})
Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@ describe('NavbarComponent', () => {
MockComponent(JhiConnectionWarningComponent),
MockComponent(SystemNotificationComponent),
MockComponent(FaIconComponent),
ThemeSwitchComponent,
MockComponent(ThemeSwitchComponent),
],
providers: [
provideHttpClient(),
@@ -136,6 +136,11 @@ describe('NavbarComponent', () => {
},
],
})
.overrideComponent(NavbarComponent, {
remove: {
imports: [ThemeSwitchComponent],
},
})
.compileComponents()
.then(() => {
fixture = TestBed.createComponent(NavbarComponent);
Original file line number Diff line number Diff line change
@@ -85,7 +85,8 @@ describe('Guided tour integration', () => {
MockComponent(CoursesComponent),
MockComponent(SecuredImageComponent),
MockComponent(SystemNotificationComponent),
MockComponent(ThemeSwitchComponent),
// Component can not be mocked at the moment https://github.com/help-me-mom/ng-mocks/issues/8634
ThemeSwitchComponent,
MockComponent(DocumentationButtonComponent),
MockPipe(ArtemisTranslatePipe),
MockPipe(ArtemisDatePipe),

Unchanged files with check annotations Beta

@Override
@Async
public void sendNotification(Notification notification, Set<User> users, Object notificationSubject) {
final Optional<String> relayServerBaseUrl = getRelayBaseUrl();

Check failure on line 144 in src/main/java/de/tum/cit/aet/artemis/communication/service/notifications/push_notifications/PushNotificationService.java

GitHub Actions / H2 Tests

de.tum.cit.aet.artemis.communication.notification.SingleUserNotificationServiceTest ► testTutorialGroupNotifications_groupUnassigned()

Failed test found in: build/test-results/test/TEST-de.tum.cit.aet.artemis.communication.notification.SingleUserNotificationServiceTest.xml Error: org.mockito.exceptions.verification.TooManyActualInvocations:
Raw output
org.mockito.exceptions.verification.TooManyActualInvocations: 
firebasePushNotificationService.sendNotification(
    <any de.tum.cit.aet.artemis.communication.domain.notification.Notification>,
    <any set>,
    <any java.lang.Object>
);
Wanted 1 time:
-> at de.tum.cit.aet.artemis.communication.service.notifications.push_notifications.PushNotificationService.sendNotification(PushNotificationService.java:144)
But was 2 times:
-> at de.tum.cit.aet.artemis.communication.service.notifications.push_notifications.PushNotificationService.sendNotification(PushNotificationService.java:129)
-> at de.tum.cit.aet.artemis.communication.service.notifications.push_notifications.PushNotificationService.sendNotification(PushNotificationService.java:129)


	at app//de.tum.cit.aet.artemis.communication.service.notifications.push_notifications.PushNotificationService.sendNotification(PushNotificationService.java:144)
	at app//de.tum.cit.aet.artemis.communication.notification.SingleUserNotificationServiceTest.verifyPush(SingleUserNotificationServiceTest.java:588)
	at app//de.tum.cit.aet.artemis.communication.notification.SingleUserNotificationServiceTest.testTutorialGroupNotifications_groupUnassigned(SingleUserNotificationServiceTest.java:555)
	at java.base@21.0.4/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base@21.0.4/java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:194)
	at java.base@21.0.4/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base@21.0.4/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base@21.0.4/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base@21.0.4/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base@21.0.4/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
if (relayServerBaseUrl.isEmpty()) {
return;
*/
@Async
public void updateProgressByCompetencyAsync(CourseCompetency competency) {
SecurityUtils.setAuthorizationObject(); // Required for async

Check failure on line 123 in src/main/java/de/tum/cit/aet/artemis/atlas/service/competency/CompetencyProgressService.java

GitHub Actions / H2 Tests

de.tum.cit.aet.artemis.modeling.ModelingExerciseIntegrationTest ► testDeleteModelingExerciseWithCompetency()

Failed test found in: build/test-results/test/TEST-de.tum.cit.aet.artemis.modeling.ModelingExerciseIntegrationTest.xml Error: Wanted but not invoked:
Raw output
Wanted but not invoked:
competencyProgressService.updateProgressByCompetencyAsync(
    de.tum.cit.aet.artemis.atlas.domain.competency.Competency@34
);
-> at de.tum.cit.aet.artemis.atlas.service.competency.CompetencyProgressService.updateProgressByCompetencyAsync(CompetencyProgressService.java:123)
Actually, there were zero interactions with this mock.

	at app//de.tum.cit.aet.artemis.atlas.service.competency.CompetencyProgressService.updateProgressByCompetencyAsync(CompetencyProgressService.java:123)
	at app//de.tum.cit.aet.artemis.modeling.ModelingExerciseIntegrationTest.testDeleteModelingExerciseWithCompetency(ModelingExerciseIntegrationTest.java:415)
	at java.base@21.0.4/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base@21.0.4/java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:194)
	at java.base@21.0.4/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base@21.0.4/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base@21.0.4/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base@21.0.4/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base@21.0.4/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
List<CompetencyProgress> existingProgress = competencyProgressRepository.findAllByCompetencyId(competency.getId());
log.debug("Updating competency progress for {} users.", existingProgress.size());
existingProgress.stream().map(CompetencyProgress::getUser).forEach(user -> updateCompetencyProgress(competency.getId(), user));