Skip to content

Commit

Permalink
Merge pull request #3439 from ita-social-projects/refactor-long-imports
Browse files Browse the repository at this point in the history
refactor: Use non-relative paths in imports
  • Loading branch information
bzhn authored Nov 13, 2024
2 parents 393098e + 8ba13d7 commit e5c5418
Show file tree
Hide file tree
Showing 91 changed files with 176 additions and 173 deletions.
2 changes: 1 addition & 1 deletion src/app/chat/service/chats/chats.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Chat, ChatDto, LocationForChat } from '../../model/Chat.model';
import { environment } from '../../../../environments/environment';
import { environment } from 'src/environments/environment';
import { BehaviorSubject, Observable, Subject } from 'rxjs';
import { Message, MessageExtended, MessagesToSave } from '../../model/Message.model';
import { FriendArrayModel, FriendModel } from '@global-user/models/friend.model';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Language } from './../../../../i18n/Language';
import { Language } from 'src/app/main/i18n/Language';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { CUSTOM_ELEMENTS_SCHEMA, Injectable, EventEmitter } from '@angular/core';
import { NO_ERRORS_SCHEMA } from '@angular/core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { authImages, ubsAuthImages } from './../../../../image-pathes/auth-images';
import { authImages, ubsAuthImages } from 'src/app/main/image-pathes/auth-images';
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { LiveAnnouncer } from '@angular/cdk/a11y';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SignInIcons } from './../../../../image-pathes/sign-in-icons';
import { RestoreDto } from './../../../../model/restroreDto';
import { authImages, ubsAuthImages } from './../../../../image-pathes/auth-images';
import { SignInIcons } from 'src/app/main/image-pathes/sign-in-icons';
import { RestoreDto } from 'src/app/main/model/restroreDto';
import { authImages, ubsAuthImages } from 'src/app/main/image-pathes/auth-images';
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { AbstractControl, FormGroup, FormControl, FormBuilder } from '@angular/forms';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SignInIcons } from './../../../../image-pathes/sign-in-icons';
import { SignInIcons } from 'src/app/main/image-pathes/sign-in-icons';
import { Component, Input } from '@angular/core';

@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UserSuccessSignIn } from './../../../../model/user-success-sign-in';
import { UserSuccessSignIn } from 'src/app/main/model/user-success-sign-in';
import { RestorePasswordComponent } from './restore-password.component';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { UserOwnSignIn } from './../../../../model/user-own-sign-in';
import { UserSuccessSignIn } from './../../../../model/user-success-sign-in';
import { SignInIcons } from './../../../../image-pathes/sign-in-icons';
import { UserOwnSignIn } from 'src/app/main/model/user-own-sign-in';
import { UserSuccessSignIn } from 'src/app/main/model/user-success-sign-in';
import { SignInIcons } from 'src/app/main/image-pathes/sign-in-icons';
import { Component, EventEmitter, OnInit, OnDestroy, Output, OnChanges, Input } from '@angular/core';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { AbstractControl, FormGroup, FormControl, Validators } from '@angular/forms';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { RestorePasswordService } from '../../../../service/auth/restore-password.service';
import { Language } from './../../../../i18n/Language';
import { LocalStorageService } from '../../../../service/localstorage/local-storage.service';
import { RestorePasswordService } from 'src/app/main/service/auth/restore-password.service';
import { Language } from 'src/app/main/i18n/Language';
import { LocalStorageService } from 'src/app/main/service/localstorage/local-storage.service';
import { ComponentFixture, TestBed, inject, waitForAsync } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';
import { MatDialogModule, MatDialogRef } from '@angular/material/dialog';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from '@angular/core';
import { LocalStorageService } from '@global-service/localstorage/local-storage.service';
import { RestorePasswordService } from '../../../../service/auth/restore-password.service';
import { RestorePasswordService } from 'src/app/main/service/auth/restore-password.service';

@Component({
selector: 'app-restore',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { accounts } from 'google-one-tap';
import { Observable, Subject } from 'rxjs';
import { take } from 'rxjs/operators';
import { Patterns } from 'src/assets/patterns/patterns';
import { SignInIcons } from './../../../../image-pathes/sign-in-icons';
import { SignInIcons } from 'src/app/main/image-pathes/sign-in-icons';

import { Actions, ofType } from '@ngrx/effects';
import { Store } from '@ngrx/store';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Language } from '../../../../i18n/Language';
import { Language } from 'src/app/main/i18n/Language';
import { UserOwnSignUp } from '@global-models/user-own-sign-up';
import { UserSuccessSignIn } from '@global-models/user-success-sign-in';
import { ComponentFixture, TestBed, fakeAsync, flush, waitForAsync } from '@angular/core/testing';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Patterns } from './../../../../../../assets/patterns/patterns';
import { UserSuccessSignIn, SuccessSignUpDto } from './../../../../model/user-success-sign-in';
import { UserOwnSignUp } from './../../../../model/user-own-sign-up';
import { authImages } from './../../../../image-pathes/auth-images';
import { Patterns } from 'src/assets/patterns/patterns';
import { UserSuccessSignIn, SuccessSignUpDto } from 'src/app/main/model/user-success-sign-in';
import { UserOwnSignUp } from 'src/app/main/model/user-own-sign-up';
import { authImages } from 'src/app/main/image-pathes/auth-images';
import { Component, EventEmitter, OnInit, OnDestroy, Output, OnChanges, Input } from '@angular/core';
import { AbstractControl, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router';
Expand Down
2 changes: 1 addition & 1 deletion src/app/main/component/core/core.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AppRoutingModule } from './../../../app-routing.module';
import { AppRoutingModule } from 'src/app/app-routing.module';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ import { ACTION_CONFIG, ACTION_TOKEN } from './action.constants';
import { CreateEditNewsFormBuilder } from './create-edit-news-form-builder';
import { HomepageComponent } from 'src/app/main/component/home/components';
import { SearchAllResultsComponent } from 'src/app/main/component/layout/components';
import { MainComponent } from '../../../../main.component';
import { UbsBaseSidebarComponent } from '../../../../../shared/ubs-base-sidebar/ubs-base-sidebar.component';
import { MainComponent } from 'src/app/main/main.component';
import { UbsBaseSidebarComponent } from 'src/app/shared/ubs-base-sidebar/ubs-base-sidebar.component';
import { Store, ActionsSubject } from '@ngrx/store';
import { QuillModule } from 'ngx-quill';
import { LocalStorageService } from '@global-service/localstorage/local-storage.service';
import { Language } from '../../../../i18n/Language';
import { Language } from 'src/app/main/i18n/Language';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FilterModel } from '@shared/components/tag-filter/tag-filter.model';
import { LanguageService } from 'src/app/main/i18n/language.service';
import { FIRSTECONEWS } from '../../mocks/eco-news-mock';
import { NewsDTO } from '@eco-news-models/create-news-interface';
import { CreateEcoNewsAction } from '../../../../../store/actions/ecoNews.actions';
import { CreateEcoNewsAction } from 'src/app/store/actions/ecoNews.actions';

function getEmptyFormGroup() {
return new FormGroup({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import { Store } from '@ngrx/store';
import { BehaviorSubject, of } from 'rxjs';
import { SafeHtmlPipe } from '@pipe/safe-html-pipe/safe-html.pipe';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { Language } from '../../../../i18n/Language';
import { Language } from 'src/app/main/i18n/Language';
import { LanguageService } from 'src/app/main/i18n/language.service';
import { FIRSTECONEWS } from '../../mocks/eco-news-mock';
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
import { singleNewsImages } from '../../../../image-pathes/single-news-images';
import { singleNewsImages } from 'src/app/main/image-pathes/single-news-images';
import { MatSnackBarComponent } from '@global-errors/mat-snack-bar/mat-snack-bar.component';
import { MetaService } from 'src/app/shared/services/meta/meta.service';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { singleNewsImages } from '../../../../image-pathes/single-news-images';
import { singleNewsImages } from 'src/app/main/image-pathes/single-news-images';
import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Subject } from 'rxjs';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { TranslateModule } from '@ngx-translate/core';

import { NewsListListViewComponent } from './news-list-list-view.component';
import { LocalStorageService } from '@global-service/localstorage/local-storage.service';
import { Language } from '../../../../../i18n/Language';
import { Language } from 'src/app/main/i18n/Language';
import { BehaviorSubject } from 'rxjs';
import { LanguageService } from 'src/app/main/i18n/language.service';
import { FIRSTECONEWS } from '../../../mocks/eco-news-mock';
import { FIRSTECONEWS } from 'src/app/main/component/eco-news/mocks/eco-news-mock';
import { Router } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { userAssignedCardsIcons } from '../../../../../image-pathes/profile-icons';
import { userAssignedCardsIcons } from 'src/app/main/image-pathes/profile-icons';
import {
Component,
Input,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { SharedModule } from 'src/app/shared/shared.module';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';

import { Store } from '@ngrx/store';
import { Language } from '../../../../i18n/Language';
import { Language } from 'src/app/main/i18n/Language';
import { MatDialog } from '@angular/material/dialog';
import { ChangeEcoNewsFavoriteStatusAction } from 'src/app/store/actions/ecoNews.actions';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Breakpoints } from '../../../../config/breakpoints.constants';
import { Breakpoints } from 'src/app/main/config/breakpoints.constants';
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Observable, of, ReplaySubject } from 'rxjs';
import { map, take, takeUntil } from 'rxjs/operators';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { singleNewsImages } from '../../../../image-pathes/single-news-images';
import { singleNewsImages } from 'src/app/main/image-pathes/single-news-images';
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
import { CreateEcoNewsService } from '@eco-news-service/create-eco-news.service';
import { Router } from '@angular/router';
Expand Down
2 changes: 1 addition & 1 deletion src/app/main/component/eco-news/eco-news.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Language } from './../../i18n/Language';
import { Language } from 'src/app/main/i18n/Language';
import { RouterTestingModule } from '@angular/router/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/materia
import { IMask } from 'angular-imask';
import * as _moment from 'moment';
import 'moment/locale/uk';
import { LanguageService } from '../../../../../../../../i18n/language.service';
import { LanguageService } from 'src/app/main/i18n/language.service';
import { MomentDateAdapter } from './moment-date-adapter';

export const MY_FORMATS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { GoogleScript } from '@assets/google-script/google-script';
import { Patterns } from '@assets/patterns/patterns';
import { GeocoderService } from '@global-service/geocoder/geocoder.service';
import { Subject, takeUntil } from 'rxjs';
import { PlaceOnlineGroup } from '../../../../../../models/events.interface';
import { PlaceOnlineGroup } from 'src/app/main/component/events/models/events.interface';

@Component({
selector: 'app-place-online',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MatInputModule } from '@angular/material/input';
import { DefaultCoordinates } from '../../../../models/event-consts';
import { DefaultCoordinates } from 'src/app/main/component/events/models/event-consts';

describe('CreateEventDatesComponent', () => {
let component: CreateEventDatesComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
import { MatSnackBarComponent } from '@global-errors/mat-snack-bar/mat-snack-bar.component';
import { FileHandle } from '../../../../../../../../../ubs/ubs-admin/models/file-handle.model';
import { EventsService } from '../../../../../../services/events.service';
import { ImagesContainer } from '../../../../../../models/events.interface';
import { FileHandle } from 'src/app/ubs/ubs-admin/models/file-handle.model';
import { EventsService } from 'src/app/main/component/events/services/events.service';
import { ImagesContainer } from 'src/app/main/component/events/models/events.interface';
import { MatDialog } from '@angular/material/dialog';
import { EditImagePopUpComponent } from 'src/app/shared/edit-image-pop-up/edit-image-pop-up.component';
import { take } from 'rxjs';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { LocalStorageService } from '@global-service/localstorage/local-storage.service';
import { TranslateModule } from '@ngx-translate/core';
import { ContentChange, QuillModule } from 'ngx-quill';
import { Language } from '../../../../../../i18n/Language';
import { Language } from 'src/app/main/i18n/Language';
import { CreateEventInformationComponent } from './create-event-information.component';

describe('CreateEventInformationComponent', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { ContentChange } from 'ngx-quill';

import { FormGroup } from '@angular/forms';
import { quillConfig } from '../../quillEditorFunc';
import { EVENT_LOCALE, EventLocaleKeys } from '../../../../models/event-consts';
import { ImagesContainer } from '../../../../models/events.interface';
import { EVENT_LOCALE, EventLocaleKeys } from 'src/app/main/component/events/models/event-consts';
import { ImagesContainer } from 'src/app/main/component/events/models/events.interface';
import { Router } from '@angular/router';

@Component({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Subscription } from 'rxjs';
import { take } from 'rxjs/operators';
import { DialogPopUpComponent } from 'src/app/shared/dialog-pop-up/dialog-pop-up.component';
import { CreateEcoEventAction, EditEcoEventAction, EventsActions } from 'src/app/store/actions/ecoEvents.actions';
import { singleNewsImages } from '../../../../image-pathes/single-news-images';
import { singleNewsImages } from 'src/app/main/image-pathes/single-news-images';
import { Place } from '../../../places/models/place';
import { DefaultCoordinates } from '../../models/event-consts';
import { DateInformation, Dates, EventDTO, EventForm, EventResponse, TagObj } from '../../models/events.interface';
Expand Down Expand Up @@ -230,7 +230,8 @@ export class EventEditorComponent extends FormBaseComponent implements OnInit {
this.eventId = Number(urlSegments[urlSegments.length - 1]);
}
const currentImages = (this._savedFormValues?.eventInformation?.images || [])
.filter((value) => !value.file).map((value) => value.url);
.filter((value) => !value.file)
.map((value) => value.url);
sendEventDto = {
...sendEventDto,
additionalImages: currentImages.slice(1),
Expand Down Expand Up @@ -258,42 +259,44 @@ export class EventEditorComponent extends FormBaseComponent implements OnInit {
}

transformDatesFormToDates(form: DateInformation[]): Dates[] {
return form.map((value) => {
const { date, endTime, startTime } = value.day;
const { onlineLink, place, coordinates } = value.placeOnline;
return form
.map((value) => {
const { date, endTime, startTime } = value.day;
const { onlineLink, place, coordinates } = value.placeOnline;

const dateObject = new Date(date);
const dateObject = new Date(date);

if (isNaN(dateObject.getTime())) {
return;
}
if (isNaN(dateObject.getTime())) {
return;
}

let [hours, minutes] = startTime.split(':');
dateObject.setHours(parseInt(hours, 10));
dateObject.setMinutes(parseInt(minutes, 10));
const startDate = dateObject.toISOString();
let [hours, minutes] = startTime.split(':');
dateObject.setHours(parseInt(hours, 10));
dateObject.setMinutes(parseInt(minutes, 10));
const startDate = dateObject.toISOString();

[hours, minutes] = endTime.split(':');
dateObject.setHours(parseInt(hours, 10));
dateObject.setMinutes(parseInt(minutes, 10));
const finishDate = dateObject.toISOString();
[hours, minutes] = endTime.split(':');
dateObject.setHours(parseInt(hours, 10));
dateObject.setMinutes(parseInt(minutes, 10));
const finishDate = dateObject.toISOString();

const dates: Dates = {
startDate,
finishDate,
id: undefined
};
if (onlineLink) {
dates.onlineLink = onlineLink;
}
if (place) {
dates.coordinates = {
latitude: coordinates.lat,
longitude: coordinates.lng
const dates: Dates = {
startDate,
finishDate,
id: undefined
};
}
return dates;
}).filter(Boolean);
if (onlineLink) {
dates.onlineLink = onlineLink;
}
if (place) {
dates.coordinates = {
latitude: coordinates.lat,
longitude: coordinates.lng
};
}
return dates;
})
.filter(Boolean);
}

escapeFromCreateEvent(): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';

import { UpdateEventComponent } from './update-event.component';
import { EventStoreService } from '../../services/event-store.service';
import { EventStoreService } from 'src/app/main/component/events/services/event-store.service';
import { RouterTestingModule } from '@angular/router/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { TranslateModule } from '@ngx-translate/core';
import { SharedModule } from '../../../../../shared/shared.module';
import { SharedModule } from 'src/app/shared/shared.module';

describe('UpdateEventComponent', () => {
let component: UpdateEventComponent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
EventResponse,
ImagesContainer
} from '../../models/events.interface';
import { LanguageService } from '../../../../i18n/language.service';
import { LanguageService } from 'src/app/main/i18n/language.service';
import { EventStoreService } from '../../services/event-store.service';
import { LocalStorageService } from '@global-service/localstorage/local-storage.service';

Expand Down
2 changes: 1 addition & 1 deletion src/app/main/component/events/events.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { EventsComponent } from './events.component';
import { TranslateService } from '@ngx-translate/core';
import { LocalStorageService } from '@global-service/localstorage/local-storage.service';
import { Language } from '../../i18n/Language';
import { Language } from 'src/app/main/i18n/Language';
import { RouterTestingModule } from '@angular/router/testing';
import { BehaviorSubject } from 'rxjs';

Expand Down
Loading

0 comments on commit e5c5418

Please sign in to comment.