diff --git a/projects/core/src/lib/providers/api-url.provide.ts b/projects/core/src/lib/providers/api-url.provide.ts index d2610e4cd..8b19bd0dd 100644 --- a/projects/core/src/lib/providers/api-url.provide.ts +++ b/projects/core/src/lib/providers/api-url.provide.ts @@ -2,3 +2,4 @@ import { InjectionToken } from "@angular/core"; export const API_URL = new InjectionToken("API_URL"); +export const SKILLS_API_URL = new InjectionToken("SKILLS_API_URL"); diff --git a/projects/core/src/lib/services/index.ts b/projects/core/src/lib/services/index.ts index 48fda4442..538be53ff 100644 --- a/projects/core/src/lib/services/index.ts +++ b/projects/core/src/lib/services/index.ts @@ -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"; diff --git a/projects/core/src/lib/services/skillsApi.service.ts b/projects/core/src/lib/services/skillsApi.service.ts new file mode 100644 index 000000000..99990915a --- /dev/null +++ b/projects/core/src/lib/services/skillsApi.service.ts @@ -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); + } +} diff --git a/projects/skills/src/app/app.config.ts b/projects/skills/src/app/app.config.ts index 330ea793b..a44bef102 100644 --- a/projects/skills/src/app/app.config.ts +++ b/projects/skills/src/app/app.config.ts @@ -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 = { @@ -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()), ], diff --git a/projects/skills/src/app/profile/services/profile.service.ts b/projects/skills/src/app/profile/services/profile.service.ts index 1b8a98406..17681d265 100644 --- a/projects/skills/src/app/profile/services/profile.service.ts +++ b/projects/skills/src/app/profile/services/profile.service.ts @@ -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("/progress/profile/"); diff --git a/projects/skills/src/app/profile/shared/personal-rating-card/personal-rating-card.component.scss b/projects/skills/src/app/profile/shared/personal-rating-card/personal-rating-card.component.scss index 93d17a16e..8ffe36b80 100644 --- a/projects/skills/src/app/profile/shared/personal-rating-card/personal-rating-card.component.scss +++ b/projects/skills/src/app/profile/shared/personal-rating-card/personal-rating-card.component.scss @@ -21,7 +21,6 @@ &__name { color: var(--black); - text-decoration: underline; @include typography.heading-4; diff --git a/projects/skills/src/app/profile/shared/personal-skill-card/personal-skill-card.component.scss b/projects/skills/src/app/profile/shared/personal-skill-card/personal-skill-card.component.scss index 9c7c1711b..c8e18b301 100644 --- a/projects/skills/src/app/profile/shared/personal-skill-card/personal-skill-card.component.scss +++ b/projects/skills/src/app/profile/shared/personal-skill-card/personal-skill-card.component.scss @@ -22,6 +22,7 @@ &__name { color: var(--black); + text-decoration: underline; @include typography.heading-4; diff --git a/projects/skills/src/app/profile/shared/progress-block/progress-block.component.scss b/projects/skills/src/app/profile/shared/progress-block/progress-block.component.scss index c588d82a2..6769a6be0 100644 --- a/projects/skills/src/app/profile/shared/progress-block/progress-block.component.scss +++ b/projects/skills/src/app/profile/shared/progress-block/progress-block.component.scss @@ -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); diff --git a/projects/skills/src/app/profile/shared/skills-block/skills-block.component.scss b/projects/skills/src/app/profile/shared/skills-block/skills-block.component.scss index 3d8b2977e..277ee3c92 100644 --- a/projects/skills/src/app/profile/shared/skills-block/skills-block.component.scss +++ b/projects/skills/src/app/profile/shared/skills-block/skills-block.component.scss @@ -4,7 +4,7 @@ .skills { &__main { position: relative; - min-height: 345px; + min-height: 365px; padding: 20px; margin-bottom: 18px; background-color: var(--white); diff --git a/projects/skills/src/app/rating/services/rating.service.ts b/projects/skills/src/app/rating/services/rating.service.ts index 2f1bef321..74aabb6ab 100644 --- a/projects/skills/src/app/rating/services/rating.service.ts +++ b/projects/skills/src/app/rating/services/rating.service.ts @@ -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"; @@ -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" diff --git a/projects/skills/src/app/skills/services/skill.service.ts b/projects/skills/src/app/skills/services/skill.service.ts index d0d7d7595..c47e9c0c0 100644 --- a/projects/skills/src/app/skills/services/skill.service.ts +++ b/projects/skills/src/app/skills/services/skill.service.ts @@ -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"; @@ -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"; diff --git a/projects/skills/src/app/subscription/service/subscription.service.ts b/projects/skills/src/app/subscription/service/subscription.service.ts index e243da5e3..8eff34c4d 100644 --- a/projects/skills/src/app/subscription/service/subscription.service.ts +++ b/projects/skills/src/app/subscription/service/subscription.service.ts @@ -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("/subscription/"); diff --git a/projects/skills/src/app/task/services/task.service.ts b/projects/skills/src/app/task/services/task.service.ts index a3a216eff..34fd0af60 100644 --- a/projects/skills/src/app/task/services/task.service.ts +++ b/projects/skills/src/app/task/services/task.service.ts @@ -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"; @@ -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([]); currentTaskDone = signal(false); diff --git a/projects/skills/src/app/trajectories/trajectories.service.ts b/projects/skills/src/app/trajectories/trajectories.service.ts index 56e4d2407..061eda77e 100644 --- a/projects/skills/src/app/trajectories/trajectories.service.ts +++ b/projects/skills/src/app/trajectories/trajectories.service.ts @@ -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(); diff --git a/projects/skills/src/app/webinars/services/webinar.service.ts b/projects/skills/src/app/webinars/services/webinar.service.ts index 5318e35d3..4981415fe 100644 --- a/projects/skills/src/app/webinars/services/webinar.service.ts +++ b/projects/skills/src/app/webinars/services/webinar.service.ts @@ -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"; @@ -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 { const params = new HttpParams(); diff --git a/projects/skills/src/environments/environment.prod.ts b/projects/skills/src/environments/environment.prod.ts index 5f8b24d7e..35e1db1ce 100644 --- a/projects/skills/src/environments/environment.prod.ts +++ b/projects/skills/src/environments/environment.prod.ts @@ -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", }; diff --git a/projects/skills/src/environments/environment.ts b/projects/skills/src/environments/environment.ts index 4c11e0d91..5ac33172d 100644 --- a/projects/skills/src/environments/environment.ts +++ b/projects/skills/src/environments/environment.ts @@ -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", }; diff --git a/projects/social_platform/src/app/app.config.ts b/projects/social_platform/src/app/app.config.ts index 5c824e7a2..320c535c4 100644 --- a/projects/social_platform/src/app/app.config.ts +++ b/projects/social_platform/src/app/app.config.ts @@ -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"; @@ -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, diff --git a/projects/social_platform/src/app/office/profile/detail/main/main.component.ts b/projects/social_platform/src/app/office/profile/detail/main/main.component.ts index d0c3fb9a0..934ea28dc 100644 --- a/projects/social_platform/src/app/office/profile/detail/main/main.component.ts +++ b/projects/social_platform/src/app/office/profile/detail/main/main.component.ts @@ -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", @@ -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 ) {} @@ -79,6 +81,8 @@ export class ProfileMainComponent implements OnInit, AfterViewInit, OnDestroy { loggedUserId: Observable = 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"]), diff --git a/projects/social_platform/src/environments/environment.prod.ts b/projects/social_platform/src/environments/environment.prod.ts index c2587a314..1e018aa5e 100644 --- a/projects/social_platform/src/environments/environment.prod.ts +++ b/projects/social_platform/src/environments/environment.prod.ts @@ -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, diff --git a/projects/social_platform/src/environments/environment.ts b/projects/social_platform/src/environments/environment.ts index c03f29f8c..f48ef2d35 100644 --- a/projects/social_platform/src/environments/environment.ts +++ b/projects/social_platform/src/environments/environment.ts @@ -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,