-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #392 from valor-software/development
hotfix: replaced http request with https
- Loading branch information
Showing
9 changed files
with
364 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,68 @@ | ||
import { Injectable, Inject } from '@angular/core'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import { Observable } from 'rxjs'; | ||
import { ARTICLES_LIST, ARTICLES_REFACTORED_TITLE_LIST } from "../tokens/articlesList.token"; | ||
import { IArticle } from "../models/article.interface"; | ||
import { ARTICLES_LIST, ARTICLES_REFACTORED_TITLE_LIST } from '../tokens/articlesList.token'; | ||
import { IArticle } from '../models/article.interface'; | ||
import { titleRefactoring } from '../utils/titleRefactoringUtil'; | ||
|
||
@Injectable({providedIn: 'platform'}) | ||
@Injectable({ providedIn: 'platform' }) | ||
export class GetArticlesService { | ||
private apiArray?: Observable<any>[]; | ||
private articlesList?: string[]; | ||
private articlesRefactoredTitlesList?: string[]; | ||
private refactoredArticleList?: string[]; | ||
private apiArray?: Observable<any>[]; | ||
private articlesList?: string[]; | ||
private articlesRefactoredTitlesList?: string[]; | ||
private refactoredArticleList?: string[]; | ||
|
||
constructor( | ||
private http: HttpClient, | ||
@Inject(ARTICLES_LIST) articlesList: string[], | ||
@Inject(ARTICLES_REFACTORED_TITLE_LIST) articlesRefactoredTitlesList: string[] | ||
){ | ||
this.articlesList = articlesList; | ||
this.articlesRefactoredTitlesList = articlesRefactoredTitlesList; | ||
this.apiArray = this.articlesRefactoredTitlesList.map((art) => { | ||
return this.getArticleRequest(art); | ||
}); | ||
} | ||
constructor( | ||
private http: HttpClient, | ||
@Inject(ARTICLES_LIST) articlesList: string[], | ||
@Inject(ARTICLES_REFACTORED_TITLE_LIST) articlesRefactoredTitlesList: string[] | ||
) { | ||
this.articlesList = articlesList; | ||
this.articlesRefactoredTitlesList = articlesRefactoredTitlesList; | ||
this.apiArray = this.articlesRefactoredTitlesList.map((art) => { | ||
return this.getArticleRequest(art); | ||
}); | ||
} | ||
|
||
getArticleRequest(art: string):Observable<IArticle> { | ||
return this.http.get(`assets/articles/${art}/${art}.json`) as Observable<IArticle>; | ||
} | ||
getArticleRequest(art: string): Observable<IArticle> { | ||
return this.http.get(`https://valor-software.com/assets/articles/${art}/${art}.json`) as Observable<IArticle>; | ||
} | ||
|
||
getPreviewArticle(): Observable<any>[] | undefined { | ||
return this.apiArray; | ||
} | ||
getPreviewArticle(): Observable<any>[] | undefined { | ||
return this.apiArray; | ||
} | ||
|
||
getFullListOfArticles(): Observable<any>[] | undefined { | ||
return this.apiArray; | ||
} | ||
getFullListOfArticles(): Observable<any>[] | undefined { | ||
return this.apiArray; | ||
} | ||
|
||
getArticlesByNames(value: string[]): Observable<any>[] | undefined { | ||
if (!this.articlesList?.length) { | ||
return; | ||
} | ||
getArticlesByNames(value: string[]): Observable<any>[] | undefined { | ||
if (!this.articlesList?.length) { | ||
return; | ||
} | ||
|
||
const articlesList = [...this.articlesList]; | ||
if (articlesList?.length) { | ||
return value.map(art => this.getArticleRequest(art)); | ||
} | ||
return; | ||
} | ||
const articlesList = [...this.articlesList]; | ||
if (articlesList?.length) { | ||
return value.map(art => this.getArticleRequest(art)); | ||
} | ||
return; | ||
} | ||
|
||
getRefactoredArticlesList(): string[] | undefined { | ||
return this.refactoredArticleList; | ||
} | ||
getRefactoredArticlesList(): string[] | undefined { | ||
return this.refactoredArticleList; | ||
} | ||
|
||
getRefactoredTitle(title: string): string { | ||
return titleRefactoring(title); | ||
} | ||
getRefactoredTitle(title: string): string { | ||
return titleRefactoring(title); | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
getHTMLSource(link?: string): Observable<any> | undefined { | ||
if (!link) { | ||
return; | ||
} | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
getHTMLSource(link?: string): Observable<any> | undefined { | ||
if (!link) { | ||
return; | ||
} | ||
|
||
return this.http.get(`assets/articles/${link}/${link}.html`, {responseType:'text'}); | ||
} | ||
return this.http.get(`https://valor-software.com/assets/articles/${link}/${link}.html`, { responseType: 'text' }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,64 @@ | ||
import { Inject, Injectable } from '@angular/core'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import { Observable } from 'rxjs'; | ||
import { IPortfolio } from "../models/portfolio.interface"; | ||
import { PORTFOLIO_LIST } from "../tokens/portfolioList.token"; | ||
import {titleRefactoring, checkHTMLExtension} from "../utils/titleRefactoringUtil"; | ||
import { IPortfolio } from '../models/portfolio.interface'; | ||
import { PORTFOLIO_LIST } from '../tokens/portfolioList.token'; | ||
import { titleRefactoring, checkHTMLExtension } from '../utils/titleRefactoringUtil'; | ||
|
||
|
||
@Injectable({providedIn: 'platform'}) | ||
@Injectable({ providedIn: 'platform' }) | ||
export class GetPortfolioService { | ||
private apiArray?: Observable<any>[]; | ||
private portfolioList?: string[]; | ||
private refactoredList?: string[]; | ||
private apiArray?: Observable<any>[]; | ||
private portfolioList?: string[]; | ||
private refactoredList?: string[]; | ||
|
||
constructor( | ||
private http: HttpClient, | ||
@Inject(PORTFOLIO_LIST) portfolioList: string[] | ||
){ | ||
this.portfolioList = portfolioList; | ||
if (!this.refactoredList?.length) { | ||
this.refactoredList = this.portfolioList.map(item => titleRefactoring(item)).reverse(); | ||
} | ||
constructor( | ||
private http: HttpClient, | ||
@Inject(PORTFOLIO_LIST) portfolioList: string[] | ||
) { | ||
this.portfolioList = portfolioList; | ||
if (!this.refactoredList?.length) { | ||
this.refactoredList = this.portfolioList.map(item => titleRefactoring(item)).reverse(); | ||
} | ||
|
||
this.apiArray = this.refactoredList.map(art => { | ||
return this.getPortfolioRequest(art); | ||
}).reverse(); | ||
} | ||
this.apiArray = this.refactoredList.map(art => { | ||
return this.getPortfolioRequest(art); | ||
}).reverse(); | ||
} | ||
|
||
getPortfolioRequest(art: string):Observable<any> { | ||
return this.http.get(`assets/portfolio/clients/${art}.json`); | ||
} | ||
getPortfolioRequest(art: string): Observable<any> { | ||
return this.http.get(`https://valor-software.com/assets/portfolio/clients/${art}.json`); | ||
} | ||
|
||
getFullListOfPortfolio(): Observable<IPortfolio>[] | undefined { | ||
return this.apiArray; | ||
} | ||
getFullListOfPortfolio(): Observable<IPortfolio>[] | undefined { | ||
return this.apiArray; | ||
} | ||
|
||
getProjectList(): string[] | undefined { | ||
return this.portfolioList; | ||
} | ||
getProjectList(): string[] | undefined { | ||
return this.portfolioList; | ||
} | ||
|
||
getRefactoredList(): string[] | undefined { | ||
return this.refactoredList; | ||
} | ||
getRefactoredList(): string[] | undefined { | ||
return this.refactoredList; | ||
} | ||
|
||
getTitleIndex(title: string): number | undefined { | ||
if (!this.refactoredList?.length) { | ||
return; | ||
} | ||
getTitleIndex(title: string): number | undefined { | ||
if (!this.refactoredList?.length) { | ||
return; | ||
} | ||
|
||
const refactoredList = [...this.refactoredList].reverse(); | ||
let index = refactoredList.findIndex(item => item === title || item === checkHTMLExtension(title)); | ||
const refactoredList = [...this.refactoredList].reverse(); | ||
let index = refactoredList.findIndex(item => item === title || item === checkHTMLExtension(title)); | ||
|
||
if (index || index === 0) { | ||
index = index + 1; | ||
return index; | ||
} | ||
if (index || index === 0) { | ||
index = index + 1; | ||
return index; | ||
} | ||
|
||
return; | ||
} | ||
return; | ||
} | ||
|
||
getRefactoredTitle(title: string): string { | ||
return titleRefactoring(title); | ||
} | ||
getRefactoredTitle(title: string): string { | ||
return titleRefactoring(title); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.