[Library|Trunk]

Admin tool pages:
        updates after migration
        css updates after theme change
	portal: add piwik id

Navbar: optionto enable/disable sticky animation


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59726 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2020-10-30 14:01:44 +00:00
parent ed15ef8169
commit 5ccca64ee0
29 changed files with 444 additions and 346 deletions

View File

@ -35,7 +35,7 @@
<div class="show-options uk-float-right">
<button class="uk-button" type="button">Bulk Actions</button>
<div uk-dropdown="mode: click">
<ul class="uk-nav uk-navbar-dropdown-nav"
<ul class="uk-nav uk-margin-left"
[attr.uk-tooltip]="getSelectedDivIds().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one class">
<li><a [class]="getSelectedDivIds().length == 0 ? 'uk-disabled' : ''"
@ -80,9 +80,9 @@
<td>
<div class="actions" href="#">
<i class="md-icon material-icons" (click)="editDivId(i)"></i>
<i class="material-icons md-icon"
(click)="confirmDeleteDivId(check.divId._id)">delete</i>
<i class="clickable" uk-icon= "pencil" (click)="editDivId(i)"></i>
<i class="clickable uk-text-danger" uk-icon= "trash"
(click)="confirmDeleteDivId(check.divId._id)"></i>
</div>
</td>
</tr>
@ -93,8 +93,8 @@
<div class="uk-alert-warning uk-alert" >No classes found</div>
</div>
<div class="uk-width-1-1 uk-flex uk-flex-center ">
<div class="uk-width-small uk-flex uk-flex-center uk-button" (click)="newDivId()">
<i class="material-icons md-48">add</i>
<div class="uk-width-small uk-button uk-button-default" (click)="newDivId()">
<i class="" uk-icon= "plus"></i>
</div>
</div>
</div>

View File

@ -101,7 +101,7 @@ export class DivIdsComponent implements OnInit {
this.updateErrorMessage = "";
this.errorMessage = "";
this._helpContentService.getDivIdsFull(null, this.properties.adminToolsAPIURL).subscribe(
this._helpContentService.getAllDivIdsFull( this.properties.adminToolsAPIURL).subscribe(
divIds => {
this.divIds = divIds;
this.checkboxes = [];
@ -326,7 +326,7 @@ export class DivIdsComponent implements OnInit {
getPages() {
this.showLoading = true;
this.errorMessage = "";
this._helpContentService.getPages(this.properties.adminToolsAPIURL, this.selectedCommunityPid).subscribe(
this._helpContentService.getAllPages(this.properties.adminToolsAPIURL).subscribe(
pages => {
this.allPages = pages;
this.showLoading = false;

View File

@ -116,7 +116,7 @@ export class DivContentFormComponent implements OnInit{
//this.showLoading = true;
this.errorMessage = '';
this._helpContentService.getDivIdsFull(pageId, this.properties.adminToolsAPIURL, this.communityPid).subscribe(
this._helpContentService.getDivIdsFullByPortal(pageId, this.properties.adminToolsAPIURL, this.communityPid).subscribe(
divs => {
this.availableDivs = divs;
this.pageId = pageId;

View File

@ -16,17 +16,12 @@
<div id="page_content_inner">
<div class="menubar ">
<div *ngIf="!errorMessage && !showLoading" class="page-controls">
<div class=" filters ">
<div class="show-options uk-float-right">
<button class="uk-button uk-button-primary" type="button">Bulk Actions</button>
<div uk-dropdown="mode: click">
<ul class="uk-nav uk-navbar-dropdown-nav uk-margin-left"
<ul class="uk-nav uk-margin-left"
[attr.uk-tooltip]="getSelectedDivHelpContents().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one help text">
<li><a [class]="getSelectedDivHelpContents().length == 0 ? 'uk-disabled' : ''"
@ -125,18 +120,18 @@
<td>
<div class="actions" href="#">
<i class="md-icon material-icons"
(click)="editDivHelpContent(check.divHelpContent._id)"></i>
<i class="material-icons md-icon"
(click)="confirmDeleteDivHelpContent(check.divHelpContent._id)">delete</i>
<i class="clickable" uk-icon="pencil"
(click)="editDivHelpContent(check.divHelpContent._id)"></i>
<i class="clickable uk-text-danger" uk-icon="trash"
(click)="confirmDeleteDivHelpContent(check.divHelpContent._id)"></i>
</div>
</td>
</tr>
</tbody>
</table>
<div class="uk-width-1-1 uk-flex uk-flex-center ">
<div class="uk-width-small uk-flex uk-flex-center uk-button" (click)="newClassContent()">
<i class="material-icons md-48">add</i>
<div class="uk-width-small uk-flex uk-flex-center uk-button uk-button-default" (click)="newClassContent()">
<i class="" uk-icon="plus"></i>
</div>
</div>
<div *ngIf="checkboxes.length==0" class="col-md-12">

View File

@ -120,7 +120,7 @@ export class DivHelpContentsComponent implements OnInit {
this.updateErrorMessage = "";
this.errorMessage = "";
this._helpService.getPage(pageId, this.properties.adminToolsAPIURL).subscribe(
this._helpService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.selectedCommunityPid).subscribe(
page => {
if (this.properties.adminToolsPortalType != page.portalType) {
this.router.navigate(['/classContents'], {queryParams: {"communityId": this.selectedCommunityPid}});
@ -269,7 +269,7 @@ export class DivHelpContentsComponent implements OnInit {
this.showLoading = true;
this.updateErrorMessage = "";
this._helpService.deleteDivHelpContents(this.selectedDivContents, this.properties.adminToolsAPIURL).subscribe(
this._helpService.deleteDivHelpContents(this.selectedDivContents, this.properties.adminToolsAPIURL, this.selectedCommunityPid).subscribe(
_ => {
this.deleteDivHelpContentsFromArray(this.selectedDivContents);
this.showLoading = false;
@ -320,7 +320,7 @@ export class DivHelpContentsComponent implements OnInit {
} else {
this.updateErrorMessage = "";
this._helpService.toggleDivHelpContents(ids, status, this.properties.adminToolsAPIURL).subscribe(
this._helpService.toggleDivHelpContents(ids, status, this.properties.adminToolsAPIURL,this.selectedCommunityPid).subscribe(
() => {
for (let id of ids) {
let i = this.checkboxes.findIndex(_ => _.divHelpContent._id == id);

View File

@ -78,7 +78,7 @@ export class EditDivHelpContentComponent implements OnInit, OnDestroy{
}
private getPage(pageId: string) {
this._helpContentService.getPage(pageId,this.properties.adminToolsAPIURL).subscribe(
this._helpContentService.getPageByPortal(pageId,this.properties.adminToolsAPIURL, this.communityPid).subscribe(
page => {
if(this.properties.adminToolsPortalType != page.portalType) {
this.router.navigate(['/classContents'], { queryParams: { "communityId": this.communityPid} });
@ -99,7 +99,7 @@ export class EditDivHelpContentComponent implements OnInit, OnDestroy{
this.errorMessage = "";
this.updateErrorMessage = "";
this._helpContentService.getDivHelpContent(divContentId, this.properties.adminToolsAPIURL).subscribe(
this._helpContentService.getDivHelpContent(divContentId, this.properties.adminToolsAPIURL, this.communityPid).subscribe(
divHelpContent => {
if(this.pageId) {
this.getPage(this.pageId);
@ -117,7 +117,7 @@ export class EditDivHelpContentComponent implements OnInit, OnDestroy{
} else {
this.showLoading = true;
this._helpContentService.getDivIdFull(divId, this.properties.adminToolsAPIURL).subscribe(
this._helpContentService.getDivIdFull(divId, this.properties.adminToolsAPIURL, this.communityPid).subscribe(
div => {
this.formComponent.selectedDiv = div;
@ -150,7 +150,7 @@ export class EditDivHelpContentComponent implements OnInit, OnDestroy{
let divHelpContent : DivHelpContent = this.formComponent.myForm.value;
this._helpContentService.insertOrUpdateDivHelpContent(divHelpContent, this.properties.adminToolsAPIURL).subscribe(
this._helpContentService.insertOrUpdateDivHelpContent(divHelpContent, this.properties.adminToolsAPIURL, this.communityPid).subscribe(
_ => {
if(this.pageId) {
this.router.navigate( ['/classContents/'], { queryParams: { "communityId": this.communityPid, "pageId": this.pageId } } );

View File

@ -60,7 +60,7 @@ export class NewDivHelpContentComponent {
}
private getPage(pageId: string) {
this._helpContentService.getPage(pageId,this.properties.adminToolsAPIURL).subscribe(
this._helpContentService.getPageByPortal(pageId,this.properties.adminToolsAPIURL, this.communityPid).subscribe(
page => {
if(this.properties.adminToolsPortalType != page.portalType) {
this.router.navigate(['/classContents'], { queryParams: { "communityId": this.communityPid} });
@ -84,7 +84,7 @@ export class NewDivHelpContentComponent {
let divHelpContent : DivHelpContent = this.formComponent.myForm.value;
this._helpContentService.insertOrUpdateDivHelpContent(divHelpContent, this.properties.adminToolsAPIURL).subscribe(
this._helpContentService.insertOrUpdateDivHelpContent(divHelpContent, this.properties.adminToolsAPIURL, this.communityPid).subscribe(
_ => {
if(this.pageId) {
this.router.navigate( ['/classContents/'], { queryParams: { "communityId": this.communityPid, "pageId": this.pageId } } );

View File

@ -18,7 +18,7 @@
<div class="show-options uk-float-right">
<button class="uk-button uk-button-primary" type="button">Bulk Actions</button>
<div uk-dropdown="mode: click">
<ul class="uk-nav uk-navbar-dropdown-nav uk-margin-left"
<ul class="uk-nav uk-margin-left"
[attr.uk-tooltip]="getSelectedEntities().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one entity">
<li *ngIf="!isPortalAdministrator"><a [class]="getSelectedEntities().length == 0 ? 'uk-disabled' : ''"
@ -89,17 +89,17 @@
<td *ngIf="isPortalAdministrator">
<div class="actions" href="#">
<i class="md-icon material-icons" (click)="editEntity(i)"></i>
<i class="material-icons md-icon"
(click)="confirmDeleteEntity(check.entity._id)">delete</i>
<i class="clickable " uk-icon="pencil" (click)="editEntity(i)"></i>
<i class="clickable uk-text-danger" uk-icon="trash"
(click)="confirmDeleteEntity(check.entity._id)"></i>
</div>
</td>
</tr>
</tbody>
</table>
<div class="uk-width-1-1 uk-flex uk-flex-center " *ngIf="isPortalAdministrator">
<div class="uk-width-small uk-flex uk-flex-center uk-button" (click)="newEntity()">
<i class="material-icons md-48">add</i>
<div class="uk-width-small uk-button uk-button-default" (click)="newEntity()">
<i class="" uk-icon="plus"></i>
</div>
</div>
<div *ngIf="checkboxes.length==0" class="col-md-12">

View File

@ -80,7 +80,7 @@ export class EditPageHelpContentComponent implements OnInit, OnDestroy{
}
private getPage(pageId: string) {
this._helpContentService.getPage(pageId,this.properties.adminToolsAPIURL).subscribe(
this._helpContentService.getPageByPortal(pageId,this.properties.adminToolsAPIURL, this.communityPid).subscribe(
page => {
if(this.properties.adminToolsPortalType != page.portalType) {
this.router.navigate(['/pageContents'], { queryParams: { "communityId": this.communityPid} });
@ -102,7 +102,7 @@ export class EditPageHelpContentComponent implements OnInit, OnDestroy{
this.errorMessage = "";
this.updateErrorMessage = "";
this._helpContentService.getPageHelpContent(pageContentId as string, this.properties.adminToolsAPIURL).subscribe(
this._helpContentService.getPageHelpContent(pageContentId as string, this.properties.adminToolsAPIURL, this.communityPid).subscribe(
pageHelpContent => {
if(this.pageId && this.pageId != pageHelpContent.page) {
this.router.navigate(['/pageContents'], { queryParams: { "communityId": this.communityPid} });
@ -133,7 +133,7 @@ export class EditPageHelpContentComponent implements OnInit, OnDestroy{
this.updateErrorMessage = "";
let pageHelpContent : PageHelpContent = this.formComponent.myForm.value;
this._helpContentService.updatePageHelpContent(pageHelpContent, this.properties.adminToolsAPIURL).subscribe(
this._helpContentService.updatePageHelpContent(pageHelpContent, this.properties.adminToolsAPIURL, this.communityPid).subscribe(
_ => {
if(this.pageId) {
this.router.navigate( ['/pageContents/'], { queryParams: { "communityId": this.communityPid, "pageId": this.pageId } } );

View File

@ -60,7 +60,7 @@ export class NewPageHelpContentComponent {
}
private getPage(pageId: string) {
this._helpContentService.getPage(pageId,this.properties.adminToolsAPIURL).subscribe(
this._helpContentService.getPageByPortal(pageId,this.properties.adminToolsAPIURL, this.communityPid).subscribe(
page => {
if(this.properties.adminToolsPortalType != page.portalType) {
this.router.navigate(['/pageContents'], { queryParams: { "communityId": this.communityPid} });
@ -87,7 +87,7 @@ export class NewPageHelpContentComponent {
let pageHelpContent : PageHelpContent = this.formComponent.myForm.value;
this._helpContentService.savePageHelpContent(pageHelpContent, this.properties.adminToolsAPIURL).subscribe(
this._helpContentService.savePageHelpContent(pageHelpContent, this.properties.adminToolsAPIURL, this.communityPid).subscribe(
_ => {
if(this.pageId) {
this.router.navigate( ['/helptexts/'], { queryParams: { "communityId": this.communityPid, "pageId": this.pageId } } );

View File

@ -49,12 +49,12 @@ export class PageContentFormComponent implements OnInit{
if(!this.pageId) {
this.myForm.valueChanges.subscribe(value => {
let pageId = value.page;
this._helpContentService.getPage(pageId, this.properties.adminToolsAPIURL).subscribe(page => {
this._helpContentService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.communityPid).subscribe(page => {
this.setPlacements(page);
});
});
}
this._helpContentService.getPages(this.properties.adminToolsAPIURL, this.communityPid, true).subscribe(
this._helpContentService.getCommunityPagesWithPositions(this.communityPid, this.properties.adminToolsAPIURL).subscribe(
pages => {
this.availablePages = pages;
this.showLoading = false;

View File

@ -21,7 +21,7 @@
<button class="uk-button uk-button-primary uk-float-right" type="button">Bulk Actions</button>
<div uk-dropdown="mode: click">
<ul class="uk-nav uk-navbar-dropdown-nav uk-margin-left"
<ul class="uk-nav uk-margin-left"
[attr.uk-tooltip]="getSelectedPageHelpContents().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one help text">
<li><a [class]="getSelectedPageHelpContents().length == 0 ? 'uk-disabled' : ''"
@ -128,10 +128,10 @@
<!-- </div>-->
<div class="actions" href="#">
<i class="md-icon material-icons"
(click)="editPageHelpContent(check.pageHelpContent._id)"></i>
<i class="material-icons md-icon"
(click)="confirmDeletePageHelpContent(check.pageHelpContent._id)">delete</i>
<i class="clickable" ui-kit="pencil"
(click)="editPageHelpContent(check.pageHelpContent._id)"></i>
<i class="clickable uk-text-danger" uk-icon="trash"
(click)="confirmDeletePageHelpContent(check.pageHelpContent._id)"></i>
</div>
</td>
</tr>
@ -142,8 +142,8 @@
<div class="uk-alert-warning" uk-alert>No page contents found</div>
</div>
<div class="uk-width-1-1 uk-flex uk-flex-center ">
<div class="uk-width-small uk-flex uk-flex-center uk-button" (click)="newPageContent()">
<i class="material-icons md-48">add</i>
<div class="uk-width-small uk-button-default uk-button" (click)="newPageContent()">
<i class="" uk-icon="plus"></i>
</div>
</div>
</div>
@ -159,6 +159,7 @@
</div>
<!-- <fab (clicked)="newPageContent()"></fab>-->
</div>
</div>
<!-- <delete-confirmation-dialog #deleteConfirmationModal [isModalShown]="isModalShown" (emmitObject)="confirmedDeletePageHelpContents($event)">
Are you sure you want to delete the selected page content(s)?

View File

@ -113,7 +113,7 @@ export class PageHelpContentsComponent implements OnInit {
this.updateErrorMessage = "";
this.errorMessage = "";
this._helpService.getPage(pageId, this.properties.adminToolsAPIURL).subscribe(
this._helpService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.selectedCommunityPid).subscribe(
page => {
if (this.properties.adminToolsPortalType != page.portalType) {
this.router.navigate(['/pageContents'], {queryParams: {"communityId": this.selectedCommunityPid}});
@ -140,7 +140,7 @@ export class PageHelpContentsComponent implements OnInit {
this.errorMessage = "";
//this._helpService.getCommunityPages(community_pid, "", this.properties.adminToolsAPIURL).subscribe(
this._helpService.getPages(this.properties.adminToolsAPIURL, community_pid, true).subscribe(
this._helpService.getCommunityPagesWithPositions(community_pid,this.properties.adminToolsAPIURL).subscribe(
pages => {
this.pages = pages;
this.getPageHelpContents(this.selectedCommunityPid);
@ -266,7 +266,7 @@ export class PageHelpContentsComponent implements OnInit {
this.showLoading = true;
this.updateErrorMessage = "";
this._helpService.deletePageHelpContents(this.selectedPageContents, this.properties.adminToolsAPIURL).subscribe(
this._helpService.deletePageHelpContents(this.selectedPageContents, this.properties.adminToolsAPIURL, this.selectedCommunityPid).subscribe(
_ => {
this.deletePageHelpContentsFromArray(this.selectedPageContents);
this.showLoading = false;
@ -317,7 +317,7 @@ export class PageHelpContentsComponent implements OnInit {
} else {
this.updateErrorMessage = "";
this._helpService.togglePageHelpContents(ids, status, this.properties.adminToolsAPIURL).subscribe(
this._helpService.togglePageHelpContents(ids, status, this.properties.adminToolsAPIURL, this.selectedCommunityPid).subscribe(
() => {
for (let id of ids) {
let i = this.checkboxes.findIndex(_ => _.pageHelpContent._id == id);

View File

@ -16,16 +16,16 @@
<div class="show-options uk-float-right">
<button class="uk-button uk-button-primary" type="button">Bulk Actions</button>
<div uk-dropdown="mode: click">
<ul class="uk-nav uk-navbar-dropdown-nav uk-margin-left"
<ul class="uk-nav uk-margin-left"
[attr.uk-tooltip]="getSelectedPages().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one page">
<li *ngIf="!isPortalAdministrator"><a [class]="getSelectedPages().length == 0 ? 'uk-disabled' : ''"
(click)="togglePages(true, getSelectedPages())"><i></i> Activate
(click)="togglePages(true, getSelectedPages())"> Activate
</a></li>
<li *ngIf="!isPortalAdministrator"><a [class]="getSelectedPages().length == 0 ? 'uk-disabled' : ''"
(click)="togglePages(false, getSelectedPages())"><i></i> Deactivate
(click)="togglePages(false, getSelectedPages())"> Deactivate
</a></li>
<li *ngIf="isPortalAdministrator"><a (click)="confirmDeleteSelectedPages()"><i></i> Delete </a></li>
<li *ngIf="isPortalAdministrator"><a (click)="confirmDeleteSelectedPages()"> Delete </a></li>
</ul>
</div>
</div>
@ -107,9 +107,9 @@
<td *ngIf="isPortalAdministrator">
<div class="actions" href="#">
<i class="md-icon material-icons" (click)="editPage(i)"></i>
<i class="material-icons md-icon"
(click)="confirmDeletePage(check.page._id)">delete</i>
<i class="clickable " (click)="editPage(i)" uk-icon="pencil"></i>
<i class="clickable uk-text-danger"
(click)="confirmDeletePage(check.page._id)" uk-icon="trash"></i>
</div>
</td>
<td *ngIf="!isPortalAdministrator" class="uk-text-center">
@ -137,8 +137,8 @@
<div class="uk-alert-warning" uk-alert>No pages found</div>
</div>
<div class="uk-width-1-1 uk-flex uk-flex-center ">
<div class="uk-width-small uk-flex uk-flex-center uk-button" (click)="newPage()">
<i class="material-icons md-48">add</i>
<div class="uk-width-small uk-button uk-button-default" (click)="newPage()">
<i class="" uk-icon="plus"></i>
</div>
</div>
</div>
@ -278,25 +278,14 @@
<!-- </span>-->
<!-- </div>-->
<div [ngClass]="{'has-error':!myForm.controls.portalType.valid && myForm.controls.portalType.dirty}" class="form-group" uk-grid>
<label class="uk-width-1-1 uk-margin-small-bottom">
<div [ngClass]="{'has-error':!myForm.controls.portalType.valid && myForm.controls.portalType.dirty}" class="form-group" >
<div class="uk-width-1-1 uk-margin-small-bottom">
Page exists in:
</label>
<label class="uk-width-1-1 radio uk-margin-large-left">
<span class="uk-margin-small-right" style="font-weight: normal;">OpenAIRE portal</span>
<!-- <input tabindex="0" type="checkbox" formControlName="openaire">-->
<input type="radio" value="explore" formControlName="portalType">
</label>
<label class="uk-width-1-1 radio uk-margin-large-left">
<span class="uk-margin-small-right" style="font-weight: normal;">OpenAIRE Connect portal</span>
<!-- <input tabindex="0" type="checkbox" formControlName="connect">-->
<input type="radio" value="connect" formControlName="portalType">
</label>
<label class="uk-width-1-1 radio uk-margin-large-left">
<span class="uk-margin-small-right" style="font-weight: normal;">Communities' Gateway</span>
<!-- <input tabindex="0" type="checkbox" formControlName="communities">-->
<input type="radio" value="community" formControlName="portalType">
</label>
</div>
<span *ngFor="let option of portalUtils.portalTypes" class="radio">
<span class="uk-margin-small-right" style="font-weight: normal;">{{option.label}}</span>
<input type="radio" [value]="option.value" formControlName="portalType">
</span>
</div>
<input type="hidden" formControlName="_id">

View File

@ -13,6 +13,7 @@ import {UserManagementService} from '../../services/user-management.service';
import {Observable, Subscriber} from "rxjs";
import {map, startWith} from "rxjs/operators";
import {MatAutocompleteSelectedEvent} from "@angular/material";
import {PortalUtils} from "../portal/portalHelper";
@Component({
selector: 'pages',
@ -65,7 +66,7 @@ export class PagesComponent implements OnInit {
allEntities: Entity[] = [];
private subscriptions: any[] = [];
public portalUtils:PortalUtils = new PortalUtils();
constructor(private element: ElementRef, private route: ActivatedRoute,
private _router: Router, private _helpContentService: HelpContentService,
private userManagementService: UserManagementService, private _fb: FormBuilder) {
@ -152,7 +153,7 @@ export class PagesComponent implements OnInit {
parameters = '?page_type=' + this.pagesType;
}
if (community_pid) {
this._helpContentService.getCommunityPages(community_pid, parameters, this.properties.adminToolsAPIURL).subscribe(
this._helpContentService.getCommunityPagesByType(community_pid, parameters, this.properties.adminToolsAPIURL).subscribe(
pages => {
this.pagesReturned(pages);
//if(!this.pagesType || this.pagesType == "link") {
@ -164,7 +165,7 @@ export class PagesComponent implements OnInit {
error => this.handleError('System error retrieving pages', error)
);
} else {
this._helpContentService.getPagesFull(this.properties.adminToolsAPIURL, null).subscribe(
this._helpContentService.getAllPagesFull(this.properties.adminToolsAPIURL).subscribe(
pages => {
this.pagesReturned(pages);
this.showLoading = false;
@ -184,7 +185,7 @@ export class PagesComponent implements OnInit {
}
});
} else {
this._helpContentService.getPagesWithDivIds(community_pid, this.properties.adminToolsAPIURL).subscribe(
this._helpContentService.getPageIdsFromDivIds(community_pid, this.properties.adminToolsAPIURL).subscribe(
pages => {
this.pageWithDivIds = pages;
this.showLoading = false;

View File

@ -0,0 +1,16 @@
import {Option} from "../sharedComponents/input/input.component";
export class PortalUtils{
portalTypes: Option[] = [
{value: 'explore', label: 'Explore Portal'},
{value: 'connect', label: 'Connect portal'},
{value: 'monitor', label: 'Monitor portal'},
{value: 'community', label: 'Community Gateway'},
{value: 'funder', label: 'Funder Dashboard'},
{value: 'ri', label: 'Research Initiative Dashboard'},
{value: 'organization', label: 'Institution Dashboard'},
{value: 'project', label: 'Project Dashboard'}
];
}

View File

@ -35,7 +35,7 @@
<div class="show-options uk-float-right">
<button class="uk-button" type="button">Bulk Actions</button>
<div uk-dropdown="mode: click">
<ul class="uk-nav uk-navbar-dropdown-nav"
<ul class="uk-nav uk-margin-left"
[attr.uk-tooltip]="getSelectedCommunities().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one portal">
<li><a [class]="getSelectedCommunities().length == 0 ? 'uk-disabled' : ''"
@ -72,9 +72,9 @@
</td>
<td>
<div class="actions" href="#">
<i class="md-icon material-icons" (click)="editCommunity(i)"></i>
<i class="material-icons md-icon"
(click)="confirmDeleteCommunity(check.community._id)">delete</i>
<i class="clickable" uk-icon="pencil" (click)="editCommunity(i)"></i>
<i class="clickable uk-text-danger" uk-icon="trash"
(click)="confirmDeleteCommunity(check.community._id)"></i>
</div>
</td>
@ -83,8 +83,8 @@
</tbody>
</table>
<div class="uk-width-1-1 uk-flex uk-flex-center ">
<div class="uk-width-small uk-flex uk-flex-center uk-button" (click)="newCommunity()">
<i class="material-icons md-48">add</i>
<div class="uk-width-small uk-button-default uk-button" (click)="newCommunity()">
<i class="" uk-icon="plus"></i>
</div>
</div>
@ -114,16 +114,17 @@
<div [ngClass]="{'has-error':!portalFG.controls.type.valid && portalFG.controls.type.dirty}">
<label for="portalTypeTag">*Portal Type</label>
<select formControlName="type" id="portalTypeTag" class="form-control uk-select">
<option [value]="'explore'">OpenAIRE Explore Portal</option>
<option [value]="'connect'">OpenAIRE Connect Portal</option>
<option [value]="'monitor'">OpenAIRE Monitor Portal</option>
<option [value]="'community'">OpenAIRE Community Gateway</option>
<option *ngFor="let option of portalUtils.portalTypes" [value]="option.value">{{option.label}}</option>
</select>
</div>
<div dashboard-input class="uk-margin-small-left " [formInput]="portalFG.controls.pid"
type="text"
label="Portal persistent id for portal">
</div>
<div dashboard-input class="uk-margin-small-left" [formInput]="portalFG.controls.piwik"
type="text"
label="Piwik id">
</div>
<input type="hidden" formControlName="_id">
</form>

View File

@ -2,20 +2,21 @@ import {Component, ViewChild, OnInit, ElementRef} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {HelpContentService} from '../../services/help-content.service';
import {FormBuilder, FormControl, FormGroup} from '@angular/forms';
import {CheckPortal, Portal} from '../../utils/entities/adminTool/portal';
import {EnvProperties} from '../../utils/properties/env-properties';
import {Session} from '../../login/utils/helper.class';
import {LoginErrorCodes} from '../../login/utils/guardHelper.class';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {Subscriber} from "rxjs";
import {CheckPortal, Portal} from "../../utils/entities/adminTool/portal";
import {PortalUtils} from "./portalHelper";
@Component({
selector: 'communities',
templateUrl: './communities.component.html',
selector: 'portals',
templateUrl: './portals.component.html',
})
export class CommunitiesComponent implements OnInit {
export class PortalsComponent implements OnInit {
@ViewChild('AlertModalSaveCommunity') alertModalSaveCommunity;
@ViewChild('AlertModalDeleteCommunities') alertModalDeleteCommunities;
@ -37,12 +38,13 @@ export class CommunitiesComponent implements OnInit {
public errorMessage = '';
public updateErrorMessage = '';
public modalErrorMessage = '';
public portalUtils:PortalUtils = new PortalUtils();
ngOnInit() {
this.portalFG = this._fb.group({
name: '',
_id: '',
pid: '',
piwik:'',
type: ''
});
this.formControl = this._fb.control('');
@ -85,12 +87,14 @@ export class CommunitiesComponent implements OnInit {
this.errorMessage = '';
this._helpContentService.getCommunitiesFull(this.properties.adminToolsAPIURL).subscribe(
this._helpContentService.getPortalsFull(this.properties.adminToolsAPIURL).subscribe(
communities => {
this.communities = communities;
if(communities) {
communities.forEach(_ => {
this.checkboxes.push(<CheckPortal>{community: _, checked: false});
});
}
this.showLoading = false;
},
error => this.handleError('System error retrieving communities', error));
@ -168,6 +172,7 @@ export class CommunitiesComponent implements OnInit {
name: community.name,
_id: community._id,
type: community.type,
piwik:community.piwik,
pid: community.pid
});
this.portalFG.controls['type'].disable();
@ -181,6 +186,7 @@ export class CommunitiesComponent implements OnInit {
name: '',
_id: '',
type: '',
piwik: '',
pid: ''
});
this.modalErrorMessage = '';
@ -281,6 +287,7 @@ export class CommunitiesComponent implements OnInit {
name: '',
_id: '',
pid: '',
piwik:'',
type: ''
});
} else {

View File

@ -1,6 +1,6 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {CommunitiesComponent} from './communities.component';
import {PortalsComponent} from './portals.component';
import {RouterModule} from '@angular/router';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {AlertModalModule} from '../../utils/modal/alertModal.module';
@ -14,8 +14,8 @@ import {InputModule} from "../sharedComponents/input/input.module";
ReactiveFormsModule,
RouterModule, AdminToolServiceModule, InputModule
],
declarations: [CommunitiesComponent],
declarations: [PortalsComponent],
providers: [AdminLoginGuard],
exports: [CommunitiesComponent]
exports: [PortalsComponent]
})
export class CommunitiesModule { }
export class PortalModule { }

View File

@ -14,12 +14,12 @@
<!-- <li *ngIf="headerName"><a-->
<!-- class="uk-disabled"><span class="menu_title uk-text-muted uk-text-uppercase">{{headerName}}</span></a></li>-->
<ng-template ngFor [ngForOf]="items" let-item let-i="index">
<li [class.current_section]="isTheActiveMenuItem(item)" [class.uk-text-bold]="isTheActiveMenuItem(item)"
<li [class.current_section]="isTheActiveMenuItem(item)"
[class.act_section]="item.open"
[title]="item.title"
[class.submenu_trigger]="item.items.length > 1" [class.uk-margin]="!isTheActiveMenuItem(item)">
<a *ngIf="item.items.length <= 1" [routerLink]="(item.route && !isTheActiveMenuItem(item))?item.route:null"
[queryParams]=item.params [queryParamsHandling]="queryParamsHandling" class="uk-text-center">
[queryParams]=item.params [queryParamsHandling]="queryParamsHandling" class="uk-text-center" [class.uk-text-bold]="isTheActiveMenuItem(item)">
<div *ngIf="item.icon && !open" class="menu_icon uk-margin-auto">
<span [innerHTML]="satinizeHTML(item.icon)"></span>
</div>
@ -27,14 +27,14 @@
<span class="menu_title" [class.uk-text-small]="!open">{{item.title}}</span>
</a>
<ng-template [ngIf]="item.items.length > 1">
<a (click)="item.open = !item.open" >
<a (click)="item.open = !item.open" class="uk-text-center">
<div *ngIf="item.icon && !open" class="menu_icon "><i class="material-icons">{{item.icon}}</i></div>
<span class="menu_title " [class.uk-text-small]="!open">{{item.title}}</span>
</a>
<ul [style.display]="(item.open?'block':'none')">
<ul [style.display]="(item.open?'block':'none')" class="uk-text-center">
<ng-template ngFor [ngForOf]="item.items" let-subItem let-j="index">
<li *ngIf="subItem.route" [class.act_item]="isTheActiveMenuItem(item, subItem)">
<li *ngIf="subItem.route" [class.act_item]="isTheActiveMenuItem(item, subItem)" [class.current_section]="isTheActiveMenuItem(subItem)">
<a [routerLink]="!isTheActiveMenuItem(item, subItem)?subItem.route:null"
[queryParams]=subItem.params [queryParamsHandling]="queryParamsHandling">
<div *ngIf="subItem.icon" class="menu_icon"><i class="material-icons">{{subItem.icon}}</i></div>

View File

@ -39,7 +39,8 @@ export class SideBarComponent implements OnInit {
if (subItem) {
return MenuItem.isTheActiveMenu(subItem, this.router.url.split('?')[0])
}
return MenuItem.isTheActiveMenu(item, this.router.url.split('?')[0])
console.debug(item.route + " " + this.router.url.split('?')[0] + MenuItem.isTheActiveMenu(item,this.router.url.split('?')[0]))
return MenuItem.isTheActiveMenu(item,this.router.url.split('?')[0]);
}
}

View File

@ -15,7 +15,6 @@ import { CustomOptions } from './servicesUtils/customOptions.class';
import {catchError, map} from "rxjs/operators";
import {properties} from "../../../environments/environment";
@Injectable()
export class HelpContentService {
@ -30,23 +29,107 @@ export class HelpContentService {
}
}
getDivIdsFull(page_id: string, helpContentUrl:string, pid: string = null) {
let parameters: string = "";
if(page_id || pid) {
parameters = "?";
if(page_id) {
parameters += "&page="+page_id;
}
if(pid) {
parameters += "&portal="+pid;
}
getEntities(helpContentUrl:string) {
return this.http.get<Array<Entity>>(helpContentUrl + 'entity')
//.map(res => <Array<Entity>> res.json())
.pipe(catchError(this.handleError));
}
return this.http.get<Array<DivId>>(helpContentUrl + 'divFull'+parameters)
saveEntity(entity: Entity, helpContentUrl:string) {
HelpContentService.removeNulls(entity);
return this.http.post<Entity>(helpContentUrl + 'entity/save', JSON.stringify(entity), CustomOptions.getAuthOptionsWithBody())
//.map(res => <Entity> res.json())
.pipe(catchError(this.handleError));
}
updateEntity(entity: Entity, helpContentUrl:string) {
HelpContentService.removeNulls(entity);
return this.http.post<Entity>(helpContentUrl + 'entity/update', JSON.stringify(entity), CustomOptions.getAuthOptionsWithBody())
//.map(res => <Entity> res.json())
.pipe(catchError(this.handleError));
}
deleteEntities(ids : string[], helpContentUrl:string) {
return this.http.post(helpContentUrl + 'entity/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
.pipe(catchError(this.handleError));
}
// toggleEntity(selectedCommunityId: string, id : string,status : boolean) {
// let headers = new Headers({'Content-Type': 'application/json'});
// let options = new RequestOptions({headers: headers});
//
// return this.http.post(helpContentUrl + 'community/'+selectedCommunityId+'/entity/toggle?status='+ status.toString()+'&entityId='+id.toString(), options)
// .catch(this.handleError);
// }
getCommunityEntities(pid: string, helpContentUrl:string) {
return this.http.get<Array<Entity>>(helpContentUrl + properties.adminToolsPortalType + '/'+pid+'/entities')
//.map(res => <Array<Entity>> res.json())
.pipe(catchError(this.handleError));
}
toggleEntities(pid: string, ids : string[],status : boolean, helpContentUrl:string) {
return this.http.post(helpContentUrl + properties.adminToolsPortalType + '/'+pid+ '/entity/toggle?status='+ status.toString(),
JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
//.map( res => <string[]> res.json())
.pipe(catchError(this.handleError));
}
// unused
toggleEntityOfPage(pageId: string, entityId : string,status : boolean, helpContentUrl:string) {
return this.http.post(helpContentUrl + 'page/'+pageId+'/entity/toggle?status='+ status.toString()+'&entityId='+entityId.toString(),
CustomOptions.getAuthOptionsWithBody())
.pipe(catchError(this.handleError));
}
// getDivIdsFull(page_id: string, helpContentUrl:string, pid: string = null) {
// let parameters: string = "";
// if(page_id || pid) {
// parameters = "?";
// if(page_id) {
// parameters += "&page="+page_id;
// }
// if(pid) {
// parameters += "&portal="+pid;
// }
// }
//
// return this.http.get<Array<DivId>>(helpContentUrl + 'div/full'+parameters)
// //.map(res => <Array<DivId>> res.json())
// .pipe(catchError(this.handleError));
// }
// Replacing getDivIdsFull
getAllDivIdsFull(helpContentUrl:string) {
return this.http.get<Array<DivId>>(helpContentUrl + 'div/full')
//.map(res => <Array<DivId>> res.json())
.pipe(catchError(this.handleError));
}
getDivIdsFullByPortal(page_id: string, helpContentUrl:string, pid: string) {
let parameters: string = page_id ? "?&page="+page_id : "";
return this.http.get<Array<DivId>>(helpContentUrl + properties.adminToolsPortalType + '/'+pid + '/div/full'+parameters)
.pipe(catchError(this.handleError));
}
// End of replacing getDivIdsFull
// unused
getDivId(divId: string, helpContentUrl:string) {
return this.http.get<DivId>(helpContentUrl + 'div/'+divId)
//.map(res => <DivId> res.json())
.pipe(catchError(this.handleError));
}
getDivIdFull(divId: string, helpContentUrl:string, pid: string) {
return this.http.get<DivId>(helpContentUrl + properties.adminToolsPortalType + "/" + pid + '/div/'+divId+"/full")
//.map(res => <DivId> res.json())
.pipe(catchError(this.handleError));
}
updateDivId(divId: DivId, helpContentUrl:string) {
HelpContentService.removeNulls(divId);
@ -55,18 +138,6 @@ export class HelpContentService {
.pipe(catchError(this.handleError));
}
getDivId(divId: string, helpContentUrl:string) {
return this.http.get<DivId>(helpContentUrl + 'div/'+divId)
//.map(res => <DivId> res.json())
.pipe(catchError(this.handleError));
}
getDivIdFull(divId: string, helpContentUrl:string) {
return this.http.get<DivId>(helpContentUrl + 'divFull/'+divId)
//.map(res => <DivId> res.json())
.pipe(catchError(this.handleError));
}
saveDivId(divId: DivId, helpContentUrl:string) {
HelpContentService.removeNulls(divId);
@ -74,116 +145,247 @@ export class HelpContentService {
//.map(res => <DivId> res.json())
.pipe(catchError(this.handleError));
}
/*
getCommunitiesWithDivId(helpContentUrl:string) {
return this.http.get(helpContentUrl + 'community?div=true')
.map(res => <Array<Portal>> res.json())
.catch(this.handleError);
}
*/
getCommunityPagesWithDivId(portal_pid: string, helpContentUrl:string) {
return this.http.get<Array<Page>>(helpContentUrl + properties.adminToolsPortalType + '/'+portal_pid+'/pages?div=true')
//.map(res => <Array<Page>> res.json())
.pipe(catchError(this.handleError));
}
getCommunityDivHelpContents(portal_pid: string, helpContentUrl:string) {
return this.http.get<Array<DivHelpContent>>(helpContentUrl + 'divhelpcontent?portal='+portal_pid)
//.map(res => <Array<DivHelpContent>> res.json())
.pipe(catchError(this.handleError));
}
getDivHelpContent(id : string, helpContentUrl:string) {
return this.http.get<DivHelpContent>(helpContentUrl + 'divhelpcontent/' + id)
//.map(res => <DivHelpContent> res.json())
.pipe(catchError(this.handleError));
}
insertOrUpdateDivHelpContent(divHelpContent: DivHelpContent, helpContentUrl:string) {
HelpContentService.removeNulls(divHelpContent);
return this.http.post<DivHelpContent>(helpContentUrl + 'divhelpcontent', JSON.stringify(divHelpContent), CustomOptions.getAuthOptionsWithBody())
//.map(res => <DivHelpContent> res.json())
.pipe(catchError(this.handleError));
}
deleteDivIds(ids : string[], helpContentUrl:string) {
return this.http.post(helpContentUrl + 'div/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
.pipe(catchError(this.handleError));
}
deleteDivHelpContents(ids : string[], helpContentUrl:string) {
return this.http.post(helpContentUrl + 'divhelpcontent/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
.pipe(catchError(this.handleError));
}
toggleDivHelpContents(ids : string[],status : boolean, helpContentUrl:string) {
return this.http.post(helpContentUrl + 'divhelpcontent/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
//.map( res => <string[]> res.json())
.pipe(catchError(this.handleError));
}
getPagesWithDivIds(portal_pid: string, helpContentUrl:string) {
let parameters = (portal_pid ? "?portal="+portal_pid : "");
return this.http.get<Array<string>>(helpContentUrl + 'div/pages'+parameters)
getPageIdsFromDivIds(pid: string, helpContentUrl:string) {
//let parameters = (pid ? "?portal="+pid : "");
return this.http.get<Array<string>>(helpContentUrl + properties.adminToolsPortalType + "/" + pid + '/div/pages')
//.map(res => <Map<string, Set<string>>> res.json())
.pipe(catchError(this.handleError));
}
getPages(helpContentUrl:string,pid:string,with_positions:boolean=null) {
let parameters: string = "";
if(pid || with_positions == true || with_positions == false) {
parameters = "?";
if(pid) {
parameters += "&pid="+pid;
/*
getCommunitiesWithDivId(helpContentUrl:string) {
return this.http.get(helpContentUrl + 'community?div=true')
.map(res => <Array<Portal>> res.json())
.catch(this.handleError);
}
if(with_positions == true || with_positions == false) {
parameters += "&with_positions="+with_positions;
*/
getCommunityDivHelpContents(pid: string, helpContentUrl:string) {
return this.http.get<Array<DivHelpContent>>(helpContentUrl + properties.adminToolsPortalType + "/" + pid + '/divhelpcontent')
//.map(res => <Array<DivHelpContent>> res.json())
.pipe(catchError(this.handleError));
}
getDivHelpContent(id : string, helpContentUrl:string, pid: string) {
return this.http.get<DivHelpContent>(helpContentUrl + properties.adminToolsPortalType + "/" + pid + '/divhelpcontent/' + id)
//.map(res => <DivHelpContent> res.json())
.pipe(catchError(this.handleError));
}
return this.http.get<Array<Page>>(helpContentUrl + 'page'+parameters)
// unused
insertOrUpdateDivHelpContent(divHelpContent: DivHelpContent, helpContentUrl:string, pid: string) {
HelpContentService.removeNulls(divHelpContent);
return this.http.post<DivHelpContent>(helpContentUrl + properties.adminToolsPortalType + "/" + pid + '/divhelpcontent',
JSON.stringify(divHelpContent), CustomOptions.getAuthOptionsWithBody())
//.map(res => <DivHelpContent> res.json())
.pipe(catchError(this.handleError));
}
saveDivHelpContent(divHelpContent: DivHelpContent, helpContentUrl:string, pid: string) {
HelpContentService.removeNulls(divHelpContent);
return this.http.post<DivHelpContent>(helpContentUrl + properties.adminToolsPortalType + '/' + pid + '/divhelpcontent/save',
JSON.stringify(divHelpContent), CustomOptions.getAuthOptionsWithBody())
.pipe(catchError(this.handleError));
}
updateDivHelpContent(divHelpContent: DivHelpContent, helpContentUrl:string, pid: string) {
HelpContentService.removeNulls(divHelpContent);
return this.http.post<DivHelpContent>(helpContentUrl + properties.adminToolsPortalType + '/' + pid +'/divhelpcontent/update',
JSON.stringify(divHelpContent), CustomOptions.getAuthOptionsWithBody())
.pipe(catchError(this.handleError));
}
deleteDivHelpContents(ids : string[], helpContentUrl:string, pid: string) {
return this.http.post(helpContentUrl + properties.adminToolsPortalType + "/" + pid + '/divhelpcontent/delete',
JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
.pipe(catchError(this.handleError));
}
toggleDivHelpContents(ids : string[],status : boolean, helpContentUrl:string, pid: string) {
return this.http.post(helpContentUrl + properties.adminToolsPortalType + '/' + pid + '/divhelpcontent/toggle?status='+ status.toString(),
JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
//.map( res => <string[]> res.json())
.pipe(catchError(this.handleError));
}
// unused
getPageHelpContents(helpContentUrl:string) {
return this.http.get<Array<PageHelpContent>>(helpContentUrl + 'pagehelpcontent')
//.map(res => <Array<PageHelpContent>> res.json())
.pipe(catchError(this.handleError));
}
getCommunityPageHelpContents(pid: string, helpContentUrl:string) {
return this.http.get<Array<PageHelpContent>>(helpContentUrl + properties.adminToolsPortalType + '/' + pid + '/pagehelpcontent')
//.map(res => <Array<PageHelpContent>> res.json())
.pipe(catchError(this.handleError));
}
getPageHelpContent(id : string, helpContentUrl:string, pid: string) {
return this.http.get<PageHelpContent>(helpContentUrl + properties.adminToolsPortalType + '/' + pid + '/pagehelpcontent/' + id)
//.map(res => <PageHelpContent> res.json())
.pipe(catchError(this.handleError));
}
savePageHelpContent(pageHelpContent: PageHelpContent, helpContentUrl:string, pid: string) {
HelpContentService.removeNulls(pageHelpContent);
return this.http.post<PageHelpContent>(helpContentUrl + properties.adminToolsPortalType + '/' + pid + '/pagehelpcontent/save',
JSON.stringify(pageHelpContent), CustomOptions.getAuthOptionsWithBody())
//.map(res => <PageHelpContent> res.json())
.pipe(catchError(this.handleError));
}
updatePageHelpContent(pageHelpContent: PageHelpContent, helpContentUrl:string, pid: string) {
HelpContentService.removeNulls(pageHelpContent);
return this.http.post<PageHelpContent>(helpContentUrl + properties.adminToolsPortalType + '/' + pid +'/pagehelpcontent/update',
JSON.stringify(pageHelpContent), CustomOptions.getAuthOptionsWithBody())
//.map(res => <PageHelpContent> res.json())
.pipe(catchError(this.handleError));
}
deletePageHelpContents(ids : string[], helpContentUrl:string, pid: string) {
return this.http.post(helpContentUrl + properties.adminToolsPortalType + '/' + pid + '/pagehelpcontent/delete',
JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
.pipe(catchError(this.handleError));
}
togglePageHelpContents(ids : string[],status : boolean, helpContentUrl:string, pid: string) {
return this.http.post(helpContentUrl + properties.adminToolsPortalType + '/' + pid + '/pagehelpcontent/toggle?status='+ status.toString(),
JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
//.map( res => <string[]> res.json())
.pipe(catchError(this.handleError));
}
getCommunityPagesWithDivId(pid: string, helpContentUrl:string) {
return this.http.get<Array<Page>>(helpContentUrl + properties.adminToolsPortalType + '/'+pid+'/pages?div=true')
//.map(res => <Array<Page>> res.json())
.pipe(catchError(this.handleError));
}
getPagesFull(helpContentUrl:string,pid:string) {
return this.http.get<Array<Page>>(helpContentUrl + 'pageFull'+(pid?("?pid="+pid):""))
// getCommunityPages(pid: string, params: string, helpContentUrl:string) {
// return this.http.get<Array<Page>>(helpContentUrl + properties.adminToolsPortalType + '/'+pid+'/pages'+params, CustomOptions.getAuthOptions())
// //.map(res => <Array<Page>> res.json())
// .pipe(catchError(this.handleError));
// }
// Replacing getCommunityPages
getCommunityPagesByType(pid: string, type: string, helpContentUrl:string) {
return this.http.get<Array<Page>>(helpContentUrl + properties.adminToolsPortalType + '/'+pid+'/pages'
+ (type ? '?page_type='+type : ''))
//.map(res => <Array<Page>> res.json())
.pipe(catchError(this.handleError));
}
// End of replacing getCommunityPages
// Replacing part of getPages (now getAllPages)
getCommunityPagesWithPositions(pid: string, helpContentUrl:string) {
return this.http.get<Array<Page>>(helpContentUrl + properties.adminToolsPortalType + '/'+pid+'/pages?with_positions=true')
//.map(res => <Array<Page>> res.json())
.pipe(catchError(this.handleError));
}
// End of replacing part of getPages (now getAllPages)
getAllPages(helpContentUrl:string) {//,pid:string,with_positions:boolean=null) {
// let parameters: string = "";
// if(pid || with_positions == true || with_positions == false) {
// parameters = "?";
// if(pid) {
// parameters += "&pid="+pid;
// }
// if(with_positions == true || with_positions == false) {
// parameters += "&with_positions="+with_positions;
// }
// }
return this.http.get<Array<Page>>(helpContentUrl + 'page')
//.map(res => <Array<Page>> res.json())
.pipe(catchError(this.handleError));
}
getPage(pageId:string, helpContentUrl:string) {
return this.http.get<Page>(helpContentUrl + 'page/'+pageId)
getAllPagesFull(helpContentUrl:string) {
return this.http.get<Array<Page>>(helpContentUrl + 'page/full')//+(pid?("?pid="+pid):""))
//.map(res => <Array<Page>> res.json())
.pipe(catchError(this.handleError));
}
getPageByPortal(pageId:string, helpContentUrl:string, pid: string) {
return this.http.get<Page>(helpContentUrl + properties.adminToolsPortalType + '/' + pid + '/page/'+pageId)
//.map(res => <Page> res.json())
.pipe(catchError(this.handleError));
}
getPageByRoute(route:string, helpContentUrl:string) {
return this.http.get<Page>(helpContentUrl + 'page/?page_route='+route)
getCommunityPageByRoute(route:string, helpContentUrl:string, pid: string) {
return this.http.get<Page>(helpContentUrl + properties.adminToolsPortalType +'/' + pid + '/page/?page_route='+route)
.pipe(catchError(this.handleError));
}
savePage(page: Page, helpContentUrl:string) {
HelpContentService.removeNulls(page);
return this.http.post<Page>(helpContentUrl + 'page/save', JSON.stringify(page), CustomOptions.getAuthOptionsWithBody())
//.map(res => <Page> res.json())
.pipe(catchError(this.handleError));
}
updatePage(page: Page, helpContentUrl:string) {
HelpContentService.removeNulls(page);
return this.http.post<Page>(helpContentUrl + 'page/update', JSON.stringify(page), CustomOptions.getAuthOptionsWithBody())
//.map(res => <Page> res.json())
.pipe(catchError(this.handleError));
}
togglePages(selectedPortalPid: string, ids : string[],status : boolean, helpContentUrl:string) {
return this.http.post(helpContentUrl + properties.adminToolsPortalType + '/'+selectedPortalPid+'/page/toggle?status='+ status.toString(),
JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
.pipe(catchError(this.handleError));
}
deletePages(ids : string[], helpContentUrl:string) {
return this.http.post(helpContentUrl + 'page/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
.pipe(catchError(this.handleError));
}
// unused
getCommunities( helpContentUrl:string) {
return this.http.get<Array<Portal>>(helpContentUrl + properties.adminToolsPortalType)
//.map(res => <Array<Portal>> res.json())
.pipe(catchError(this.handleError));
}
getCommunity(portal_pid: string, helpContentUrl:string) {
return this.http.get<Portal>(helpContentUrl + properties.adminToolsPortalType + '/'+portal_pid)
getCommunity(pid: string, helpContentUrl:string) {
return this.http.get<Portal>(helpContentUrl + properties.adminToolsPortalType + '/'+pid)
//.map(res => <Portal> res.json())
.pipe(catchError(this.handleError));
}
getCommunitiesFull( helpContentUrl:string) {
return this.http.get<Array<Portal>>(helpContentUrl + properties.adminToolsPortalType + 'Full')
return this.http.get<Array<Portal>>(helpContentUrl + properties.adminToolsPortalType + '/full')
//.map(res => <Array<Portal>> res.json())
.pipe(catchError(this.handleError));
}
getPortalsFull( helpContentUrl:string) {
return this.http.get<Array<Portal>>(helpContentUrl + 'portal/full')
//.map(res => <Array<Portal>> res.json())
.pipe(catchError(this.handleError));
}
getCommunityFull(portal_pid: string, helpContentUrl:string) {
return this.http.get<Portal>(helpContentUrl + properties.adminToolsPortalType + 'Full/'+portal_pid)
return this.http.get<Portal>(helpContentUrl + properties.adminToolsPortalType + '/'+portal_pid+'/full')
//.map(res => <Portal> res.json())
.pipe(catchError(this.handleError));
}
@ -218,141 +420,6 @@ export class HelpContentService {
.pipe(catchError(this.handleError));
}
getCommunityPages(portal_pid: string, params: string, helpContentUrl:string) {
return this.http.get<Array<Page>>(helpContentUrl + properties.adminToolsPortalType + '/'+portal_pid+'/pages'+params)
//.map(res => <Array<Page>> res.json())
.pipe(catchError(this.handleError));
}
getEntities(helpContentUrl:string) {
return this.http.get<Array<Entity>>(helpContentUrl + 'entity')
//.map(res => <Array<Entity>> res.json())
.pipe(catchError(this.handleError));
}
getCommunityEntities(portal_pid: string, helpContentUrl:string) {
return this.http.get<Array<Entity>>(helpContentUrl + properties.adminToolsPortalType + '/'+portal_pid+'/entities')
//.map(res => <Array<Entity>> res.json())
.pipe(catchError(this.handleError));
}
saveEntity(entity: Entity, helpContentUrl:string) {
HelpContentService.removeNulls(entity);
return this.http.post<Entity>(helpContentUrl + 'entity/save', JSON.stringify(entity), CustomOptions.getAuthOptionsWithBody())
//.map(res => <Entity> res.json())
.pipe(catchError(this.handleError));
}
updateEntity(entity: Entity, helpContentUrl:string) {
HelpContentService.removeNulls(entity);
return this.http.post<Entity>(helpContentUrl + 'entity/update', JSON.stringify(entity), CustomOptions.getAuthOptionsWithBody())
//.map(res => <Entity> res.json())
.pipe(catchError(this.handleError));
}
// toggleEntity(selectedCommunityId: string, id : string,status : boolean) {
// let headers = new Headers({'Content-Type': 'application/json'});
// let options = new RequestOptions({headers: headers});
//
// return this.http.post(helpContentUrl + 'community/'+selectedCommunityId+'/entity/toggle?status='+ status.toString()+'&entityId='+id.toString(), options)
// .catch(this.handleError);
// }
toggleEntities(selectedPortalPid: string, ids : string[],status : boolean, helpContentUrl:string) {
return this.http.post(helpContentUrl + properties.adminToolsPortalType + '/'+selectedPortalPid+ '/entity/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
//.map( res => <string[]> res.json())
.pipe(catchError(this.handleError));
}
deleteEntities(ids : string[], helpContentUrl:string) {
return this.http.post(helpContentUrl + 'entity/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
.pipe(catchError(this.handleError));
}
toggleEntityOfPage(pageId: string, entityId : string,status : boolean, helpContentUrl:string) {
return this.http.post(helpContentUrl + 'page/'+pageId+'/entity/toggle?status='+ status.toString()+'&entityId='+entityId.toString(), CustomOptions.getAuthOptionsWithBody())
.pipe(catchError(this.handleError));
}
savePage(page: Page, helpContentUrl:string) {
HelpContentService.removeNulls(page);
return this.http.post<Page>(helpContentUrl + 'page/save', JSON.stringify(page), CustomOptions.getAuthOptionsWithBody())
//.map(res => <Page> res.json())
.pipe(catchError(this.handleError));
}
updatePage(page: Page, helpContentUrl:string) {
HelpContentService.removeNulls(page);
return this.http.post<Page>(helpContentUrl + 'page/update', JSON.stringify(page), CustomOptions.getAuthOptionsWithBody())
//.map(res => <Page> res.json())
.pipe(catchError(this.handleError));
}
togglePages(selectedPortalPid: string, ids : string[],status : boolean, helpContentUrl:string) {
return this.http.post(helpContentUrl + properties.adminToolsPortalType + '/'+selectedPortalPid+'/page/toggle?status='+ status.toString(),JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
.pipe(catchError(this.handleError));
}
deletePages(ids : string[], helpContentUrl:string) {
return this.http.post(helpContentUrl + 'page/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
.pipe(catchError(this.handleError));
}
getPageHelpContents(helpContentUrl:string) {
return this.http.get<Array<PageHelpContent>>(helpContentUrl + 'pagehelpcontent')
//.map(res => <Array<PageHelpContent>> res.json())
.pipe(catchError(this.handleError));
}
getCommunityPageHelpContents(portal_pid: string, helpContentUrl:string) {
return this.http.get<Array<PageHelpContent>>(helpContentUrl + 'pagehelpcontent?portal='+portal_pid)
//.map(res => <Array<PageHelpContent>> res.json())
.pipe(catchError(this.handleError));
}
getPageHelpContent(id : string, helpContentUrl:string) {
return this.http.get<PageHelpContent>(helpContentUrl + 'pagehelpcontent/' + id)
//.map(res => <PageHelpContent> res.json())
.pipe(catchError(this.handleError));
}
savePageHelpContent(pageHelpContent: PageHelpContent, helpContentUrl:string) {
HelpContentService.removeNulls(pageHelpContent);
return this.http.post<PageHelpContent>(helpContentUrl + 'pagehelpcontent/save', JSON.stringify(pageHelpContent), CustomOptions.getAuthOptionsWithBody())
//.map(res => <PageHelpContent> res.json())
.pipe(catchError(this.handleError));
}
updatePageHelpContent(pageHelpContent: PageHelpContent, helpContentUrl:string) {
HelpContentService.removeNulls(pageHelpContent);
return this.http.post<PageHelpContent>(helpContentUrl + 'pagehelpcontent/update', JSON.stringify(pageHelpContent), CustomOptions.getAuthOptionsWithBody())
//.map(res => <PageHelpContent> res.json())
.pipe(catchError(this.handleError));
}
deletePageHelpContents(ids : string[], helpContentUrl:string) {
return this.http.post(helpContentUrl + 'pagehelpcontent/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
.pipe(catchError(this.handleError));
}
togglePageHelpContents(ids : string[],status : boolean, helpContentUrl:string) {
return this.http.post(helpContentUrl + 'pagehelpcontent/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
//.map( res => <string[]> res.json())
.pipe(catchError(this.handleError));
}
private handleError(error: HttpErrorResponse) {
// in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console

View File

@ -161,7 +161,8 @@
</div>
<div class="tm-header uk-visible@m tm-header-transparent" uk-header="">
<div id="stickyNavbar" [class]="'uk-navbar-container uk-sticky uk-navbar-transparent '+portal+'-menu'" uk-sticky=""
media="768" cls-active="uk-active uk-navbar-sticky" animation="uk-animation-slide-top"
media="768" cls-active="uk-active uk-navbar-sticky"
[attr.animation]="(header.stickyAnimation != false ?'uk-animation-slide-top':null)"
top=".tm-header + [class*=&quot;uk-section&quot;]" cls-inactive="uk-navbar-transparent" style="">
<div *ngIf="(properties.environment =='beta' || properties.environment =='development') && showLogo && header.badge">
<img class="beta-indication-sticky"

View File

@ -15,6 +15,7 @@ export interface Header {
logoSmallUrl: string,
position: 'left' | 'center' | 'right',
badge: boolean
stickyAnimation?:boolean
}
@Component({

View File

@ -0,0 +1,17 @@
import {Page} from './page';
import {Entity} from './entity';
/*
export interface Community {
_id: string;
pid: string;
name: string;
entities: string[] | Entity[];
pages: string[] | Page[];
}
export interface CheckCommunity {
community: Community;
checked: boolean;
}
*/

View File

@ -3,7 +3,7 @@ import {Page} from './page';
export interface DivId {
_id: string;
name: string;
pages: Page[] | String[];
pages: string[] | Page[];
portalType: string;
}

View File

@ -4,7 +4,7 @@ import { Portal } from "./portal";
export interface HtmlPageContent {
_id: string;
page: Page | string;
portal: Portal | string;
community: Portal | string;
content: string;
}

View File

@ -2,7 +2,7 @@
* Created by stefania on 7/13/17.
*/
import { Page } from './page';
import {Portal} from "./portal";
import { Portal } from './portal';
export interface PageHelpContent {
_id: string;

View File

@ -6,6 +6,7 @@ export interface Portal {
pid: string;
name: string;
type: string;
piwik:number;
entities: string[] | Entity[];
pages: string[] | Page[];
}