Skip to content

Commit afa6eb9

Browse files
Merge pull request #28 from nullinside-development-group/feature/TwitchUserConfig
Adding configuration page for twitch bot
2 parents d8506e9 + 545c88c commit afa6eb9

27 files changed

+484
-115
lines changed

src/src/app/common/components/logo/logo.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Component, Input } from '@angular/core';
2-
import { Router } from '@angular/router';
1+
import {Component, Input} from '@angular/core';
2+
import {Router} from '@angular/router';
33

44
@Component({
55
selector: 'app-logo',
@@ -11,7 +11,7 @@ import { Router } from '@angular/router';
1111
export class LogoComponent {
1212
@Input() height: number = 50;
1313
@Input() fontSize: number = 35;
14-
@Input() words: string[] = ['inside ;', 'tests ;', 'inside ;', 'quality ;'];
14+
@Input() words: string[] = ['inside ;', 'tests ;', 'inside ;', 'quality ;'];
1515

1616
constructor(private router: Router) {
1717
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<span class="success">
2+
'hi'
3+
</span>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.success {
2+
color: green;
3+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { SuccessSnackBarComponent } from './success-snack-bar.component';
4+
5+
describe('SuccessSnackBarComponent', () => {
6+
let component: SuccessSnackBarComponent;
7+
let fixture: ComponentFixture<SuccessSnackBarComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [SuccessSnackBarComponent]
12+
})
13+
.compileComponents();
14+
15+
fixture = TestBed.createComponent(SuccessSnackBarComponent);
16+
component = fixture.componentInstance;
17+
fixture.detectChanges();
18+
});
19+
20+
it('should create', () => {
21+
expect(component).toBeTruthy();
22+
});
23+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-success-snack-bar',
5+
standalone: true,
6+
imports: [],
7+
templateUrl: './success-snack-bar.component.html',
8+
styleUrl: './success-snack-bar.component.scss'
9+
})
10+
export class SuccessSnackBarComponent {
11+
12+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface TwitchBotConfig {
2+
isEnabled: boolean;
3+
banKnownBots: boolean;
4+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export interface TwitchBotIsModResponse {
2+
isMod: boolean;
3+
}

src/src/app/middleware/bearer-token-interceptor.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import { Injectable } from '@angular/core';
2-
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
1+
import {Injectable} from '@angular/core';
2+
import {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';
33

4-
import { Observable } from 'rxjs';
5-
import { environment } from "../../environments/environment";
4+
import {Observable} from 'rxjs';
5+
import {environment} from "../../environments/environment";
66

77
@Injectable()
88
export class BearerTokenInterceptor implements HttpInterceptor {
99
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1010
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
1111
const url = req.url.toLowerCase().replace('https://www.', 'https://');
12-
if (!url.startsWith(`${environment.apiUrl}/`) && !url.startsWith(`${environment.nullApiUrl}/`)) {
12+
if (!url.startsWith(`${environment.apiUrl}/`) && !url.startsWith(`${environment.nullApiUrl}/`) &&
13+
!url.startsWith(`${environment.twitchBotApiUrl}/`)) {
1314
return next.handle(req);
1415
}
1516

src/src/app/service/nullinside-null.service.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { TestBed } from '@angular/core/testing';
1+
import {TestBed} from '@angular/core/testing';
22

3-
import { NullinsideNullService } from './nullinside-null.service';
4-
import { provideHttpClientTesting } from "@angular/common/http/testing";
5-
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
3+
import {NullinsideNullService} from './nullinside-null.service';
4+
import {provideHttpClientTesting} from "@angular/common/http/testing";
5+
import {provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
66

77
describe('NullinsideNullService', () => {
88
let service: NullinsideNullService;
99

1010
beforeEach(() => {
11-
TestBed.configureTestingModule({
12-
imports: [],
13-
providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
14-
});
11+
TestBed.configureTestingModule({
12+
imports: [],
13+
providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
14+
});
1515
service = TestBed.inject(NullinsideNullService);
1616
});
1717

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import {TestBed} from '@angular/core/testing';
2+
3+
import {NullinsideTwitchBotService} from './nullinside-twitch-bot.service';
4+
import {provideHttpClientTesting} from "@angular/common/http/testing";
5+
import {provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
6+
7+
describe('NullinsideTwitchBotService', () => {
8+
let service: NullinsideTwitchBotService;
9+
10+
beforeEach(() => {
11+
TestBed.configureTestingModule({
12+
imports: [],
13+
providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
14+
});
15+
service = TestBed.inject(NullinsideTwitchBotService);
16+
});
17+
18+
it('should be created', () => {
19+
expect(service).toBeTruthy();
20+
});
21+
});

0 commit comments

Comments
 (0)