Skip to content

Commit

Permalink
Cosmetic fix
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
  • Loading branch information
torchiaf committed May 23, 2024
1 parent 72b2076 commit 5f7e60b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
class="goto"
[disabled]="deleting || element.Session?.length === 0"
mat-mini-fab color="primary"
matTooltip="{{(element.Session?.length > 0 ? 'COPY_TO_CLIP' : 'GOTO_DISABLED') | translate}}"
matTooltip="{{(element.Session?.length > 0 ? getUrl(element) : 'GOTO_DISABLED') | translate}}"
[cdkCopyToClipboard]="getUrl(element)">
<mat-icon>content_copy</mat-icon>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
class="goto"
[disabled]="data.Session.length === 0"
mat-mini-fab color="primary"
matTooltip="{{(data.Session.length > 0 ? 'VIEW_URL' : 'GOTO_DISABLED') | translate}}"
matTooltip="{{(data.Session.length > 0 ? getUrl(data) : 'GOTO_DISABLED') | translate}}"
(click)="goToView(data)">
<mat-icon>launch</mat-icon>
</button>
</div>
<div class="view-row" fxLayout="column" fxLayoutAlign="space-around center" fxLayoutGap="15px">
<mat-label class="view-label">{{'COLUMN_PATH' | translate}}</mat-label>
<mat-label>{{ data.Repo }}</mat-label>
<mat-label>{{ data.Repo || 'none'}}</mat-label>
</div>
<div class="view-row" fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="5px">
<mat-label class="view-label">{{'COLUMN_GIT_AUTH' | translate}}</mat-label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ export class UserViewsComponent implements OnInit, OnDestroy {
this.cardRefresh$.complete();
}

public getUrl(element: View) {
const url = `${environment.protocol}://${window.location.hostname}${element.Path}?${element.Query}`;

return url;
}

public goToView(element: View) {
this.cookieService.get('code-server-session');
this.cookieService.put('code-server-session', element.Session, {
Expand All @@ -54,10 +60,7 @@ export class UserViewsComponent implements OnInit, OnDestroy {
storeUnencoded: true
});


const url = `${environment.protocol}://${window.location.hostname}${element.Path}?${element.Query}`;

window.open(url, '_blank');
window.open(this.getUrl(element), '_blank');
}

public goToCreateView() {
Expand Down

0 comments on commit 5f7e60b

Please sign in to comment.