diff --git a/src/app/info/info-routes.ts b/src/app/info/info-routes.ts index e377441d885..4b7decb49c5 100644 --- a/src/app/info/info-routes.ts +++ b/src/app/info/info-routes.ts @@ -1,7 +1,3 @@ -// UMD Customization -/* eslint-disable import-newlines/enforce */ -/* eslint-disable simple-import-sort/imports */ -// End Customization import { Route, Routes, @@ -24,17 +20,13 @@ import { } from './info-routing-paths'; import { NotifyInfoComponent } from './notify-info/notify-info.component'; import { ThemedPrivacyComponent } from './privacy/themed-privacy.component'; -// UMD Customization -import { WufooFeedbackResolver } from '../wufoo/wufoo-feedback-resolver'; -// End UMD Customization + export const ROUTES: Routes = [ { path: FEEDBACK_PATH, component: ThemedFeedbackComponent, - // UMD Customization - resolve: { breadcrumb: i18nBreadcrumbResolver, wufoo: WufooFeedbackResolver }, - // End UMD Customization + resolve: { breadcrumb: i18nBreadcrumbResolver }, data: { title: 'info.feedback.title', breadcrumbKey: 'info.feedback' }, canActivate: [feedbackGuard], }, diff --git a/src/app/wufoo/wufoo-feedback-resolver.ts b/src/app/wufoo/wufoo-feedback-resolver.ts deleted file mode 100644 index 58f5c368cc1..00000000000 --- a/src/app/wufoo/wufoo-feedback-resolver.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { HttpClient } from '@angular/common/http'; -import { - Inject, - Injectable, -} from '@angular/core'; -import { Resolve } from '@angular/router'; -import { - combineLatest, - map, - mergeMap, - Observable, - take, -} from 'rxjs'; - -import { RouteService } from '../core/services/route.service'; -import { - NativeWindowRef, - NativeWindowService, -} from '../core/services/window.service'; -import { HALEndpointService } from '../core/shared/hal-endpoint.service'; -import { URLCombiner } from '../core/url-combiner/url-combiner'; -import { WufooFeedbackResponse } from './wufoo-feedback-response.model'; - -/** - * Retrieves the Wufoo feedback form URL (populated with default form values) - * from the back-end and and redirects the browser to the Wufoo feedback form. - */ -@Injectable({ - providedIn: 'root', -}) -export class WufooFeedbackResolver implements Resolve { - constructor( - @Inject(NativeWindowService) protected _window: NativeWindowRef, - private routeService: RouteService, - private httpClient: HttpClient, - private halService: HALEndpointService, - ) { - } - - /** - * Retrieves the Wufoo feedback form URL (populated with default form values) - * from the back-end and and redirects the browser to the Wufoo feedback form. - */ - resolve(): void { - const referringUrl$: Observable = this.routeService.getCurrentUrl().pipe( - take(1), - map((urlPath: string): string => { return (urlPath ? urlPath : '/'); }), - map((urlPath: string): string => { - return new URLCombiner(this._window.nativeWindow.origin, urlPath).toString(); - }), - ); - - const wufooFeedbackEndpoint$: Observable = this.halService.getEndpoint('wufoo-feedback'); - - const wufooFeedbackResponse$ = combineLatest([referringUrl$, wufooFeedbackEndpoint$]).pipe( - mergeMap(([referringPageUrl, wufooFeedbackUrl]): Observable => { - return this.httpClient.get(wufooFeedbackUrl, { params: { 'page': referringPageUrl } }); - }), - ); - - wufooFeedbackResponse$.subscribe((obj) => { - const wufooFeedbackResponse = obj; - const redirectUrl = wufooFeedbackResponse.wufooFeedbackFormUrl; - - if (redirectUrl) { - // If we have a redirectUrl, send the browser to it. - window.location.href = redirectUrl; - } - }); - } -} diff --git a/src/app/wufoo/wufoo-feedback-response.model.ts b/src/app/wufoo/wufoo-feedback-response.model.ts deleted file mode 100644 index a8f0253e3e2..00000000000 --- a/src/app/wufoo/wufoo-feedback-response.model.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Interface for processing the Wufoo feedback response - */ -export interface WufooFeedbackResponse { - wufooFeedbackFormUrl: string; -} diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 62dc844ecda..6bfe968655c 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -7192,8 +7192,6 @@ "home.top-level-communities.head": "Communities in DRUM", - "info.feedback.info": "Thanks for sharing your feedback about DRUM. Your comments are appreciated!", - "item.page.advisor": "Advisor", "item.page.citation.datasetOrSoftware": "Related Publication Citation", diff --git a/src/themes/drum/app/footer/footer.component.html b/src/themes/drum/app/footer/footer.component.html index 7534733e77f..d15c951e772 100644 --- a/src/themes/drum/app/footer/footer.component.html +++ b/src/themes/drum/app/footer/footer.component.html @@ -40,7 +40,7 @@