Skip to content
This repository was archived by the owner on Sep 15, 2023. It is now read-only.

Commit c0a93b9

Browse files
authored
Merge pull request #22 from admin-ch/info
Info
2 parents 1447b57 + acfac0f commit c0a93b9

17 files changed

Lines changed: 60 additions & 84 deletions

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ha-ui",
3-
"version": "1.0.9",
3+
"version": "1.0.10",
44
"scripts": {
55
"start": "ng serve",
66
"build": "ng build",

src/app/app.component.html

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
{{ "footer.built.suffix" | translate }}
2121
</p>
2222
</ng-container>
23-
<ng-container obOffCanvasTitle>{{ "help.title" | translate }}</ng-container>
24-
<ng-container obOffCanvasContent>
25-
<ha-help></ha-help>
26-
</ng-container>
2723
<ng-container *ngIf="isAuthenticated$ | async">
2824
<ng-template #obHeaderControl>
2925
<button [matTooltip]="'logout' | translate" class="control-link" (click)="logout()">
@@ -34,16 +30,6 @@
3430
<ng-template #obHeaderControl>
3531
<ha-eiam-self-admin [page]="currentPage" [name]="name$ | async"></ha-eiam-self-admin>
3632
</ng-template>
37-
<ng-template #obHeaderControl *ngIf="currentPage === '/generate-code'">
38-
<button
39-
obOffCanvasToggle
40-
[matTooltip]="helpTooltip$ | async | translate"
41-
id="help-toggle_button"
42-
class="control-link"
43-
>
44-
<span class="fa fa-question-circle control-icon"></span>
45-
</button>
46-
</ng-template>
4733
</ng-container>
4834
</ng-container>
4935
<ng-template #obFooterLink>

src/app/app.component.spec.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA} from '@angular/core';
44
import {ObliqueTestingModule} from '@oblique/oblique';
55
import {OidcSecurityService} from 'angular-auth-oidc-client';
66
import {of} from 'rxjs';
7-
import {first, skip} from 'rxjs/operators';
87
import {AppComponent} from './app.component';
98
import {OauthService} from './auth/oauth.service';
109

@@ -76,26 +75,6 @@ describe('AppComponent', () => {
7675
// });
7776
// });
7877

79-
describe('helpTooltip$', () => {
80-
it('should be defined', () => {
81-
expect(app.helpTooltip$).toBeDefined();
82-
});
83-
84-
it('should output a tooltip with default value', done => {
85-
app.helpTooltip$.pipe(first()).subscribe(tooltip => {
86-
expect(tooltip).toBe('help.tooltip.out');
87-
done();
88-
});
89-
});
90-
91-
it('should output a tooltip with an event', done => {
92-
app.helpTooltip$.pipe(skip(1)).subscribe(tooltip => {
93-
expect(tooltip).toBe('help.tooltip.in');
94-
done();
95-
});
96-
});
97-
});
98-
9978
describe('ngAfterViewInit', () => {
10079
let oAuth: OauthService;
10180
beforeEach(() => {

src/app/app.component.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {AfterViewInit, Component} from '@angular/core';
22
import {NavigationEnd, Router} from '@angular/router';
33
import {Observable} from 'rxjs';
4-
import {delay, filter, map, startWith, takeUntil} from 'rxjs/operators';
4+
import {delay, filter, map, takeUntil} from 'rxjs/operators';
55
import {ObHttpApiInterceptorEvents, ObOffCanvasService, ObUnsubscribable} from '@oblique/oblique';
66
import {OauthService} from './auth/oauth.service';
77

@@ -32,10 +32,6 @@ export class AppComponent extends ObUnsubscribable implements AfterViewInit {
3232
takeUntil(this.unsubscribe)
3333
)
3434
.subscribe(url => (this.currentPage = url));
35-
this.helpTooltip$ = offCanvas.opened.pipe(
36-
startWith(false),
37-
map(opened => (opened ? 'help.tooltip.in' : 'help.tooltip.out'))
38-
);
3935
interceptor.sessionExpired.subscribe(() => this.logout());
4036
}
4137

src/app/app.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {AppComponent} from './app.component';
2424
import {OpenIdConfigService} from './auth/open-id-config-service';
2525
import {HttpConfigInterceptor} from './auth/http.config.interceptor';
2626
import {EiamSelfAdminComponent} from './eiam-self-admin/eiam-self-admin.component';
27-
import {HelpComponent} from './help/help.component';
2827

2928
export function loadConfig(oidcConfigService: OidcConfigService, openIdConfigService: OpenIdConfigService) {
3029
return () => oidcConfigService.withConfig(openIdConfigService.config);
@@ -36,7 +35,7 @@ registerLocaleData(localeITCH);
3635
registerLocaleData(localeENGB);
3736

3837
@NgModule({
39-
declarations: [AppComponent, EiamSelfAdminComponent, HelpComponent],
38+
declarations: [AppComponent, EiamSelfAdminComponent],
4039
imports: [
4140
BrowserModule,
4241
BrowserAnimationsModule,
@@ -72,6 +71,7 @@ export class AppModule {
7271
interceptor.api.url = '/v1/authcode';
7372
meta.titleSuffix = 'application.title';
7473
meta.description = 'application.description';
74+
config.layout.hasOffCanvas = false;
7575
config.layout.hasMainNavigation = false;
7676
config.locale.locales = [
7777
{id: 'locale-de_button', locale: 'de'},

src/app/generate-code/generate-code.component.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<mat-card>
2+
<mat-card-header>
3+
<mat-card-title>{{ "generate-code.help.title" | translate }}</mat-card-title>
4+
</mat-card-header>
5+
<mat-card-content>
6+
<ha-help></ha-help>
7+
</mat-card-content>
8+
</mat-card>
9+
110
<form [formGroup]="test" (submit)="save(test.valid, test.value)" autocomplete="off">
211
<mat-form-field obErrorMessages>
312
<mat-label>{{ "generate-code.onset" | translate }} *</mat-label>

src/app/generate-code/generate-code.component.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33

44
:host {
55
display: flex;
6+
flex-direction: column;
7+
align-items: center;
68
justify-content: center;
9+
margin-top: $spacing-lg;
710
}
811

912
form {

src/app/generate-code/generate-code.module.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@ import {MatButtonModule} from '@angular/material/button';
77
import {MatInputModule} from '@angular/material/input';
88
import {MatDialogModule} from '@angular/material/dialog';
99
import {DateAdapter} from '@angular/material/core';
10+
import {MatCardModule} from '@angular/material/card';
1011
import {TranslateService} from '@ngx-translate/core';
1112
import {map, startWith} from 'rxjs/operators';
1213
import {ObErrorMessagesModule} from '@oblique/oblique';
1314
import {SharedModule} from 'shared/shared.module';
1415
import {GenerateCodeComponent} from './generate-code.component';
1516
import {CodeComponent} from './code/code.component';
1617
import {AuthGuardService} from '../auth/auth-guard.service';
18+
import {HelpComponent} from './help/help.component';
1719

1820
@NgModule({
19-
declarations: [GenerateCodeComponent, CodeComponent],
21+
declarations: [GenerateCodeComponent, CodeComponent, HelpComponent],
2022
imports: [
2123
SharedModule,
2224
RouterModule.forChild([{path: '', component: GenerateCodeComponent, canActivate: [AuthGuardService]}]),
@@ -26,7 +28,8 @@ import {AuthGuardService} from '../auth/auth-guard.service';
2628
MatFormFieldModule,
2729
MatInputModule,
2830
MatMomentDateModule,
29-
ObErrorMessagesModule
31+
ObErrorMessagesModule,
32+
MatCardModule
3033
]
3134
})
3235
export class GenerateCodeModule {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<ul>
2+
<li *ngFor="let bullet of bullets$ | async">{{ bullet | translate }}</li>
3+
</ul>

0 commit comments

Comments
 (0)