diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DashBoardManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DashBoardManager.java index 9c9ce99ea..d81ea70fd 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DashBoardManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DashBoardManager.java @@ -62,17 +62,21 @@ public class DashBoardManager { RecentActivity activity = new RecentActivity(); UserInfo user = new UserInfo(); user.setId(principal.getId()); + DatasetCriteria datasetCriteria = new DatasetCriteria(); + datasetCriteria.setAllVersions(false); + DataManagementPlanCriteria dataManagementPlanCriteria = new DataManagementPlanCriteria(); + dataManagementPlanCriteria.setAllVersions(false); RecentActivityDataBuilder recentActivityDataBuilder = apiContext.getOperationsContext().getBuilderFactory().getBuilder(RecentActivityDataBuilder.class); - CompletableFuture> dmps = dataManagementPlanRepository.getAuthenticated(dataManagementPlanRepository.asQueryable(), user) + CompletableFuture> dmps = dataManagementPlanRepository.getAuthenticated(dataManagementPlanRepository.getWithCriteria(dataManagementPlanCriteria), user) .withHint("dmpRecentActivity") .orderBy((builder, root) -> builder.desc(root.get("modified"))) .take(numberofactivities) .selectAsync(item -> recentActivityDataBuilder.label(item.getLabel()).timestamp(item.getModified()).id(item.getId().toString()).build()) .whenComplete((dmpActivities, throwable) -> activity.setRecentDmpActivities(dmpActivities)); - CompletableFuture> datasets = datasetRepository.getAuthenticated(datasetRepository.asQueryable(), user) + CompletableFuture> datasets = datasetRepository.getAuthenticated(datasetRepository.getWithCriteria(datasetCriteria), user) .withHint("datasetRecentActivity") .orderBy((builder, root) -> builder.desc(root.get("modified"))) .take(numberofactivities) diff --git a/dmp-backend/web/src/main/resources/application.properties b/dmp-backend/web/src/main/resources/application.properties index ac7cd7360..100a05014 100644 --- a/dmp-backend/web/src/main/resources/application.properties +++ b/dmp-backend/web/src/main/resources/application.properties @@ -71,5 +71,5 @@ http-logger.initial-delay = 0 http-logger.delay = 10 http-logger.server-address = http://logstash:31311 #############################Elastic Search###################################### -elasticsearch.host = elasticsearch-dmp -elasticsearch.port = 9200 +elasticsearch.host = localhost +elasticsearch.port = 9201 diff --git a/dmp-backend/web/src/main/resources/images/default.png b/dmp-backend/web/src/main/resources/images/default.png index 71612d552..1caf419e5 100644 Binary files a/dmp-backend/web/src/main/resources/images/default.png and b/dmp-backend/web/src/main/resources/images/default.png differ diff --git a/dmp-frontend/package-lock.json b/dmp-frontend/package-lock.json index 20724d819..63f69444f 100644 --- a/dmp-frontend/package-lock.json +++ b/dmp-frontend/package-lock.json @@ -4065,7 +4065,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -4086,12 +4087,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -4106,17 +4109,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -4233,7 +4239,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -4245,6 +4252,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -4259,6 +4267,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -4266,12 +4275,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -4290,6 +4301,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -4370,7 +4382,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -4382,6 +4395,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -4467,7 +4481,8 @@ "safe-buffer": { "version": "5.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -4503,6 +4518,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -4522,6 +4538,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -4565,12 +4582,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, diff --git a/dmp-frontend/src/app/homepage/homepage.component.ts b/dmp-frontend/src/app/homepage/homepage.component.ts index a6b87c8f6..89010c367 100644 --- a/dmp-frontend/src/app/homepage/homepage.component.ts +++ b/dmp-frontend/src/app/homepage/homepage.component.ts @@ -52,11 +52,13 @@ export class HomepageComponent implements OnInit { ngOnInit() { - this.userReferenceService.getRecentActivity().subscribe(response => { - this.datasetActivities = response["recentDatasetActivities"]; - this.dmpActivities = response["recentDmpActivities"]; - this.projectActivities = response["recentProjectActivities"]; - }) + if (this.isAuthenticated()) { + this.userReferenceService.getRecentActivity().subscribe(response => { + this.datasetActivities = response["recentDatasetActivities"]; + this.dmpActivities = response["recentDmpActivities"]; + this.projectActivities = response["recentProjectActivities"]; + }) + } this.projectAutoCompleteConfiguration = { filterFn: this.searchProject.bind(this), diff --git a/dmp-frontend/src/app/shared/components/figurecard/figurecard.component.html b/dmp-frontend/src/app/shared/components/figurecard/figurecard.component.html index 7475dee05..4577acc87 100644 --- a/dmp-frontend/src/app/shared/components/figurecard/figurecard.component.html +++ b/dmp-frontend/src/app/shared/components/figurecard/figurecard.component.html @@ -5,7 +5,7 @@

{{ category | translate }}

{{ title }}

- +
diff --git a/dmp-frontend/src/app/shared/components/figurecard/figurecard.component.ts b/dmp-frontend/src/app/shared/components/figurecard/figurecard.component.ts index 710697b4d..a9c4fb87f 100644 --- a/dmp-frontend/src/app/shared/components/figurecard/figurecard.component.ts +++ b/dmp-frontend/src/app/shared/components/figurecard/figurecard.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit, Input } from '@angular/core'; import { Router } from '@angular/router'; +import { AuthService } from '../../../services/auth/auth.service'; @Component({ selector: 'app-figurecard', @@ -19,7 +20,7 @@ export class FigurecardComponent implements OnInit { @Input() buttonTitle: string; @Input() buttonRedirectLink: string; - constructor(private router: Router) { } + constructor(private router: Router,private authService: AuthService) { } ngOnInit() { } @@ -32,4 +33,8 @@ export class FigurecardComponent implements OnInit { this.router.navigate([this.buttonRedirectLink]); } + isAuthenticated(){ + return this.authService.current() != null; + } + } diff --git a/dmp-frontend/src/app/shared/components/navigation/navigation.component.html b/dmp-frontend/src/app/shared/components/navigation/navigation.component.html index 90131b637..60567fcc9 100644 --- a/dmp-frontend/src/app/shared/components/navigation/navigation.component.html +++ b/dmp-frontend/src/app/shared/components/navigation/navigation.component.html @@ -13,7 +13,7 @@ -
+
@@ -24,13 +24,13 @@
-
+
-
+
diff --git a/docker-compose.yml b/docker-compose.yml index bed3fac32..a99174e5c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -56,31 +56,31 @@ services: ##########################ELK-STACK###################################################################### - # elasticsearch: - # image: docker.elastic.co/elasticsearch/elasticsearch:${TAG} - # container_name: elasticsearch - # environment: ['http.host=0.0.0.0', 'transport.host=127.0.0.1', 'ELASTIC_PASSWORD=${ELASTIC_PASSWORD}'] - # ports: ['0.0.0.0:9200:9200'] - # networks: ['stack'] - # volumes: - # - esdata:/usr/share/elasticsearch/data + elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch:${TAG} + container_name: elasticsearch + environment: ['http.host=0.0.0.0', 'transport.host=127.0.0.1', 'ELASTIC_PASSWORD=${ELASTIC_PASSWORD}','discovery.type=single-node'] + ports: ['0.0.0.0:9200:9200'] + networks: ['stack'] + volumes: + - esdata:/usr/share/elasticsearch/data - # kibana: - # image: docker.elastic.co/kibana/kibana:${TAG} - # container_name: kibana - # ports: ['0.0.0.0:5601:5601'] - # networks: ['stack'] - # depends_on: ['elasticsearch'] + kibana: + image: docker.elastic.co/kibana/kibana:${TAG} + container_name: kibana + ports: ['0.0.0.0:5601:5601'] + networks: ['stack'] + depends_on: ['elasticsearch'] - # logstash: - # image: docker.elastic.co/logstash/logstash:${TAG} - # container_name: logstash - # volumes: - # - ./ELK.Docker/config/logstash.conf:/usr/share/logstash/pipeline/logstash.conf - # ports: ['0.0.0.0:31311:31311'] + logstash: + image: docker.elastic.co/logstash/logstash:${TAG} + container_name: logstash + volumes: + - ./ELK.Docker/config/logstash.conf:/usr/share/logstash/pipeline/logstash.conf + ports: ['0.0.0.0:31311:31311'] - # networks: ['stack'] - # depends_on: ['elasticsearch', 'setup_logstash'] + networks: ['stack'] + depends_on: ['elasticsearch', 'setup_logstash'] #filebeat: # image: docker.elastic.co/beats/filebeat:${TAG} @@ -97,23 +97,23 @@ services: # depends_on: ['elasticsearch', 'setup_heartbeat'] # Run a short-lived container to set up Logstash. - # setup_logstash: - # image: centos:7 - # container_name: setup_logstash - # volumes: ['./ELK.Docker/scripts/setup-logstash.sh:/usr/local/bin/setup-logstash.sh:ro'] - # command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-logstash.sh | tr -d "\r" | bash'] - # environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}'] - # networks: ['stack'] - # depends_on: ['elasticsearch'] + setup_logstash: + image: centos:7 + container_name: setup_logstash + volumes: ['./ELK.Docker/scripts/setup-logstash.sh:/usr/local/bin/setup-logstash.sh:ro'] + command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-logstash.sh | tr -d "\r" | bash'] + environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}'] + networks: ['stack'] + depends_on: ['elasticsearch'] - # setup_kibana: - # image: centos:7 - # container_name: setup_kibana - # volumes: ['./ELK.Docker/scripts/setup-kibana.sh:/usr/local/bin/setup-kibana.sh:ro'] - # command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-kibana.sh | tr -d "\r" | bash'] - # environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}'] - # networks: ['stack'] - # depends_on: ['elasticsearch'] + setup_kibana: + image: centos:7 + container_name: setup_kibana + volumes: ['./ELK.Docker/scripts/setup-kibana.sh:/usr/local/bin/setup-kibana.sh:ro'] + command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-kibana.sh | tr -d "\r" | bash'] + environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}'] + networks: ['stack'] + depends_on: ['elasticsearch'] #setup_filebeat: # image: docker.elastic.co/beats/filebeat:${TAG}