dodavanje fajlova

parent d4608873
...@@ -5993,6 +5993,23 @@ ...@@ -5993,6 +5993,23 @@
"tslib": "^2.3.0" "tslib": "^2.3.0"
} }
}, },
"ngx-clipboard": {
"version": "15.1.0",
"resolved": "https://registry.npmjs.org/ngx-clipboard/-/ngx-clipboard-15.1.0.tgz",
"integrity": "sha512-dUJl1cNtdkCqL953oAhP7wmUPFrqW2aDg5OPhwPU9R3cLEdQgU2NbsHEUz4zaPyEopTXu8SR37onVm1Ep8qOHg==",
"requires": {
"ngx-window-token": ">=6.0.0",
"tslib": "^2.0.0"
}
},
"ngx-window-token": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/ngx-window-token/-/ngx-window-token-6.0.0.tgz",
"integrity": "sha512-IeLKO1jzfzSvZ6vlAt4QSY/B5XcHEhdOwTjqvWEPt6/esWV9T3mA2ln10kj6SCc9pUSx4NybxE10gcyyYroImg==",
"requires": {
"tslib": "^2.0.0"
}
},
"nice-napi": { "nice-napi": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/nice-napi/-/nice-napi-1.0.2.tgz", "resolved": "https://registry.npmjs.org/nice-napi/-/nice-napi-1.0.2.tgz",
......
...@@ -43,12 +43,18 @@ export class HeaderMenuComponent implements OnInit,OnDestroy{ ...@@ -43,12 +43,18 @@ export class HeaderMenuComponent implements OnInit,OnDestroy{
visible:this.isUserAdmin() visible:this.isUserAdmin()
}, },
{ {
label: 'IPMWORKS', label: 'IPMWORKS Project',
url:'http://ipmworks.net', url:'http://ipmworks.net',
styleClass:"pr-2", styleClass:"pr-2",
target:"_blank" target:"_blank"
}, },
{ {
label: 'Help and Support',
routerLink:'/help',
styleClass:"pr-2",
target:"_blank"
},
{
label: 'Logout', label: 'Logout',
command:(event) => {this.logout()}, command:(event) => {this.logout()},
styleClass:"pr-2", styleClass:"pr-2",
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
...@@ -34,4 +34,3 @@ ...@@ -34,4 +34,3 @@
padding:5px; padding:5px;
display: inline-block; display: inline-block;
} }
<p-messages [(value)]="disclaimer" [enableService]="false"></p-messages> <p-messages severity="info" [enableService]="false" *ngIf="!close">
<ng-template pTemplate>
<span class="p-message-icon pi pi-info-circle"></span>
<span class="p-message-summary">Disclaimer</span>
<span class="p-message-detail">This IPMWORKS Resource Toolbox is a repository for IPM resource developed by the EU IPMWORKS project (101000339). The cooperating partners have no economic responsibility whatsoever for losses due to using this service. In continuing to use the IPMWorks Resource Toolbox you agree to <a [ngStyle]="{color:'var(--surface-0)'}" href="#">Part 1</a> of the Toolbox Terms and Conditions.</span>
<button type="button" (click)="closeDisclaimer()" class="p-message-close p-link"><i class=" p-message-close-icon pi pi-times"></i></button>
</ng-template>
</p-messages>
<div class="grid pt-6 pl-6"> <div class="grid pt-6 pl-6">
<div class="col-3"> <div class="col-3">
<form #searchForm="ngForm" (ngSubmit)="searchResource()"> <form #searchForm="ngForm" (ngSubmit)="searchResource()">
...@@ -11,7 +19,7 @@ ...@@ -11,7 +19,7 @@
<p-dropdown autoWidth="false" [style]="{'width':'100%'}" placeholder="Select pest type" [options]="pestType" name="pestType"[(ngModel)]="searchModel.pestType" optionLabel="name" ></p-dropdown> <p-dropdown autoWidth="false" [style]="{'width':'100%'}" placeholder="Select pest type" [options]="pestType" name="pestType"[(ngModel)]="searchModel.pestType" optionLabel="name" ></p-dropdown>
</div>--> </div>-->
<p class="text-xl">Project</p> <p class="text-xl">Project</p>
<p-dropdown autoWidth="false" [style]="{'width':'100%'}" placeholder="Select projecte" [(ngModel)]="searchModel.project" [options]="projects" name="project" optionLabel="name" ></p-dropdown> <p-dropdown autoWidth="false" [style]="{'width':'100%'}" placeholder="Select project" [(ngModel)]="searchModel.project" [options]="projects" name="project" optionLabel="name" ></p-dropdown>
<p class="text-xl">Resource types</p> <p class="text-xl">Resource types</p>
<p-multiSelect placeholder="Select resource type" name="resourceType" [(ngModel)]="searchModel.resourceType" [options]="contentTypes" optionLabel="name"> <p-multiSelect placeholder="Select resource type" name="resourceType" [(ngModel)]="searchModel.resourceType" [options]="contentTypes" optionLabel="name">
</p-multiSelect> </p-multiSelect>
...@@ -67,13 +75,17 @@ ...@@ -67,13 +75,17 @@
<div class="pb-1 align-self-end"> <div class="pb-1 align-self-end">
<p-tag *ngIf="resource.resourceType" [rounded]=true value="{{resource.resourceType.name}}"> <p-tag *ngIf="resource.resourceType" [rounded]=true value="{{resource.resourceType.name}}">
</p-tag> </p-tag>
<p-avatar *ngIf="resource.external" shape="circle" icon="pi pi-external-link"></p-avatar>
</div> </div>
<div class="" routerLink="/resource/{{resource.idResource}}"> <div class="" routerLink="/resource/{{resource.idResource}}">
<img [defaultImage]="'assets/sectors/multi.jpg'" [useSrcset]="true" [lazyLoad]="imagePath+'/'+resource.idResource" class="imageSizeHome"/> <img [defaultImage]="'assets/sectors/multi.jpg'" [useSrcset]="true" [lazyLoad]="imagePath+'/'+resource.idResource" class="imageSizeHome"/>
<p class="text-center">{{resource.resourceName}}</p> <p class="text-center">{{resource.resourceName}}</p>
</div> </div>
<div class="align-self-center"> <div class="align-self-center">
<button pButton type="button" routerLink="/resource/{{resource.idResource}}" icon="pi pi-forward" class="p-button-outlined mr-4" pTooltip="See more..."></button> <a routerLink="/resource/{{resource.idResource}}" target="_blank" [style]="'text-decoration:unset'">
<button pButton type="button" icon="pi pi-forward" class="p-button-outlined mr-4" pTooltip="See more..."></button>
</a>
<!--<button pButton type="button" icon="pi pi-share-alt" class="p-button-outlined" pTooltip="Copy link for sharing" ngxClipboard [cbContent]="getPermLink(resource.idResource)" (click)=linkCopied(getPermLink(resource.idResource))></button>--> <!--<button pButton type="button" icon="pi pi-share-alt" class="p-button-outlined" pTooltip="Copy link for sharing" ngxClipboard [cbContent]="getPermLink(resource.idResource)" (click)=linkCopied(getPermLink(resource.idResource))></button>-->
</div> </div>
</div> </div>
......
...@@ -49,6 +49,7 @@ export class HomeComponent implements OnInit{ ...@@ -49,6 +49,7 @@ export class HomeComponent implements OnInit{
serachRunning= false; serachRunning= false;
searchTerm: string = ""; searchTerm: string = "";
more= false; more= false;
close = false;
imagePath = environment.baseUrl+"/resource/image"; imagePath = environment.baseUrl+"/resource/image";
imagePathRaw = environment.baseUrl+"/resource/image/raw"; imagePathRaw = environment.baseUrl+"/resource/image/raw";
searchModel:SearchModel = {}; searchModel:SearchModel = {};
...@@ -80,9 +81,10 @@ export class HomeComponent implements OnInit{ ...@@ -80,9 +81,10 @@ export class HomeComponent implements OnInit{
this.search = false; this.search = false;
this.serachRunning=false; this.serachRunning=false;
}); });
this.disclaimer = [{severity:"info", summary:"Disclaimer", detail:"This IPMWORKS Resource Toolbox is a repository for IPM resource developed by the EU IPMWORKS project (101000339). The cooperating partners have no economic responsibility whatsoever for losses due to using this service."}];
} }
public closeDisclaimer(){
this.close = true;
}
public toggleFilters(){ public toggleFilters(){
//kada se zatvore dodatni filteri isprazniti ako je nesto bilo selektovano u tim filterima //kada se zatvore dodatni filteri isprazniti ako je nesto bilo selektovano u tim filterima
this.more = !this.more; this.more = !this.more;
......
<div class="grid pt-6 pl-6 flex"> <div class="grid pt-6 pl-6 flex">
<div class="flex col-12 justify-content-center"> <div class="flex col-12 justify-content-center">
<p class="text-3xl">{{resource.resourceName}}</p> <p class="text-3xl">{{resource.resourceName}}
</p>
</div> </div>
<div class="col-6 flex flex-column"> <div class="col-6 flex flex-column">
<div class="col-12 text-center"> <div class="col-12 text-center">
......
...@@ -75,10 +75,10 @@ export class ResourceComponent implements OnInit { ...@@ -75,10 +75,10 @@ export class ResourceComponent implements OnInit {
accept: () => { accept: () => {
// @ts-ignore // @ts-ignore
this.resourceService.deleteResource(this.resourceId).subscribe(r =>{ this.resourceService.deleteResource(this.resourceId).subscribe(r =>{
this.messageService.add({severity:'success', detail:'Resource has been deletede.'}); this.messageService.add({severity:'success', detail:'Resource has been deleted.'});
this.router.navigate(['/home']) this.router.navigate(['/home'])
},error =>{ },error =>{
this.messageService.add({severity:'error', detail:'Some error occured!'}); this.messageService.add({severity:'error', detail:'Some error occurred!'});
} }
); );
} }
......
...@@ -25,6 +25,7 @@ export interface Resource { ...@@ -25,6 +25,7 @@ export interface Resource {
citation?:string; citation?:string;
creationDate?:Date; creationDate?:Date;
approved?:boolean; approved?:boolean;
external?:boolean;
} }
export class Crop{ export class Crop{
...@@ -68,6 +69,10 @@ export class Keyword{ ...@@ -68,6 +69,10 @@ export class Keyword{
public idKeyword!: string; public idKeyword!: string;
public name!: string; public name!: string;
} }
export class FileDesc{
public fileIdentifier?: string;
public description?: string;
}
export class PageableResource { export class PageableResource {
content?: Resource[] = []; content?: Resource[] = [];
empty?: boolean; empty?: boolean;
......
...@@ -14,7 +14,7 @@ import { ...@@ -14,7 +14,7 @@ import {
Keyword, Keyword,
Pest, Pest,
Crop, Crop,
PageableResource PageableResource, FileDesc
} from "../model/resource"; } from "../model/resource";
import {SearchModel} from "../model/search-model"; import {SearchModel} from "../model/search-model";
...@@ -46,12 +46,21 @@ export class ResourceService { ...@@ -46,12 +46,21 @@ export class ResourceService {
public deleteResource(id:string) { public deleteResource(id:string) {
return this._httpClient.get<Resource>(`${AppConfig.ApiPaths.deleteResource}`+"/"+id); return this._httpClient.get<Resource>(`${AppConfig.ApiPaths.deleteResource}`+"/"+id);
} }
public deleteFile(id:string) {
return this._httpClient.get<Resource>(`${AppConfig.ApiPaths.deleteFile}`+"/"+id);
}
public downloadFile(name: string) { public downloadFile(name: string) {
const httpOptions = { const httpOptions = {
responseType: 'blob' as 'json', responseType: 'blob' as 'json',
}; };
return this._httpClient.get<Resource>(`${AppConfig.ApiPaths.getFile}`+"/"+name, httpOptions); return this._httpClient.get<Resource>(`${AppConfig.ApiPaths.getFile}`+"/"+name, httpOptions);
} }
public downloadFileById(id: string) {
const httpOptions = {
responseType: 'blob' as 'json',
};
return this._httpClient.get<any>(`${AppConfig.ApiPaths.getFileById}`+"/"+id, httpOptions);
}
public saveResource(resource: Resource,edit:boolean) { public saveResource(resource: Resource,edit:boolean) {
resource.creationDate = new Date(); resource.creationDate = new Date();
if(!edit){ if(!edit){
...@@ -78,6 +87,21 @@ export class ResourceService { ...@@ -78,6 +87,21 @@ export class ResourceService {
}) })
return this._httpClient.post(`${AppConfig.ApiPaths.addFile}`+"/"+idResource,formData) return this._httpClient.post(`${AppConfig.ApiPaths.addFile}`+"/"+idResource,formData)
} }
public addFile(file:File,description:string, type:string){
const formData: FormData = new FormData();
if(file != undefined) {
formData.append("file", file);
}
if(description != undefined) {
formData.append("description", description);
}
if(type != undefined) {
formData.append("type", type);
}
return this._httpClient.post(`${AppConfig.ApiPaths.addHelpFile}`,formData)
}
public getAllSectors() { public getAllSectors() {
return this._httpClient.get<Sector[]>(`${AppConfig.ApiPaths.getAllSectors}`); return this._httpClient.get<Sector[]>(`${AppConfig.ApiPaths.getAllSectors}`);
} }
...@@ -103,4 +127,9 @@ export class ResourceService { ...@@ -103,4 +127,9 @@ export class ResourceService {
return this._httpClient.get<Keyword[]>(`${AppConfig.ApiPaths.getAllKeywords}`); return this._httpClient.get<Keyword[]>(`${AppConfig.ApiPaths.getAllKeywords}`);
} }
public getAllHelpFilesDesc() {
return this._httpClient.get<FileDesc[]>(`${AppConfig.ApiPaths.getAllHelpFilesDesc}`);
}
} }
...@@ -19,9 +19,6 @@ ...@@ -19,9 +19,6 @@
.p-menubar-root-list{ .p-menubar-root-list{
padding-left:120px !important; padding-left:120px !important;
} }
.p-button:not(.p-button-outlined){
background-color:#00662e !important;
}
.p-multiselect, .p-inputtext { .p-multiselect, .p-inputtext {
width: 100%; width: 100%;
} }
...@@ -54,6 +51,10 @@ ...@@ -54,6 +51,10 @@
.p-button.p-button-outlined{ .p-button.p-button-outlined{
color:#00662e !important; color:#00662e !important;
} }
.p-button:not(.p-button-outlined){
background-color:#00662e;
}
.p-grid { .p-grid {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
...@@ -86,3 +87,6 @@ ...@@ -86,3 +87,6 @@
.p-badge{ .p-badge{
font-size: 14px !important; font-size: 14px !important;
} }
.p-avatar{
background-color: white !important;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment