Skip to content
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
1 change: 1 addition & 0 deletions projects/core/src/lib/providers/api-url.provide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
import { InjectionToken } from "@angular/core";

export const API_URL = new InjectionToken<string>("API_URL");
export const SKILLS_API_URL = new InjectionToken<string>("SKILLS_API_URL");
1 change: 1 addition & 0 deletions projects/core/src/lib/services/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @format */

export * from "./api.service";
export * from "./skillsApi.service";
export * from "./subscription-plans.service";
export * from "./token.service";
export * from "./yt-extract.service";
Expand Down
13 changes: 13 additions & 0 deletions projects/core/src/lib/services/skillsApi.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/** @format */

import { Inject, Injectable } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { ApiService } from "./api.service";
import { SKILLS_API_URL } from "@corelib";

@Injectable({ providedIn: "root" })
export class SkillsApiService extends ApiService {
constructor(http: HttpClient, @Inject(SKILLS_API_URL) apiUrl: string) {
super(http, apiUrl);
}
}
9 changes: 8 additions & 1 deletion projects/skills/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import { ApplicationConfig } from "@angular/core";
import { provideRouter } from "@angular/router";
import { routes } from "./app.routes";
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from "@angular/common/http";
import { API_URL, BearerTokenInterceptor, CamelcaseInterceptor, PRODUCTION } from "@corelib";
import {
API_URL,
BearerTokenInterceptor,
CamelcaseInterceptor,
PRODUCTION,
SKILLS_API_URL,
} from "@corelib";
import { environment } from "../environments/environment";

export const appConfig: ApplicationConfig = {
Expand All @@ -13,6 +19,7 @@ export const appConfig: ApplicationConfig = {
{ provide: HTTP_INTERCEPTORS, multi: true, useClass: BearerTokenInterceptor },
{ provide: HTTP_INTERCEPTORS, multi: true, useClass: CamelcaseInterceptor },
{ provide: API_URL, useValue: environment.apiUrl },
{ provide: SKILLS_API_URL, useValue: environment.skillsApiUrl },
{ provide: PRODUCTION, useValue: environment.production },
provideHttpClient(withInterceptorsFromDi()),
],
Expand Down
4 changes: 2 additions & 2 deletions projects/skills/src/app/profile/services/profile.service.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/** @format */

import { inject, Injectable } from "@angular/core";
import { ApiService, SubscriptionData } from "@corelib";
import { SkillsApiService, SubscriptionData } from "@corelib";
import { Profile, UserData } from "../../../models/profile.model";

@Injectable({
providedIn: "root",
})
export class ProfileService {
apiService = inject(ApiService);
apiService = inject(SkillsApiService);

getProfile() {
return this.apiService.get<Profile>("/progress/profile/");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

&__name {
color: var(--black);
text-decoration: underline;

@include typography.heading-4;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

&__name {
color: var(--black);
text-decoration: underline;

@include typography.heading-4;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
flex-direction: column;
align-items: center;
justify-content: space-between;
min-height: 365px;
padding: 20px;
background-color: var(--white);
border: 1px solid var(--grey-button);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.skills {
&__main {
position: relative;
min-height: 345px;
min-height: 365px;
padding: 20px;
margin-bottom: 18px;
background-color: var(--white);
Expand Down
4 changes: 2 additions & 2 deletions projects/skills/src/app/rating/services/rating.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @format */

import { inject, Injectable } from "@angular/core";
import { ApiService } from "@corelib";
import { SkillsApiService } from "@corelib";
import { GeneralRating } from "../../../models/rating.model";
import { map } from "rxjs";
import { ApiPagination } from "../../../models/api-pagination.model";
Expand All @@ -10,7 +10,7 @@ import { ApiPagination } from "../../../models/api-pagination.model";
providedIn: "root",
})
export class RatingService {
apiService = inject(ApiService);
apiService = inject(SkillsApiService);

getGeneralRating(
ratingParam: "last_year" | "last_month" | "last_day" | "last_week" = "last_month"
Expand Down
4 changes: 2 additions & 2 deletions projects/skills/src/app/skills/services/skill.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @format */

import { inject, Injectable } from "@angular/core";
import { ApiService } from "@corelib";
import { SkillsApiService } from "@corelib";
import { ApiPagination } from "../../../models/api-pagination.model";
import { Skill, TasksResponse } from "../../../models/skill.model";
import { HttpParams } from "@angular/common/http";
Expand All @@ -10,7 +10,7 @@ import { HttpParams } from "@angular/common/http";
providedIn: "root",
})
export class SkillService {
apiService = inject(ApiService);
apiService = inject(SkillsApiService);
private skillId: number | null = null;
private storageKey = "skillId";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/** @format */

import { Injectable, inject } from "@angular/core";
import { ApiService, SubscriptionPlan } from "@corelib";
import { SkillsApiService, SubscriptionPlan } from "@corelib";

@Injectable({
providedIn: "root",
})
export class SubscriptionService {
apiService = inject(ApiService);
apiService = inject(SkillsApiService);

getSubscriptions() {
return this.apiService.get<SubscriptionPlan[]>("/subscription/");
Expand Down
4 changes: 2 additions & 2 deletions projects/skills/src/app/task/services/task.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @format */

import { inject, Injectable, signal } from "@angular/core";
import { ApiService } from "@corelib";
import { SkillsApiService } from "@corelib";
import { TaskResults, TaskStep, TaskStepsResponse } from "../../../models/skill.model";
import { Observable, tap } from "rxjs";
import { StepType } from "../../../models/step.model";
Expand All @@ -10,7 +10,7 @@ import { StepType } from "../../../models/step.model";
providedIn: "root",
})
export class TaskService {
private apiService = inject(ApiService);
private apiService = inject(SkillsApiService);

currentSteps = signal<TaskStepsResponse["stepData"]>([]);
currentTaskDone = signal(false);
Expand Down
14 changes: 4 additions & 10 deletions projects/skills/src/app/trajectories/trajectories.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,15 @@

import { HttpParams } from "@angular/common/http";
import { Injectable } from "@angular/core";
import { ApiService } from "@corelib";
import { plainToInstance } from "class-transformer";
import { BehaviorSubject, catchError, map, Observable, of } from "rxjs";
import {
Student,
Trajectory,
TrajectorySkills,
UserTrajectory,
} from "../../models/trajectory.model";
import { SkillsApiService } from "@corelib";
import { catchError, map, of } from "rxjs";
import { Student, Trajectory, UserTrajectory } from "../../models/trajectory.model";

@Injectable({
providedIn: "root",
})
export class TrajectoriesService {
constructor(private readonly apiService: ApiService) {}
constructor(private readonly apiService: SkillsApiService) {}

getTrajectories(limit: number, offset: number) {
const params = new HttpParams();
Expand Down
4 changes: 2 additions & 2 deletions projects/skills/src/app/webinars/services/webinar.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { HttpParams } from "@angular/common/http";
import { Injectable } from "@angular/core";
import { ApiService } from "@corelib";
import { SkillsApiService } from "@corelib";
import { plainToInstance } from "class-transformer";
import { Webinar } from "projects/skills/src/models/webinars.model";
import { map, Observable } from "rxjs";
Expand All @@ -11,7 +11,7 @@ import { map, Observable } from "rxjs";
providedIn: "root",
})
export class WebinarService {
constructor(private readonly apiService: ApiService) {}
constructor(private readonly apiService: SkillsApiService) {}

getActualWebinars(limit: number, offset: number): Observable<Webinar[]> {
const params = new HttpParams();
Expand Down
3 changes: 2 additions & 1 deletion projects/skills/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

export const environment = {
production: true,
apiUrl: "https://api.skills.procollab.ru",
apiUrl: "https://api.procollab.ru",
skillsApiUrl: "https://api.skills.procollab.ru",
};
3 changes: 2 additions & 1 deletion projects/skills/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

export const environment = {
production: false,
apiUrl: "https://skills.dev.procollab.ru",
apiUrl: "https://dev.procollab.ru",
skillsApiUrl: "https://skills.dev.procollab.ru",
};
12 changes: 11 additions & 1 deletion projects/social_platform/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ import { GlobalErrorHandlerService } from "@error/services/global-error-handler.
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from "@angular/common/http";
import { provideRouter } from "@angular/router";
import { APP_ROUTES } from "./app.routes";
import { API_URL, BearerTokenInterceptor, CamelcaseInterceptor, PRODUCTION } from "@corelib";
import {
API_URL,
BearerTokenInterceptor,
CamelcaseInterceptor,
PRODUCTION,
SKILLS_API_URL,
} from "@corelib";
import { environment } from "@environment";
import { registerLocaleData } from "@angular/common";
import localeRu from "@angular/common/locales/ru";
Expand Down Expand Up @@ -40,6 +46,10 @@ export const APP_CONFIG: ApplicationConfig = {
provide: API_URL,
useValue: environment.apiUrl,
},
{
provide: SKILLS_API_URL,
useValue: environment.skillsApiUrl,
},
{ provide: PRODUCTION, useValue: environment.production },
{
provide: ErrorHandler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { ProfileService } from "@auth/services/profile.service";
import { ModalComponent } from "@ui/components/modal/modal.component";
import { AvatarComponent } from "../../../../ui/components/avatar/avatar.component";
import { Skill } from "@office/models/skill";
import { ProfileService as SkillsProfileService } from "projects/skills/src/app/profile/services/profile.service";

@Component({
selector: "app-profile-main",
Expand Down Expand Up @@ -70,6 +71,7 @@ export class ProfileMainComponent implements OnInit, AfterViewInit, OnDestroy {
private readonly authService: AuthService,
private readonly profileNewsService: ProfileNewsService,
private readonly profileApproveSkillService: ProfileService,
private readonly profileSkillsService: SkillsProfileService,
private readonly cdRef: ChangeDetectorRef
) {}

Expand All @@ -79,6 +81,8 @@ export class ProfileMainComponent implements OnInit, AfterViewInit, OnDestroy {
loggedUserId: Observable<number> = this.authService.profile.pipe(map(user => user.id));

ngOnInit(): void {
this.profileSkillsService.getSubscriptionData().subscribe(r => console.log(r));

const route$ = this.route.params
.pipe(
map(r => r["id"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const environment = {
production: true,
sentryDns: "https://fc61f416df6044bab8c7e1afd55f4355@o1186023.ingest.sentry.io/6577563",
apiUrl: "https://api.procollab.ru",
skillsApiUrl: "https://api.skills.procollab.ru",
// websockets
websocketUrl: "wss://api.procollab.ru/ws",
websocketReconnectionInterval: 5000,
Expand Down
1 change: 1 addition & 0 deletions projects/social_platform/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const environment = {
production: false,
sentryDns: "https://fc61f416df6044bab8c7e1afd55f4355@o1186023.ingest.sentry.io/6577563",
apiUrl: "https://dev.procollab.ru", // TODO: change it before merge
skillsApiUrl: "https://skills.dev.procollab.ru",
// websockets
websocketUrl: "wss://dev.procollab.ru/ws", // TODO: change it before merge
websocketReconnectionInterval: 500,
Expand Down
Loading