Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: replaced http request with https #391

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import { IPortfolio } from "../../models/portfolio.interface";
template:`
<div class="article-item">
<div class="img-container-auto zoom-img-scale">
<img class="w-full h-full object-cover" [src]="article ? article.bgImg : project?.previewImg" [alt]="article ? article.title : project?.name + 'img'">
<img
class="w-full h-full object-cover"
[src]="article ? article.bgImg : project?.previewImg"
[alt]="article ? article.title : project?.name + 'img'">
</div>
<div class="text-container">
<p>{{article ? article.title : project?.name}}</p>
Expand Down
102 changes: 51 additions & 51 deletions libs/common-docs/src/services/getArticles.service.ts
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' });
}
}
92 changes: 46 additions & 46 deletions libs/common-docs/src/services/getPortfolio.service.ts
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);
}
}
12 changes: 9 additions & 3 deletions libs/route-pages/blog-portfolio/src/article.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,22 @@
<ng-template #authorImageTemplate>
<div class="w-70 h-70 rounded-full overflow-hidden mb-4"
*ngIf="article.authorImg && !article.secondAuthorImg">
<img class="w-full h-full object-cover" [src]="article.authorImg" [alt]="article.author">
<img class="w-full h-full object-cover"
[src]="'https://valor-software.com/' + article.authorImg"
[alt]="article.author">
</div>

<div class="flex justify-center" *ngIf="article.authorImg && article.secondAuthorImg">
<div class="w-70 h-70 rounded-full overflow-hidden mb-4 mr-8">
<img class="w-full h-full object-cover" [src]="article.authorImg" [alt]="article.author">
<img class="w-full h-full object-cover"
[src]="'https://valor-software.com/' + article.authorImg"
[alt]="article.author">
</div>

<div class="w-70 h-70 rounded-full overflow-hidden mb-4">
<img class="w-full h-full object-cover" [src]="article.secondAuthorImg" [alt]="article.secondAuthor">
<img class="w-full h-full object-cover"
[src]="'https://valor-software.com/' + article.secondAuthorImg"
[alt]="article.secondAuthor">
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from "@angular/router";
import { routes } from './routes';
import { GeneralPageComponent } from "./genral-page.component";
import { GeneralPageComponent } from "./general-page.component";
import { CommonDocsModule } from "@valor-software/common-docs";
import { BlogComponent } from "./blog.component";
import { ProjectsBlockComponent } from "./projects-block.component";
Expand Down
Loading