Skip to content

Commit 4421054

Browse files
authored
Merge pull request #30 from samply/release-1.0.1
Release 1.0.1
2 parents 7c8932c + 188dcc9 commit 4421054

11 files changed

+51
-12
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [1.0.0] - 2023-11-14
7+
## [1.0.1] - 2023-12-13
8+
### Fixed
9+
- Router link blank and router link
10+
11+
## [1.0.0] - 2023-12-13
812
### Added
913
- Init project
1014
- Prototype

package-lock.json

Lines changed: 2 additions & 2 deletions
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": "teiler-dashboard",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",

src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import {MatDatepickerModule} from "@angular/material/datepicker";
4545
import {MatNativeDateModule} from "@angular/material/core";
4646
import {MatFormFieldModule} from "@angular/material/form-field";
4747
import {MatButtonToggleModule} from "@angular/material/button-toggle";
48+
import {ExternalLinkBlankDirective} from "./external-link-blank.directive";
4849

4950
@NgModule({
5051
declarations: [
@@ -53,6 +54,7 @@ import {MatButtonToggleModule} from "@angular/material/button-toggle";
5354
SidebarComponent,
5455
TeilerAppPluginOrchestratorComponent,
5556
ExternalLinkDirective,
57+
ExternalLinkBlankDirective,
5658
TeilerBoxComponent,
5759
TeilerWelcomeComponent
5860
],

src/app/embedded/exporter/exporter.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ <h2 i18n>Exporter Anfragen</h2>
181181

182182
<ng-container matColumnDef="executions">
183183
<th mat-header-cell class="table-link-column" *matHeaderCellDef i18n>Ausführungen</th>
184-
<td mat-cell class="table-link-column" *matCellDef="let element" > <a [routerLink]="['/' + executionLink, element.id]"><i class="link-icon bi bi-box-arrow-in-right"></i></a> </td>
184+
<td mat-cell class="table-link-column" *matCellDef="let element" > <a routerLink="{{getRouterLink(element.id)}}"><i class="link-icon bi bi-box-arrow-in-right"></i></a> </td>
185185
</ng-container>
186186

187187
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>

src/app/embedded/exporter/exporter.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {QBResponse, Templates} from "../quality-report/quality-report.component"
99
import {environment} from "../../../environments/environment";
1010
import {SelectionModel} from "@angular/cdk/collections";
1111
import {TeilerAuthService} from "../../security/teiler-auth.service";
12-
import {TeilerService} from "../../teiler/teiler.service";
12+
import {createRouterLinkForBase} from "../../route/route-utils";
1313

1414
export interface ExporterQueries {
1515
id: number;
@@ -383,4 +383,7 @@ export class ExporterComponent implements OnInit, OnDestroy {
383383
cancelEdit(): void {
384384
this.editModus = false;
385385
}
386+
getRouterLink(id: string): string {
387+
return '/' + createRouterLinkForBase(this.executionLink + '/' + id);
388+
}
386389
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { ExternalLinkBlankDirective } from './external-link-blank.directive';
2+
3+
describe('ExternalLinkBlankDirective', () => {
4+
it('should create an instance', () => {
5+
//TODO
6+
//const directive = new ExternalLinkBlankDirective();
7+
//expect(directive).toBeTruthy();
8+
});
9+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import {Directive, Input} from '@angular/core';
2+
import {RouterLink} from "@angular/router";
3+
4+
@Directive({
5+
selector: '[externalLinkBlank]'
6+
})
7+
export class ExternalLinkBlankDirective {
8+
9+
@Input('externalLinkBlank') externalLink: string = '';
10+
11+
constructor(private routerLinkWithHref: RouterLink) {
12+
routerLinkWithHref.onClick = () => {
13+
if (this.externalLink != null && this.externalLink != undefined && this.externalLink.length > 0) {
14+
window.open(this.externalLink, '_blank');
15+
return false;
16+
}
17+
return true;
18+
};
19+
}
20+
21+
22+
}

src/app/external-link.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class ExternalLinkDirective {
1111
constructor(private routerLinkWithHref: RouterLink) {
1212
routerLinkWithHref.onClick = () => {
1313
if (this.externalLink != null && this.externalLink != undefined && this.externalLink.length > 0) {
14-
window.open(this.externalLink, '_blank');
14+
window.location.href=this.externalLink;
1515
return false;
1616
}
1717
return true;

src/app/sidebar/sidebar.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
</div>
5151
</ng-template>
5252
<a mat-list-item routerLink="{{'/'+teilerApp.routerLink}}"
53-
[externalLink]="teilerApp.sourceUrl??''" class="sidebar-text">{{teilerApp.title}}</a>
53+
[externalLinkBlank]="teilerApp.sourceUrl??''" class="sidebar-text">{{teilerApp.title}}</a>
5454
</div>
5555
</div>
5656
</div>
@@ -593,4 +593,3 @@
593593
</div>
594594
</div>
595595
</div>
596-

0 commit comments

Comments
 (0)