Skip to content

Commit

Permalink
Merge branch 'dev' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz committed Jul 3, 2023
2 parents fb09679 + ff010f1 commit e485252
Show file tree
Hide file tree
Showing 14 changed files with 652 additions and 461 deletions.
54 changes: 50 additions & 4 deletions src/app/api-connector/news.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@ export class NewsService {
);
}

getTestimonial(project_application_id: string): Observable<any> {
const params: HttpParams = new HttpParams().set('project_application_id', project_application_id);

return this.http.get<any>(`${ApiSettings.getApiBaseURL()}wagtail-management/testimonial/`, {
params,
withCredentials: true,
});
}

uploadImageTest(formData: FormData): Observable<any> {
return this.http.post<any>(`${ApiSettings.getApiBaseURL()}wagtail-management/imagetest/`, formData, {
withCredentials: true,
});
}

sendTestimonialDraft(
title: string,
text: string,
Expand All @@ -95,6 +110,34 @@ export class NewsService {
simple_vm: boolean,
image_url: string,
project_application_id: string,
file: File,
): Observable<any> {
const formData: FormData = new FormData();
formData.append('file', file);
formData.append('title', title);
formData.append('text', text);
formData.append('excerpt', excerpt);
formData.append('contributor', contributor);
formData.append('institution', institution);
formData.append('workgroup', workgroup);
formData.append('simple_vm', JSON.stringify(simple_vm));
formData.append('project_application_id', project_application_id);
console.log(formData);

return this.http.post<any>(`${ApiSettings.getApiBaseURL()}wagtail-management/testimonial/`, formData, {
withCredentials: true,
});
}

autoSaveTestimonialDraft(
title: string,
text: string,
excerpt: string,
contributor: string,
institution: string,
workgroup: string,
simple_vm: boolean,
project_application_id: string,
): Observable<any> {
const testimonialData: any = {
title,
Expand All @@ -104,13 +147,16 @@ export class NewsService {
institution,
workgroup,
simple_vm,
image_url,
project_application_id,
};

return this.http.post<any>(`${ApiSettings.getApiBaseURL()}wagtail-management/testimonial/`, testimonialData, {
withCredentials: true,
});
return this.http.post<any>(
`${ApiSettings.getApiBaseURL()}wagtail-management/testimonial/autosave/`,
testimonialData,
{
withCredentials: true,
},
);
}

private handleError<T>(result?: T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export class Application {
project_application_member_applications: ProjectMemberApplication[];
project_application_manager_comment: string;
project_application_testimonial_submitted: boolean;
project_application_testimonial_draft_id: number;

migrated_simple_vm_resources: boolean = false;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div *ngIf="doiQuestionModal">
<div>
<div class="modal-header">
<h4 class="modal-title">Publications</h4>
<h4 class="modal-title">Experiences and publications</h4>
<button
type="button"
class="close"
Expand All @@ -13,49 +13,21 @@ <h4 class="modal-title">Publications</h4>
</button>
</div>
<div class="modal-body">
<div>
<p>
<strong
>Do you have any new publications that were made during your work with the de.NBI Cloud or in which the de.NBI
Cloud is mentioned?</strong
>
</p>
<div class="text-black-50 p-4">
We are very pleased that the de.NBI Cloud meets with your expectations and that you would like to extend your
project. As an academic cloud that provides its resources free of charge, we depend on our users.
<hr />
In order to be able to continue to offer these services free of charge in the future, it is essential for us, for
example, to publish publications which resulted from the work in the de.NBI Cloud or are in any way connected to
it. Please enter the DOIs of those publications in the form below.
<hr />
We also want to promote the use of the cloud with positive experiences from users and the community in order to
make this service available to many more researchers. For this reason, we rely on testimonials from our users,
which we can use for this purpose. To submit a testimonial, please use the form below on this project overview
page. You can find an overview of already published testimonials <a href="{{ TESTIMONIAL_PAGE_LINK }}">here. </a>
<hr />
We really appreciate your help!
</div>
<div class="modal-footer">
<div class="row" style="margin: auto">
<div class="col-6">
<button id="new_dois_btn" class="btn btn-success" type="button" (click)="setDoiModalState()">Yes</button>
</div>
<div class="col-6">
<button
id="no_new_dois_btn"
class="btn btn-primary"
type="reset"
data-test-id="decline_publication_button"
(click)="bsModalRef.hide()"
>
No
</button>
</div>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>

<div *ngIf="doiModal">
<div class="modal-header">
<h4 class="modal-title">Digital object identifier (DOI)</h4>
<button
type="button"
class="close"
style="cursor: pointer"
(click)="bsModalRef.hide()"
data-dismiss="modal"
aria-label="Close"
>
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="alert alert-primary">
Expand Down Expand Up @@ -118,18 +90,21 @@ <h4 class="modal-title">Digital object identifier (DOI)</h4>
</tbody>
</table>
</div>

<div class="modal-footer" style="text-align: center">
<button
id="doi_continue_btn"
class="btn btn-success col-md-6"
type="button"
style="margin: auto"
(click)="bsModalRef.hide()"
>
Continue
</button>
</div>
<div class="modal-footer">
<div class="row" style="margin: auto">
<div class="col-md-auto mx-auto">
<button
id="close_testimonial_information_button"
class="btn btn-primary"
type="reset"
data-test-id="close_testimonial_information_button"
(click)="bsModalRef.hide()"
>
Continue
</button>
</div>
</div>
</div>
<!-- /.modal-content -->L
<!-- /.modal-content -->
</div>
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import {
Component, EventEmitter, OnDestroy,
} from '@angular/core';
import { Component, EventEmitter, OnDestroy } from '@angular/core';
import { BsModalRef } from 'ngx-bootstrap/modal';
import { Subscription } from 'rxjs';
import { WIKI_PUBLICATIONS } from '../../../../links/links';
import { TESTIMONIAL_PAGE_LINK, WIKI_PUBLICATIONS } from '../../../../links/links';
import { Doi } from '../../../applications/doi/doi';
import { GroupService } from '../../../api-connector/group.service';

@Component({
selector: 'app-doi',
templateUrl: './doi.component.html',
styleUrls: ['./doi.component.scss'],
selector: 'app-extension-entry',
templateUrl: './extension-entry.component.html',
styleUrls: ['./extension-entry.component.scss'],
providers: [GroupService],
})
export class DoiComponent implements OnDestroy {
export class ExtensionEntryComponent implements OnDestroy {
private subscription: Subscription = new Subscription();
public event: EventEmitter<any> = new EventEmitter();
TESTIMONIAL_PAGE_LINK = TESTIMONIAL_PAGE_LINK;

WIKI_PUBLICATIONS: string = WIKI_PUBLICATIONS;

Expand All @@ -23,22 +24,13 @@ export class DoiComponent implements OnDestroy {
application_id: string | number;
disableInput: boolean = false;

doiQuestionModal: boolean = true;
doiModal: boolean = false;

private subscription: Subscription = new Subscription();
public event: EventEmitter<any> = new EventEmitter();

constructor(
public bsModalRef: BsModalRef,
private groupService: GroupService,
) {
constructor(public bsModalRef: BsModalRef, private groupService: GroupService) {
// eslint-disable-next-line no-empty-function
}

ngOnDestroy() {
ngOnDestroy(): void {
this.subscription.unsubscribe();
this.event.emit({ reloadDoi: false });
this.event.emit({ reloadDoi: false, showExtension: true });
}

isNewDoi(): boolean {
Expand Down Expand Up @@ -91,10 +83,4 @@ export class DoiComponent implements OnDestroy {
}),
);
}

setDoiModalState(): void {
this.doiQuestionModal = false;
this.doiModal = true;
}

}

This file was deleted.

Empty file.

This file was deleted.

Loading

0 comments on commit e485252

Please sign in to comment.