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

Achievements #1357 #1370

Merged
merged 94 commits into from
Jul 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
b78dd20
add tab zdobuvachi
Olya-web7 Jun 22, 2022
14e2d9d
fix
Olya-web7 Jun 22, 2022
edb40dd
fix
Olya-web7 Jun 22, 2022
ab7dbf2
fix routing for create achievment
Olya-web7 Jun 22, 2022
73e0bfe
fix styles
Olya-web7 Jun 22, 2022
158bacb
fix
Olya-web7 Jun 23, 2022
26d9e46
fix tests
Olya-web7 Jun 23, 2022
33e1062
fix tests
Olya-web7 Jun 23, 2022
14476cb
fix tests
Olya-web7 Jun 23, 2022
9166483
fix tests
Olya-web7 Jun 23, 2022
546a530
add teachers list
Olya-web7 Jun 23, 2022
8c0e40f
fix
Olya-web7 Jun 23, 2022
9eccca5
add date
Olya-web7 Jun 23, 2022
7c16878
add opis
Olya-web7 Jun 23, 2022
321f3f6
fix tests
Olya-web7 Jun 23, 2022
0bf8061
fix
Olya-web7 Jun 23, 2022
70b930a
fix
Olya-web7 Jun 23, 2022
2f7bd38
fix
Olya-web7 Jun 23, 2022
d64f13c
add achievements component
Olya-web7 Jun 23, 2022
a33fbf0
add achievements service
Olya-web7 Jun 23, 2022
224fa93
fix
Olya-web7 Jun 23, 2022
81fe44c
achievement service
Olya-web7 Jun 23, 2022
de10443
fix
Olya-web7 Jun 23, 2022
b8c9300
fix
Olya-web7 Jun 23, 2022
1bee767
fix
Olya-web7 Jun 23, 2022
abadc72
fix
Olya-web7 Jun 23, 2022
60ffbbd
fix
Olya-web7 Jun 23, 2022
c8da8cb
Merge branch 'develop' into achievements
Olya-web7 Jun 23, 2022
16a4b34
fix
Olya-web7 Jun 23, 2022
d8931c0
Merge branch 'achievements' of https://github.com/ita-social-projects…
Olya-web7 Jun 23, 2022
f9b8385
fix
Olya-web7 Jun 23, 2022
faf9bd3
fix
Olya-web7 Jun 23, 2022
1c23eca
fix
Olya-web7 Jun 23, 2022
b9c1cc5
fix on comments
Olya-web7 Jun 24, 2022
937be48
fix on comments
Olya-web7 Jun 24, 2022
ab35bde
fix on comments
Olya-web7 Jun 24, 2022
2ebb646
fix on comments
Olya-web7 Jun 24, 2022
a0e128a
fix on comments
Olya-web7 Jun 24, 2022
bec364f
fix on comments
Olya-web7 Jun 24, 2022
29256e9
fix on comments
Olya-web7 Jun 24, 2022
f3154f4
fix on comments
Olya-web7 Jun 24, 2022
9f24178
fix on comments
Olya-web7 Jun 24, 2022
d589692
Merge branch 'develop' into achievements
Olya-web7 Jun 24, 2022
d06707d
add gormgroup
Olya-web7 Jun 24, 2022
d9b60e1
Merge branch 'achievements' of https://github.com/ita-social-projects…
Olya-web7 Jun 24, 2022
10a7fb2
achievement-card tests fix
Olya-web7 Jun 24, 2022
48261f4
fix
Olya-web7 Jun 24, 2022
2929dca
fix
Olya-web7 Jun 24, 2022
9407f70
fix
Olya-web7 Jun 24, 2022
5fb519a
fix
Olya-web7 Jun 25, 2022
161300a
Merge branch 'develop' into achievements
Olya-web7 Jun 25, 2022
a45ed49
fix
Olya-web7 Jun 25, 2022
1d57b16
Merge branch 'achievements' of https://github.com/ita-social-projects…
Olya-web7 Jun 25, 2022
1ad145a
fix
Olya-web7 Jun 25, 2022
d235d11
fix
Olya-web7 Jun 25, 2022
b8b2d04
fix
Olya-web7 Jun 25, 2022
2d67852
fix
Olya-web7 Jun 25, 2022
8d1ce3f
fix
Olya-web7 Jun 25, 2022
c7c85fa
fix
Olya-web7 Jun 25, 2022
4eb392b
fix
Olya-web7 Jun 25, 2022
ea5a98b
fix
Olya-web7 Jun 27, 2022
182d76f
fix
Olya-web7 Jun 27, 2022
5e8ff13
fix
Olya-web7 Jun 27, 2022
d543698
fix
Olya-web7 Jun 27, 2022
277fccd
fix
Olya-web7 Jun 27, 2022
dbd4657
fix
Olya-web7 Jun 27, 2022
c3e758c
fix
Olya-web7 Jun 27, 2022
f37af15
fix
Olya-web7 Jun 27, 2022
eb34166
Merge branch 'develop' into achievements
Olya-web7 Jun 27, 2022
edb40c4
fix
Olya-web7 Jun 29, 2022
e97e0a2
fix
Olya-web7 Jun 29, 2022
78dfbb7
fix
Olya-web7 Jun 29, 2022
cbf0f64
fix
Olya-web7 Jun 29, 2022
98d6995
fix
Olya-web7 Jun 29, 2022
b5ea655
fix
Olya-web7 Jun 29, 2022
d705ea5
fix
Olya-web7 Jun 29, 2022
ebe8e27
fix
Olya-web7 Jun 30, 2022
b0b20da
fix tests
Olya-web7 Jun 30, 2022
722e4a8
fix create achievement
Olya-web7 Jun 30, 2022
7316aaa
fix
Olya-web7 Jun 30, 2022
2a126ad
fix
Olya-web7 Jun 30, 2022
895a6d1
fix
Olya-web7 Jun 30, 2022
fba2e6b
Merge branch 'develop' into achievements
Olya-web7 Jun 30, 2022
75bec95
chng the matselect ui
Olya-web7 Jul 1, 2022
758adb8
fix tests
Olya-web7 Jul 1, 2022
4d2f654
add remove function
Olya-web7 Jul 1, 2022
095dad0
Merge branch 'develop' into achievements
Olya-web7 Jul 1, 2022
df7d638
add remove function
Olya-web7 Jul 1, 2022
467c755
Merge branch 'achievements' of https://github.com/ita-social-projects…
Olya-web7 Jul 1, 2022
98c9e71
fix
Olya-web7 Jul 1, 2022
eed0f28
fix
Olya-web7 Jul 2, 2022
9071659
fix
Olya-web7 Jul 2, 2022
27c2b0f
Merge branch 'develop' into achievements
Olya-web7 Jul 2, 2022
ddc8532
fix
Olya-web7 Jul 2, 2022
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
@@ -0,0 +1,13 @@
<mat-card class="position">
<div class="card" fxLayout="column" fxLayoutAlign="start space-between">
<div class="wrap-for-details">
<mat-card-header>
<mat-card-title showTooltipIfTruncated matTooltipClass="tooltip"
class="card-title">title</mat-card-title>
</mat-card-header>
<mat-card-content fxLayout="column" fxLayoutAlign="space-between start">
<p class="card_text">description</p>
</mat-card-content>
</div>
</div>
</mat-card>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatIconModule } from '@angular/material/icon';
import { RouterTestingModule } from '@angular/router/testing';
import { NgxsModule } from '@ngxs/store';

import { AchievementCardComponent } from './achievement-card.component';

describe('AchievementCardComponent', () => {
let component: AchievementCardComponent;
let fixture: ComponentFixture<AchievementCardComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
MatCardModule,
MatButtonModule,
NgxsModule.forRoot([]),
RouterTestingModule,
MatIconModule
],
declarations: [ AchievementCardComponent ]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(AchievementCardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, Input, OnInit } from '@angular/core';
import { Achievement } from 'src/app/shared/models/achievement.model';

@Component({
selector: 'app-achievement-card',
templateUrl: './achievement-card.component.html',
styleUrls: ['./achievement-card.component.scss'],
})
export class AchievementCardComponent implements OnInit {
@Input() achievement: Achievement;

constructor() {}

ngOnInit(): void {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@
</mat-card-content>

<mat-card-footer *ngIf="!isCreateApplicationView" class="card-footer">
<a class="more-details" [routerLink]="['/details/workshop', workshopData.workshopId ]">
<span class="card_link">Детальніше</span>
<mat-icon>arrow_forward</mat-icon>
</a>
<div>
<a class="more-details" [routerLink]="['/create-achievement', workshopData.workshopId]">
<mat-icon>add</mat-icon>
<span class="card_link">Додати досягнення</span>
</a>
<a class="more-details" [routerLink]="['/details/workshop', workshopData.workshopId]">
<span class="card_link">Детальніше</span>
<mat-icon>arrow_forward</mat-icon>
</a>
</div>
</mat-card-footer>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
border-radius: 20px;
margin-bottom: 20px;
}
.more-details {
width: 144px;
}

@media (max-width: 750px) {
:host.application-workshop .horizontal {
Expand Down Expand Up @@ -121,10 +124,7 @@
}
::ng-deep .mat-card-header-text {
margin: 0;
}
.card-footer {
flex-direction: row;
}
}
.card-title, .mat-card-header{
font-size: 15px;
}
Expand Down
11 changes: 10 additions & 1 deletion src/app/shared/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export class Constants {
static readonly MODAL_SMALL = '500px';
static readonly MODAL_MEDIUM = '1024px';
}

export class PaginationConstants {
static readonly FIRST_PAGINATION_PAGE = 1;
static readonly MAX_PAGE_PAGINATOR_DISPLAY = 7;
Expand All @@ -64,6 +63,16 @@ export const MOMENT_DATE_FORMATS: MatDateFormats = {
}
};

export const AchievementsTitle = [
{ id: 1, name: "Переможці міжнародних та всеукраїнських спортивних змагань (індивідуальних та командних)" },
{ id: 2, name: "Призери та учасники міжнародних, всеукраїнських та призери регіональних конкурсів і виставок наукових, технічних, дослідницьких, інноваційних, ІТ проектів" },
{ id: 3, name: "Реципієнти міжнародних грантів" },
{ id: 4, name: "Призери міжнародних культурних конкурсів та фестивалів" },
{ id: 5, name: "Соціально активні категорії учнів" },
{ id: 6, name: "Цифрові інструменти Google для закладів вищої та фахової передвищої освіти" },
{ id: 7, name: "Переможці та учасники олімпіад міжнародного та всеукраїнського рівнів" }
];

export const WorkingDaysValues: WorkingDaysToggleValue[] = [
{
value: WorkingDays.monday,
Expand Down
2 changes: 2 additions & 0 deletions src/app/shared/enum/modal-confirmation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export enum ModalConfirmationType {
createApplication = 'createApplication',
approveApplication = 'approveApplication',
rejectApplication = 'rejectApplication',
createAchievement = 'createAchievement',
createDirection = 'createDirection',
editDirection = 'editDirection',
createDepartment = 'createDepartment',
Expand Down Expand Up @@ -71,6 +72,7 @@ export enum ModalConfirmationText {
leavePage = 'Ви впевнені, що хочете залишити сторінку?',
rate = 'Поставте будь ласка оцінку цьому гуртку',
createApplication = 'Ви впевнені, що хочете подати заявку у гурток',
createAchievement = 'Ви впевнені, що хочете додати досягнення',
approveApplication = 'Ви впевнені, що хочете перевести заявку в статус "Зарахувати"?',
rejectApplication = 'Ви впевнені, що хочете перевести заяву у статус ”Відмовлено”?',
createProviderAdmin = 'Ви впевнені, що хочете додати адміністратора гуртка?',
Expand Down
1 change: 1 addition & 0 deletions src/app/shared/enum/no-results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ export enum NoResultsTitle {
noDirections = 'За результатами нічого не знайдено',
noUsers = 'Користувачів поки немає',
noTeachers = 'Викладачів поки немає',
noAchievements = 'Досягнень поки немає',
noReviews = 'Відгуків поки немає',
}
20 changes: 20 additions & 0 deletions src/app/shared/models/achievement.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

export class Achievement {
id?: string;
title: string;
achievementDate: string;
workshopId: string;
achievementTypeId: number;
childrenIDs?: string[];
teachers?: string[];

constructor(info, workshopId, childrenIDs, teachers) {
this.title = info.title,
this.achievementDate = info.achievementDate,
this.workshopId = workshopId;
this.achievementTypeId = info.achievementTypeId,
this.childrenIDs = childrenIDs,
this.teachers = teachers;
}

}
19 changes: 19 additions & 0 deletions src/app/shared/services/achievements/achievements.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { TestBed } from '@angular/core/testing';

import { AchievementsService } from './achievements.service';
import { HttpClientTestingModule } from '@angular/common/http/testing';

describe('AchievementsService', () => {
let service: AchievementsService;

beforeEach(() => {
TestBed.configureTestingModule({
imports: [HttpClientTestingModule],
});
service = TestBed.inject(AchievementsService);
});

it('should be created', () => {
expect(service).toBeTruthy();
});
});
21 changes: 21 additions & 0 deletions src/app/shared/services/achievements/achievements.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { Achievement } from '../../models/achievement.model';

@Injectable({
providedIn: 'root',
})
export class AchievementsService {
constructor(private http: HttpClient) {}

getAchievementsByWorkshopId(id: string): Observable<Achievement[]> {
return this.http.get<Achievement[]>(
`/api/v1//api/v1/Achievement/GetByWorkshopId/${id}`
);
}

createAchievement(achievement: Achievement): Observable<object> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo Achievement

return this.http.post('/api/v1/Achievement/Create', achievement, { observe: 'response' });
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Injectable } from '@angular/core';
import { Store } from '@ngxs/store';
import { Observable } from 'rxjs';
import { FeaturesList } from 'src/app/shared/models/featuresList.model';
import { Teacher } from 'src/app/shared/models/teacher.model';
import { MetaDataState } from 'src/app/shared/store/meta-data.state';
import { Workshop, WorkshopCard } from '../../../models/workshop.model';

Expand Down
2 changes: 2 additions & 0 deletions src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import { InstitutionHierarchyComponent } from './components/institution-hierarch
import { ImageCropperModule } from 'ngx-image-cropper';
import { ImageCropperModalComponent } from './components/image-cropper-modal/image-cropper-modal.component';
import { InfoFormComponent } from './components/info-form/info-form.component';
import { AchievementCardComponent } from './components/achievement-card/achievement-card/achievement-card.component';
import { EntityCheckboxDropdownComponent } from './components/entity-checkbox-dropdown/entity-checkbox-dropdown.component';

@NgModule({
Expand Down Expand Up @@ -131,6 +132,7 @@ import { EntityCheckboxDropdownComponent } from './components/entity-checkbox-dr
InstitutionHierarchyComponent,
ImageCropperModalComponent,
InfoFormComponent,
AchievementCardComponent,
],
imports: [
MaterialModule,
Expand Down
17 changes: 17 additions & 0 deletions src/app/shared/store/user.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ import { Provider } from '../models/provider.model';
import { User } from '../models/user.model';
import { Workshop, WorkshopCard } from '../models/workshop.model';
import { ProviderAdmin } from '../models/providerAdmin.model';
import { Achievement } from '../models/achievement.model';

export class GetWorkshopsByProviderId {
static readonly type = '[user] get Workshops By Provider Id';
constructor(public payload: string) { }
}
export class GetAchievementsByWorkshopId {
static readonly type = '[user] get Achievements By Wokrshop Id';
constructor(public payload) { }
}
export class GetWorkshopById {
static readonly type = '[user] get Workshop By Wokrshop Id';
constructor(public payload: string) { }
Expand Down Expand Up @@ -150,6 +155,18 @@ export class OnDeleteProviderAdminFail {
static readonly type = '[user] delete Provider Admin fail';
constructor(public payload) { }
}
export class CreateAchievement {
static readonly type = '[user] create Achievement';
constructor(public payload: Achievement) {}
}
export class OnCreateAchievementFail {
static readonly type = '[user] create Achievement fail';
constructor(public payload: HttpErrorResponse) {}
}
export class OnCreateAchievementSuccess {
static readonly type = '[user] create Achievement success';
constructor(public payload) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add typo Achievement

}
export class CreateApplication {
static readonly type = '[user] create Application';
constructor(public payload: Application) { }
Expand Down
Loading