dodavanje fajlova

parent d4608873
......@@ -5993,6 +5993,23 @@
"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": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/nice-napi/-/nice-napi-1.0.2.tgz",
......
......@@ -43,12 +43,18 @@ export class HeaderMenuComponent implements OnInit,OnDestroy{
visible:this.isUserAdmin()
},
{
label: 'IPMWORKS',
label: 'IPMWORKS Project',
url:'http://ipmworks.net',
styleClass:"pr-2",
target:"_blank"
},
{
label: 'Help and Support',
routerLink:'/help',
styleClass:"pr-2",
target:"_blank"
},
{
label: 'Logout',
command:(event) => {this.logout()},
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 @@
padding:5px;
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="col-3">
<form #searchForm="ngForm" (ngSubmit)="searchResource()">
......@@ -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>
</div>-->
<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-multiSelect placeholder="Select resource type" name="resourceType" [(ngModel)]="searchModel.resourceType" [options]="contentTypes" optionLabel="name">
</p-multiSelect>
......@@ -67,13 +75,17 @@
<div class="pb-1 align-self-end">
<p-tag *ngIf="resource.resourceType" [rounded]=true value="{{resource.resourceType.name}}">
</p-tag>
<p-avatar *ngIf="resource.external" shape="circle" icon="pi pi-external-link"></p-avatar>
</div>
<div class="" routerLink="/resource/{{resource.idResource}}">
<img [defaultImage]="'assets/sectors/multi.jpg'" [useSrcset]="true" [lazyLoad]="imagePath+'/'+resource.idResource" class="imageSizeHome"/>
<p class="text-center">{{resource.resourceName}}</p>
</div>
<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>-->
</div>
</div>
......
......@@ -49,6 +49,7 @@ export class HomeComponent implements OnInit{
serachRunning= false;
searchTerm: string = "";
more= false;
close = false;
imagePath = environment.baseUrl+"/resource/image";
imagePathRaw = environment.baseUrl+"/resource/image/raw";
searchModel:SearchModel = {};
......@@ -80,9 +81,10 @@ export class HomeComponent implements OnInit{
this.search = 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(){
//kada se zatvore dodatni filteri isprazniti ako je nesto bilo selektovano u tim filterima
this.more = !this.more;
......
<div class="grid pt-6 pl-6 flex">
<div class="flex col-12 justify-content-center">
<p class="text-3xl">{{resource.resourceName}}</p>
<p class="text-3xl">{{resource.resourceName}}
</p>
</div>
<div class="col-6 flex flex-column">
<div class="col-12 text-center">
......
......@@ -75,10 +75,10 @@ export class ResourceComponent implements OnInit {
accept: () => {
// @ts-ignore
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'])
},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 {
citation?:string;
creationDate?:Date;
approved?:boolean;
external?:boolean;
}
export class Crop{
......@@ -68,6 +69,10 @@ export class Keyword{
public idKeyword!: string;
public name!: string;
}
export class FileDesc{
public fileIdentifier?: string;
public description?: string;
}
export class PageableResource {
content?: Resource[] = [];
empty?: boolean;
......
......@@ -14,7 +14,7 @@ import {
Keyword,
Pest,
Crop,
PageableResource
PageableResource, FileDesc
} from "../model/resource";
import {SearchModel} from "../model/search-model";
......@@ -46,12 +46,21 @@ export class ResourceService {
public deleteResource(id:string) {
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) {
const httpOptions = {
responseType: 'blob' as 'json',
};
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) {
resource.creationDate = new Date();
if(!edit){
......@@ -78,6 +87,21 @@ export class ResourceService {
})
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() {
return this._httpClient.get<Sector[]>(`${AppConfig.ApiPaths.getAllSectors}`);
}
......@@ -103,4 +127,9 @@ export class ResourceService {
return this._httpClient.get<Keyword[]>(`${AppConfig.ApiPaths.getAllKeywords}`);
}
public getAllHelpFilesDesc() {
return this._httpClient.get<FileDesc[]>(`${AppConfig.ApiPaths.getAllHelpFilesDesc}`);
}
}
......@@ -19,9 +19,6 @@
.p-menubar-root-list{
padding-left:120px !important;
}
.p-button:not(.p-button-outlined){
background-color:#00662e !important;
}
.p-multiselect, .p-inputtext {
width: 100%;
}
......@@ -54,6 +51,10 @@
.p-button.p-button-outlined{
color:#00662e !important;
}
.p-button:not(.p-button-outlined){
background-color:#00662e;
}
.p-grid {
display: flex;
flex-wrap: wrap;
......@@ -86,3 +87,6 @@
.p-badge{
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