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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"start": "ng serve -o",
"build": "ng build",
"build-prod": "ng build --configuration=production",
"serve-prod": "ng serve --configuration=production",
"serve-staging": "ng serve --configuration=staging -o",
"watch": "ng build --watch --configuration development",
"test": "ng test",
Expand Down
7 changes: 6 additions & 1 deletion src/app/components/navbar/navbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@ export class NavbarComponent implements OnInit, OnDestroy {
{
title: "Опрос о пользе статистики",
url: "/salaries/survey",
show: true,
show: hasCurrentUser,
},
{
title: "Исторические данные",
url: "/salaries/historical-data",
show: hasCurrentUser,
},
],
},
Expand Down
84 changes: 49 additions & 35 deletions src/app/models/enums/developer-grade.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export interface DeveloperGradeLabel {
}

export class DeveloperGradeEnum {

static readonly grades: Array<DeveloperGrade> = [
DeveloperGrade.Trainee,
DeveloperGrade.Junior,
Expand All @@ -41,40 +40,55 @@ export class DeveloperGradeEnum {
cssText: "text-dark",
};

static readonly colorsByGrade: Map<
DeveloperGrade,
DeveloperGradeLabel
> = new Map([
[DeveloperGrade.Trainee, {
label: "Trainee",
cssBackground: "bg-light",
cssText: "text-dark",
}
],
[DeveloperGrade.Junior, {
label: "Junior",
cssBackground: "bg-success",
cssText: "",
}],
[DeveloperGrade.Middle, {
label: "Middle",
cssBackground: "bg-warning",
cssText: "text-dark",
}],
[DeveloperGrade.Senior, {
label: "Senior",
cssBackground: "bg-info",
cssText: "text-dark",
}],
[DeveloperGrade.Lead, {
label: "Lead",
cssBackground: "bg-primary",
cssText: "",
}],
[DeveloperGrade.Unknown, DeveloperGradeEnum.defaultColor],
]);
static readonly colorsByGrade: Map<DeveloperGrade, DeveloperGradeLabel> =
new Map([
[
DeveloperGrade.Trainee,
{
label: "Trainee",
cssBackground: "bg-light",
cssText: "text-dark",
},
],
[
DeveloperGrade.Junior,
{
label: "Junior",
cssBackground: "bg-success",
cssText: "text-light",
},
],
[
DeveloperGrade.Middle,
{
label: "Middle",
cssBackground: "bg-warning",
cssText: "text-dark",
},
],
[
DeveloperGrade.Senior,
{
label: "Senior",
cssBackground: "bg-info",
cssText: "text-dark",
},
],
[
DeveloperGrade.Lead,
{
label: "Lead",
cssBackground: "bg-primary",
cssText: "text-light",
},
],
[DeveloperGrade.Unknown, DeveloperGradeEnum.defaultColor],
]);

static getColorData(grade: DeveloperGrade): DeveloperGradeLabel {
return DeveloperGradeEnum.colorsByGrade.get(grade) ?? DeveloperGradeEnum.defaultColor;
return (
DeveloperGradeEnum.colorsByGrade.get(grade) ??
DeveloperGradeEnum.defaultColor
);
}
}
}
17 changes: 10 additions & 7 deletions src/app/models/salaries/salary.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ import { Currency } from "./currency";
import { KazakhstanCity } from "./kazakhstan-city";
import { Gender } from "@models/enums/gender.enum";

export interface UserSalaryAdminDto extends UserSalary {
id: string;
updatedAt: Date | null;
}

export interface UserSalary {
export interface UserSalarySimple {
value: number;
quarter: number;
year: number;
currency: Currency;
company: CompanyType;
grade: DeveloperGrade | null;
createdAt: Date;
}

export interface UserSalary extends UserSalarySimple {
city: KazakhstanCity | null;
gender: Gender | null;
age: number | null;
Expand All @@ -25,5 +24,9 @@ export interface UserSalary {
skillId: number | null;
workIndustryId: number | null;
professionId: number | null;
createdAt: Date;
}

export interface UserSalaryAdminDto extends UserSalary {
id: string;
updatedAt: Date | null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<tr *ngFor="let item of currencies" class="small">
<td>{{ item.currencyString }}</td>
<td>{{ item.value }} kzt</td>
<td>{{ item.pubDate | date: "yyyy-MM-dd" }}</td>
<td>{{ item.pubDate | date : "yyyy-MM-dd" }}</td>
</tr>
</tbody>
</table>
Expand Down
23 changes: 11 additions & 12 deletions src/app/modules/admin/components/background-jobs/currency-item.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { CurrencyData, CurrencyType } from "@services/admin-tools.service";

export class CurrencyItem implements CurrencyData {
constructor(private readonly item: CurrencyData) {
this.value = item.value;
this.currency = item.currency;
this.currencyString = CurrencyType[item.currency];
this.pubDate = item.pubDate;
}

constructor(private readonly item: CurrencyData) {
this.value = item.value;
this.currency = item.currency;
this.currencyString = CurrencyType[item.currency];
this.pubDate = item.pubDate;
}

readonly value: number;
readonly currency: CurrencyType;
readonly currencyString: string;
readonly pubDate: Date;
}
readonly value: number;
readonly currency: CurrencyType;
readonly currencyString: string;
readonly pubDate: Date;
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
[visibility]="item.isPublic"
></app-visibility-label>
</td>
<td>{{ item.updatedAt | date: "yyyy-MM-dd HH:mm" }}</td>
<td>{{ item.updatedAt | date : "yyyy-MM-dd HH:mm" }}</td>
<td class="small">
<a
routerLink="/interviews/templates/{{ item.id }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,23 @@
</thead>
<tbody>
<tr class="small" *ngFor="let item of salaries; let i = index">
<td>{{ item.value | number: "1.0-0" }}</td>
<td>{{ item.value | number : "1.0-0" }}</td>
<td>{{ item.quarter }}.{{ item.year }}</td>
<td>{{ item.age }}</td>
<td>{{ item.gender }}</td>
<td>{{ item.yearOfStartingWork }}</td>
<td>{{ item.profession }}</td>
<td>
<app-developer-grade-label [grade]="item.gradeAsEnum"></app-developer-grade-label>
<app-developer-grade-label
[grade]="item.gradeAsEnum"
></app-developer-grade-label>
</td>
<td>{{ item.company }}</td>
<td>{{ item.city }}</td>
<td>{{ item.skill }}</td>
<td>{{ item.industry }}</td>
<td>{{ item.createdAt | date: "yyyy-MM-dd HH:mm" }}</td>
<td>{{ item.updatedAt | date: "yyyy-MM-dd HH:mm" }}</td>
<td>{{ item.createdAt | date : "yyyy-MM-dd HH:mm" }}</td>
<td>{{ item.updatedAt | date : "yyyy-MM-dd HH:mm" }}</td>
<td>
<button
type="button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,20 @@ export class SalariesAdminPaginatedTableComponent {
showExcludeButton = false;

@Output()
loadDataRequested: EventEmitter<AdminAllSalariesQueryParams> = new EventEmitter<AdminAllSalariesQueryParams>();
loadDataRequested: EventEmitter<AdminAllSalariesQueryParams> =
new EventEmitter<AdminAllSalariesQueryParams>();

@Output()
approveRequested: EventEmitter<SalaryAdminItem> = new EventEmitter<SalaryAdminItem>();
approveRequested: EventEmitter<SalaryAdminItem> =
new EventEmitter<SalaryAdminItem>();

@Output()
excludeRequested: EventEmitter<SalaryAdminItem> = new EventEmitter<SalaryAdminItem>();
excludeRequested: EventEmitter<SalaryAdminItem> =
new EventEmitter<SalaryAdminItem>();

@Output()
deleteRequested: EventEmitter<SalaryAdminItem> = new EventEmitter<SalaryAdminItem>();
deleteRequested: EventEmitter<SalaryAdminItem> =
new EventEmitter<SalaryAdminItem>();

confirmDeletionMessage: DialogMessage<ConfirmMsg> | null = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
<tbody>
<tr class="small" *ngFor="let item of items; let i = index">
<td>{{ item.username }}</td>
<td>{{ item.usageCount | number: "1.0-0" }}</td>
<td>{{ item.usageCount | number : "1.0-0" }}</td>
<td>{{ item.channelName ?? "-" }}</td>
<td>{{ item.usageTypeAsString }}</td>
<td title="{{ item.receivedMessageText }}">
{{ item.receivedMessageText }}
</td>
<td>{{ item.createdAt | date: "yyyy-MM-dd HH:mm" }}</td>
<td>{{ item.updatedAt | date: "yyyy-MM-dd HH:mm" }}</td>
<td>{{ item.createdAt | date : "yyyy-MM-dd HH:mm" }}</td>
<td>{{ item.updatedAt | date : "yyyy-MM-dd HH:mm" }}</td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<app-status-label [status]="item.isActive"></app-status-label>
</td>
<td>{{ item.salariesCount }}</td>
<td>{{ item.createdAt | date: "yyyy-MM-dd HH:mm" }}</td>
<td>{{ item.createdAt | date : "yyyy-MM-dd HH:mm" }}</td>
<td>
<button
type="button"
Expand Down
Loading