Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into bugfix/profile-picture
Browse files Browse the repository at this point in the history
  • Loading branch information
kovalsofiia1 committed Nov 18, 2024
2 parents 97159d0 + 0aee35d commit 3e7ef55
Show file tree
Hide file tree
Showing 107 changed files with 367 additions and 221 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
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,12 @@ describe('CommentsListComponent', () => {
});

it('should send data when user save edited content', () => {
component.content.setValue('some test text');
component.content.setValue('Updated comment text');

component['commentHtml'] = 'Updated comment text';

const spy = spyOn((component as any).commentsService, 'editComment').and.returnValue(of());

component.saveEditedComment(commentData);
expect(spy).toHaveBeenCalled();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ export class CommentsListComponent {
}

saveEditedComment(element: CommentsDTO): void {
if (!this.commentHtml.trim() || this.commentHtml === element.text) {
element.isEdit = false;
this.content.reset();
return;
}

this.commentsService
.editComment(element.id, this.commentHtml)
.pipe(take(1))
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 @@ -93,25 +93,22 @@ export class MatSnackBarComponent {
private translate: TranslateService
) {}

openSnackBar(type: string, additionalValue?: string) {
openSnackBar(type: string, additionalValue?: string, duration: number = 3000, customPositioning?: string) {
const isInclude = type.includes('400') ? this.getSnackBarMessage('error') : this.getSnackBarMessage('errorMessage', type);
if (additionalValue) {
return this.snackType[type] ? this.getSnackBarMessage(type, additionalValue) : isInclude;
}
return this.snackType[type] ? this.getSnackBarMessage(type) : isInclude;
return this.snackType[type] ? this.getSnackBarMessage(type, additionalValue, duration, customPositioning) : isInclude;
}

getSnackBarMessage(type: string, additionalValue?: string): void {
getSnackBarMessage(type: string, additionalValue?: string, duration: number = 3000, customPositioning?: string): void {
const className = this.snackType[type].classname;
const key = this.snackType[type].key || type;
const addValue = additionalValue ? { orderId: additionalValue } : {};
this.translate.get(key, addValue).subscribe((translation) => {
this.message = translation;
this.snackBar.open(this.message, 'close', {
duration: 3000,
duration,
verticalPosition: 'top',
horizontalPosition: 'center',
panelClass: [className]
panelClass: [className, customPositioning]
});
});
}
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
Loading

0 comments on commit 3e7ef55

Please sign in to comment.