From f079122f182972f62fab1ebc7d51f375c6970ee8 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 6 Jun 2019 10:51:39 +0000 Subject: [PATCH] 1. Add at tinyUrl at properties.ts. 2. Renamed curatorPhotoService to utilitiesService. 3. Add a isTiny function on HelperFunctions. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@56013 d315682c-612b-4755-9ff5-7f18f6832af3 --- services/{curatorPhoto.service.ts => utilities.service.ts} | 6 +++++- utils/HelperFunctions.class.ts | 6 +++++- utils/properties/env-properties.ts | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) rename services/{curatorPhoto.service.ts => utilities.service.ts} (82%) diff --git a/services/curatorPhoto.service.ts b/services/utilities.service.ts similarity index 82% rename from services/curatorPhoto.service.ts rename to services/utilities.service.ts index 6197dc82..606a56b1 100644 --- a/services/curatorPhoto.service.ts +++ b/services/utilities.service.ts @@ -4,7 +4,7 @@ import {CustomOptions} from './servicesUtils/customOptions.class'; import {HttpClient} from '@angular/common/http'; @Injectable() -export class CuratorPhotoService { +export class UtilitiesService { constructor(private http: HttpClient) { } @@ -18,4 +18,8 @@ export class CuratorPhotoService { return this.http.delete(url, CustomOptions.getAuthOptions()); } + getTiny(url: string) { + return this.http.get(url, {responseType: 'text'}); + } + } diff --git a/utils/HelperFunctions.class.ts b/utils/HelperFunctions.class.ts index b4a76069..9ebcb542 100644 --- a/utils/HelperFunctions.class.ts +++ b/utils/HelperFunctions.class.ts @@ -8,4 +8,8 @@ export class HelperFunctions { window.scrollTo(0, 0); } } -} \ No newline at end of file + + public static isTiny(url: string) { + return (url.indexOf('tinyurl.com') !== -1); + } +} diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts index 6678e3c7..317c6c2f 100644 --- a/utils/properties/env-properties.ts +++ b/utils/properties/env-properties.ts @@ -58,6 +58,7 @@ export class EnvProperties { uploadService; downloadUrl; deleteUrl; + tinyUrl; vocabulariesAPI;