Skip to content

Commit

Permalink
Merge pull request #30 from samply/release-1.0.1
Browse files Browse the repository at this point in the history
Release 1.0.1
  • Loading branch information
djuarezgf authored Dec 13, 2023
2 parents 7c8932c + 188dcc9 commit 4421054
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 12 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2023-11-14
## [1.0.1] - 2023-12-13
### Fixed
- Router link blank and router link

## [1.0.0] - 2023-12-13
### Added
- Init project
- Prototype
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "teiler-dashboard",
"version": "1.0.0",
"version": "1.0.1",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import {MatDatepickerModule} from "@angular/material/datepicker";
import {MatNativeDateModule} from "@angular/material/core";
import {MatFormFieldModule} from "@angular/material/form-field";
import {MatButtonToggleModule} from "@angular/material/button-toggle";
import {ExternalLinkBlankDirective} from "./external-link-blank.directive";

@NgModule({
declarations: [
Expand All @@ -53,6 +54,7 @@ import {MatButtonToggleModule} from "@angular/material/button-toggle";
SidebarComponent,
TeilerAppPluginOrchestratorComponent,
ExternalLinkDirective,
ExternalLinkBlankDirective,
TeilerBoxComponent,
TeilerWelcomeComponent
],
Expand Down
2 changes: 1 addition & 1 deletion src/app/embedded/exporter/exporter.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ <h2 i18n>Exporter Anfragen</h2>

<ng-container matColumnDef="executions">
<th mat-header-cell class="table-link-column" *matHeaderCellDef i18n>Ausführungen</th>
<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>
<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>
</ng-container>

<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
Expand Down
5 changes: 4 additions & 1 deletion src/app/embedded/exporter/exporter.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {QBResponse, Templates} from "../quality-report/quality-report.component"
import {environment} from "../../../environments/environment";
import {SelectionModel} from "@angular/cdk/collections";
import {TeilerAuthService} from "../../security/teiler-auth.service";
import {TeilerService} from "../../teiler/teiler.service";
import {createRouterLinkForBase} from "../../route/route-utils";

export interface ExporterQueries {
id: number;
Expand Down Expand Up @@ -383,4 +383,7 @@ export class ExporterComponent implements OnInit, OnDestroy {
cancelEdit(): void {
this.editModus = false;
}
getRouterLink(id: string): string {
return '/' + createRouterLinkForBase(this.executionLink + '/' + id);
}
}
9 changes: 9 additions & 0 deletions src/app/external-link-blank.directive.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ExternalLinkBlankDirective } from './external-link-blank.directive';

describe('ExternalLinkBlankDirective', () => {
it('should create an instance', () => {
//TODO
//const directive = new ExternalLinkBlankDirective();
//expect(directive).toBeTruthy();
});
});
22 changes: 22 additions & 0 deletions src/app/external-link-blank.directive.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {Directive, Input} from '@angular/core';
import {RouterLink} from "@angular/router";

@Directive({
selector: '[externalLinkBlank]'
})
export class ExternalLinkBlankDirective {

@Input('externalLinkBlank') externalLink: string = '';

constructor(private routerLinkWithHref: RouterLink) {
routerLinkWithHref.onClick = () => {
if (this.externalLink != null && this.externalLink != undefined && this.externalLink.length > 0) {
window.open(this.externalLink, '_blank');
return false;
}
return true;
};
}


}
2 changes: 1 addition & 1 deletion src/app/external-link.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class ExternalLinkDirective {
constructor(private routerLinkWithHref: RouterLink) {
routerLinkWithHref.onClick = () => {
if (this.externalLink != null && this.externalLink != undefined && this.externalLink.length > 0) {
window.open(this.externalLink, '_blank');
window.location.href=this.externalLink;
return false;
}
return true;
Expand Down
3 changes: 1 addition & 2 deletions src/app/sidebar/sidebar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</div>
</ng-template>
<a mat-list-item routerLink="{{'/'+teilerApp.routerLink}}"
[externalLink]="teilerApp.sourceUrl??''" class="sidebar-text">{{teilerApp.title}}</a>
[externalLinkBlank]="teilerApp.sourceUrl??''" class="sidebar-text">{{teilerApp.title}}</a>
</div>
</div>
</div>
Expand Down Expand Up @@ -593,4 +593,3 @@
</div>
</div>
</div>

6 changes: 3 additions & 3 deletions src/app/teiler-main-menu/teiler-main-menu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</a>
</div>
<div *ngIf="teilerApp.externLink">
<a routerLink="{{'/'+teilerApp.routerLink}}" [externalLink]="teilerApp.sourceUrl??''">
<a routerLink="{{'/'+teilerApp.routerLink}}" [externalLinkBlank]="teilerApp.sourceUrl??''">
<teiler-box [teilerApp]="teilerApp"></teiler-box>
</a>
</div>
Expand All @@ -48,7 +48,7 @@
</a>
</div>
<div *ngIf="teilerApp.externLink">
<a routerLink="{{'/'+teilerApp.routerLink}}" [externalLink]="teilerApp.sourceUrl??''">
<a routerLink="{{'/'+teilerApp.routerLink}}" [externalLinkBlank]="teilerApp.sourceUrl??''">
<teiler-box [teilerApp]="teilerApp"></teiler-box>
</a>
</div>
Expand All @@ -75,7 +75,7 @@ <h3 i18n>Lokale Apps</h3>
</a>
</div>
<div *ngIf="teilerApp.externLink">
<a routerLink="{{'/'+teilerApp.routerLink}}" [externalLink]="teilerApp.sourceUrl??''">
<a routerLink="{{'/'+teilerApp.routerLink}}" [externalLinkBlank]="teilerApp.sourceUrl??''">
<teiler-box [teilerApp]="teilerApp"></teiler-box>
</a>
</div>
Expand Down

0 comments on commit 4421054

Please sign in to comment.