diff --git a/portal-2/src/app/claims/claim-utils/claimContextSearchForm.component.ts b/portal-2/src/app/claims/claim-utils/claimContextSearchForm.component.ts
index 8dda4cac..9b11b618 100644
--- a/portal-2/src/app/claims/claim-utils/claimContextSearchForm.component.ts
+++ b/portal-2/src/app/claims/claim-utils/claimContextSearchForm.component.ts
@@ -33,6 +33,52 @@ import {ErrorCodes} from '../../login/utils/guardHelper.class';
@@ -62,6 +108,9 @@ public selectedCommunityLabel:string = "Community:";
public categories:string[];
public selectedCategoryLabel:string ="Category:";
public concepts = [];
+public conceptsClass = [];
+public conceptsClassDisplay = [];
+public conceptsCategoryLoading = [];
public warningMessage = "";
public infoMessage = "";
public loading:boolean = false;
@@ -74,18 +123,23 @@ constructor(private _contextService: ContextsService,private router: Router) {
select($event){
var item = $event.value;
-
- var context: ClaimContext= { community: this.selectedCommunityLabel, category: this.selectedCategoryLabel, concept: item };
+ this.addNewContext( this.selectedCommunityLabel, this.selectedCategoryLabel, item);
+ }
+isSelected(id):boolean{
+ for (var _i = 0; _i < this.selectedList.length; _i++) {
+ let item = this.selectedList[_i];
+ if(item.concept.id == id){
+ return true;
+ // this.warningMessage = "Concept already in selected list";
+ }
+ }
+ return false;
+}
+ addNewContext(community,category,concept){
+ var context: ClaimContext= { community: community, category: category, concept: concept };
var found:boolean = false;
this.warningMessage = "";
- for (var _i = 0; _i < this.selectedList.length; _i++) {
- let item = this.selectedList[_i];
- if(item.concept.id == context.concept.id){
- found=true;
- // this.warningMessage = "Concept already in selected list";
- }
- }
- if (!found) {
+ if (!this.isSelected(context.concept.id)) {
this.selectedList.push(context);
UIkit.notification({
@@ -163,7 +217,7 @@ getCommunities () {
this.concepts = [];
this.addCommunityInConcepts();
var token=Session.getUserJwt();
- this._contextService.getConcepts(this.selectedCategoryId, "",token).subscribe(
+ this._contextService.getConcepts(this.selectedCategoryId, "",token,true).subscribe(
data => {
this.concepts = data;
this.addCommunityInConcepts();
@@ -185,6 +239,47 @@ getCommunities () {
this.loading = false;
}
}
+ displaySubcategory(id) {
+ if(this.conceptsClassDisplay[id] != null){
+ this.conceptsClassDisplay[id] = !this.conceptsClassDisplay[id];
+
+ }else{
+ this.conceptsClassDisplay[id] = true;
+ }
+ console.log("displaySubcategory: "+id+" value:"+ this.conceptsClassDisplay[id]);
+ }
+ browseConcepts (categoryId) {
+ this.conceptsCategoryLoading[categoryId] = true;
+ if(!Session.isValidAndRemove()){
+ this.saveStateAndRedirectLogin();
+ }else{
+ if(this.conceptsClass[categoryId] != null){
+ this.conceptsClassDisplay[categoryId] = !this.conceptsClassDisplay[categoryId];
+ return;
+ }else{
+ this.conceptsClassDisplay[categoryId] = true;
+ }
+ this.conceptsClass[categoryId] = [];
+ var token=Session.getUserJwt();
+ this._contextService.getConcepts(categoryId, "",token,false).subscribe(
+ data => {
+ for(var i=0;iLoading communities information...
+ Or Browse through categories
+
0" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}
0" class="uk-alert uk-alert-primary" role="alert">{{infoMessage}}
{{pageTitle}}
+
-
+
- @@ -88,7 +88,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
-
+
-
0" class ="uk-animation-fade">10"> @@ -207,7 +207,6 @@ import {RouterHelper} from '../../utils/routerHelper.class'; }) export class SearchComponent { public sub: any; - public reloadPublications: boolean; public reloadDatasets: boolean; public reloadProjects: boolean; @@ -265,9 +264,19 @@ public subPub;public subData;public subProjects;public subOrg;public subPeople; this._meta.updateMeta("description", description); this._meta.updateMeta("og:description", description); this._meta.updateMeta("og:title", title); + // console.log("Constr PORT:"+process.env.PORT); + // if (typeof document !== 'undefined') { + // + // console.log("Constr Cookie:"+document.cookie); + // } } public ngOnInit() { + // console.log("init PORT:"+process.env.PORT); + // if (typeof document !== 'undefined') { + // + // console.log("Init Cookie:"+document.cookie); + // } this.sub = this.route.queryParams.subscribe(params => { this.keyword = (params['keyword'])?params['keyword']:""; if(this.keyword !=null && this.keyword.length > 0){ diff --git a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts index 76905963..fdac4d0a 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts @@ -20,7 +20,7 @@ import {SearchFilterModalComponent} from './searchFilterModal.component';
{{pageTitle}}
-+diff --git a/portal-2/src/app/sharedComponents/navigationBar.component.ts b/portal-2/src/app/sharedComponents/navigationBar.component.ts index a436881e..520770bc 100644 --- a/portal-2/src/app/sharedComponents/navigationBar.component.ts +++ b/portal-2/src/app/sharedComponents/navigationBar.component.ts @@ -89,7 +89,7 @@ import {Session} from '../login/utils/helper.class';