[Library | new-theme]: Bug fix in download from of result landing links | In menu items added "target" field to define if urls open in new tab and have external icon.
1. availableOn.component.ts: [Bug fix] Added class "uk-link-text" in links of license and providers. 2. menu.ts: In MenuItem added field target: string = "_blank"; and in constructor added parameters and initialization of target, type, isFeatured. 3. navigationBar.component.html: Updated checks for "custom-external" class and target according to target field of MenuItem. 4. app.component.ts: In "Manage" menu item set target to "_self". 5. menu.component.ts: (Admin form) In method "menuItemSaveConfirmed()" added: this.menuItemForm.value.target = this.menuItemForm.value['type'] == "internal" ? "_self" : "_blank";
This commit is contained in:
parent
9b5607fbd0
commit
bbbb711865
|
@ -330,7 +330,8 @@ export class MenuComponent implements OnInit {
|
||||||
public menuItemSaveConfirmed(data: any) {
|
public menuItemSaveConfirmed(data: any) {
|
||||||
this.destroyTypeSubscription();
|
this.destroyTypeSubscription();
|
||||||
this.showLoading = true;
|
this.showLoading = true;
|
||||||
if(!this.menuItemForm.value._id) {
|
this.menuItemForm.value.target = this.menuItemForm.value['type'] == "internal" ? "_self" : "_blank";
|
||||||
|
if(!this.menuItemForm.value._id) {
|
||||||
this.subscriptions.push(
|
this.subscriptions.push(
|
||||||
this._helpContentService.saveMenuItem(<MenuItem>this.menuItemForm.value, this.portal).subscribe(
|
this._helpContentService.saveMenuItem(<MenuItem>this.menuItemForm.value, this.portal).subscribe(
|
||||||
menuItem => {
|
menuItem => {
|
||||||
|
|
|
@ -41,7 +41,7 @@ import {properties} from "../../../../environments/environment";
|
||||||
<div *ngIf="instance.license" class="uk-text-meta uk-text-truncate" uk-tooltip [title]="instance.license">
|
<div *ngIf="instance.license" class="uk-text-meta uk-text-truncate" uk-tooltip [title]="instance.license">
|
||||||
License:
|
License:
|
||||||
<a *ngIf="isUrl(instance.license); else elseBlock"
|
<a *ngIf="isUrl(instance.license); else elseBlock"
|
||||||
[href]="instance.license" target="_blank" class="custom-external">
|
[href]="instance.license" target="_blank" class="custom-external uk-link-text">
|
||||||
{{instance.license}}
|
{{instance.license}}
|
||||||
</a>
|
</a>
|
||||||
<ng-template #elseBlock> {{instance.license}}</ng-template>
|
<ng-template #elseBlock> {{instance.license}}</ng-template>
|
||||||
|
@ -49,7 +49,7 @@ import {properties} from "../../../../environments/environment";
|
||||||
<div *ngIf="instance.collectedNamesAndIds?.size > 0" class="uk-text-meta">
|
<div *ngIf="instance.collectedNamesAndIds?.size > 0" class="uk-text-meta">
|
||||||
<span>Providers: </span>
|
<span>Providers: </span>
|
||||||
<a *ngFor="let collectedName of getKeys(instance.collectedNamesAndIds); let i=index" [routerLink]="dataProviderUrl"
|
<a *ngFor="let collectedName of getKeys(instance.collectedNamesAndIds); let i=index" [routerLink]="dataProviderUrl"
|
||||||
[queryParams]="{datasourceId: instance.collectedNamesAndIds.get(collectedName)}">
|
[queryParams]="{datasourceId: instance.collectedNamesAndIds.get(collectedName)}" class="uk-link-text">
|
||||||
{{collectedName}}<ng-container *ngIf="(i !== (instance.collectedNamesAndIds.size - 1))">; </ng-container>
|
{{collectedName}}<ng-container *ngIf="(i !== (instance.collectedNamesAndIds.size - 1))">; </ng-container>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -21,8 +21,11 @@ export class MenuItem {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
customClass: string = null;
|
customClass: string = null;
|
||||||
isFeatured: boolean;
|
isFeatured: boolean;
|
||||||
|
target: string = "_blank";
|
||||||
|
|
||||||
constructor(id: string, title: string, url: string, route: string, needsAuthorization: boolean, entitiesRequired: string[], routeRequired: string[], params, icon: Icon = null, fragment = null, customClass = null, routeActive = null) {
|
constructor(id: string, title: string, url: string, route: string, needsAuthorization: boolean, entitiesRequired: string[],
|
||||||
|
routeRequired: string[], params, icon: Icon = null, fragment = null, customClass = null, routeActive = null,
|
||||||
|
target: string = "_blank", type: string = "internal", isFeatured: boolean = false) {
|
||||||
this._id = id;
|
this._id = id;
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.url = url;
|
this.url = url;
|
||||||
|
@ -36,6 +39,9 @@ export class MenuItem {
|
||||||
this.icon = icon;
|
this.icon = icon;
|
||||||
this.fragment = fragment;
|
this.fragment = fragment;
|
||||||
this.customClass = customClass;
|
this.customClass = customClass;
|
||||||
|
this.target = target;
|
||||||
|
this.type = type;
|
||||||
|
this.isFeatured = isFeatured;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static isTheActiveMenu(menu: MenuItem, currentRoute: any, activeMenuItem: string=""): boolean {
|
public static isTheActiveMenu(menu: MenuItem, currentRoute: any, activeMenuItem: string=""): boolean {
|
||||||
|
|
|
@ -45,8 +45,8 @@
|
||||||
[queryParams]="menu.rootItem.params"
|
[queryParams]="menu.rootItem.params"
|
||||||
[fragment]="menu.rootItem.fragment">{{menu.rootItem.title}}</a>
|
[fragment]="menu.rootItem.fragment">{{menu.rootItem.title}}</a>
|
||||||
<a *ngIf="menu.rootItem.route.length == 0 && menu.rootItem.url.length > 0"
|
<a *ngIf="menu.rootItem.route.length == 0 && menu.rootItem.url.length > 0"
|
||||||
href="{{menu.rootItem.url}}" (click)="closeCanvas(canvas)" [class.custom-external]="menu.rootItem.url.includes('http')"
|
href="{{menu.rootItem.url}}" (click)="closeCanvas(canvas)" [class.custom-external]="menu.rootItem.target != '_self'"
|
||||||
target="{{menu.rootItem.url.includes('http') ? '_blank' : '_self'}}">{{menu.rootItem.title}}</a>
|
target="{{menu.rootItem.target}}">{{menu.rootItem.title}}</a>
|
||||||
<a *ngIf="(menu.rootItem.route.length == 0 && menu.rootItem.url.length == 0) ||
|
<a *ngIf="(menu.rootItem.route.length == 0 && menu.rootItem.url.length == 0) ||
|
||||||
(menu.rootItem.route.length >0 && menu.rootItem.routeRequired && !isEnabled([menu.rootItem.route], showPage)
|
(menu.rootItem.route.length >0 && menu.rootItem.routeRequired && !isEnabled([menu.rootItem.route], showPage)
|
||||||
&& isAtleastOneEnabled(menu.rootItem.routeRequired, showPage))"
|
&& isAtleastOneEnabled(menu.rootItem.routeRequired, showPage))"
|
||||||
|
@ -60,8 +60,8 @@
|
||||||
routerLink="{{submenu.route}}" [queryParams]=submenu.params
|
routerLink="{{submenu.route}}" [queryParams]=submenu.params
|
||||||
[fragment]="submenu.fragment">{{submenu.title}}</a>
|
[fragment]="submenu.fragment">{{submenu.title}}</a>
|
||||||
<a *ngIf="submenu.route.length == 0 && submenu.url.length > 0"
|
<a *ngIf="submenu.route.length == 0 && submenu.url.length > 0"
|
||||||
href="{{submenu.url}}" (click)="closeCanvas(canvas)" [class.custom-external]="submenu.url.includes('http')"
|
href="{{submenu.url}}" (click)="closeCanvas(canvas)" [class.custom-external]="submenu.target != '_self'"
|
||||||
target="{{submenu.url.includes('http') ? '_blank' : '_self'}}">{{submenu.title}}</a>
|
target="{{submenu.target}}">{{submenu.title}}</a>
|
||||||
<ul *ngIf="submenu.items && submenu.items.length > 0" class="uk-nav-sub">
|
<ul *ngIf="submenu.items && submenu.items.length > 0" class="uk-nav-sub">
|
||||||
<ng-container *ngFor="let subsubmenu of submenu.items">
|
<ng-container *ngFor="let subsubmenu of submenu.items">
|
||||||
<li>
|
<li>
|
||||||
|
@ -140,8 +140,8 @@
|
||||||
[queryParams]="menu.rootItem.params"
|
[queryParams]="menu.rootItem.params"
|
||||||
[fragment]="menu.rootItem.fragment"> {{menu.rootItem.title}}</a>
|
[fragment]="menu.rootItem.fragment"> {{menu.rootItem.title}}</a>
|
||||||
<a *ngIf="menu.rootItem.route.length == 0 && menu.rootItem.url.length > 0"
|
<a *ngIf="menu.rootItem.route.length == 0 && menu.rootItem.url.length > 0"
|
||||||
href="{{menu.rootItem.url}}" target="{{menu.rootItem.url.includes('http') ? '_blank' : '_self'}}"
|
href="{{menu.rootItem.url}}" target="{{menu.rootItem.target}}"
|
||||||
[class.custom-external]="menu.rootItem.url.includes('http')">{{menu.rootItem.title}}</a>
|
[class.custom-external]="menu.rootItem.target != '_self'">{{menu.rootItem.title}}</a>
|
||||||
<a *ngIf="(menu.rootItem.route.length == 0 && menu.rootItem.url.length == 0) || ( menu.rootItem.route.length >0 && menu.rootItem.routeRequired && !isEnabled([menu.rootItem.route], showPage) && isAtleastOneEnabled(menu.rootItem.routeRequired, showPage))">{{menu.rootItem.title}}</a>
|
<a *ngIf="(menu.rootItem.route.length == 0 && menu.rootItem.url.length == 0) || ( menu.rootItem.route.length >0 && menu.rootItem.routeRequired && !isEnabled([menu.rootItem.route], showPage) && isAtleastOneEnabled(menu.rootItem.routeRequired, showPage))">{{menu.rootItem.title}}</a>
|
||||||
<div *ngIf="menu.items.length > 0" class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left">
|
<div *ngIf="menu.items.length > 0" class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left">
|
||||||
<div class="uk-height-max-medium uk-overflow-auto">
|
<div class="uk-height-max-medium uk-overflow-auto">
|
||||||
|
@ -155,8 +155,8 @@
|
||||||
routerLink="{{submenu.route}}" [queryParams]="submenu.params"
|
routerLink="{{submenu.route}}" [queryParams]="submenu.params"
|
||||||
[fragment]="submenu.fragment">{{submenu.title}}</a>
|
[fragment]="submenu.fragment">{{submenu.title}}</a>
|
||||||
<a *ngIf="submenu.route.length == 0 && submenu.url.length > 0"
|
<a *ngIf="submenu.route.length == 0 && submenu.url.length > 0"
|
||||||
href="{{submenu.url}}" [class.custom-external]="submenu.url.includes('http')"
|
href="{{submenu.url}}" [class.custom-external]="submenu.target != '_self'"
|
||||||
target="{{submenu.url.includes('http') ? '_blank' : '_self'}}">{{submenu.title}}</a>
|
target="{{submenu.target}}">{{submenu.title}}</a>
|
||||||
<ul *ngIf="submenu.items && submenu.items.length > 0" class="uk-nav-sub">
|
<ul *ngIf="submenu.items && submenu.items.length > 0" class="uk-nav-sub">
|
||||||
<ng-container *ngFor="let subsubmenu of submenu.items">
|
<ng-container *ngFor="let subsubmenu of submenu.items">
|
||||||
<li>
|
<li>
|
||||||
|
|
Loading…
Reference in New Issue