Skip to content

Commit

Permalink
Merge pull request #8279 from ever-co/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
evereq authored Sep 27, 2024
2 parents aaf9545 + e63d589 commit 1ac0d3c
Show file tree
Hide file tree
Showing 89 changed files with 2,277 additions and 1,223 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,8 @@
"nbbutton",
"xaxis",
"wdth",
"concate"
"concate",
"typeahead"
],
"useGitignore": true,
"ignorePaths": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
</div>
</ng-template>
</ng-template>
<div class="col-3 project-name">
<div class="col-3">
<ngx-project *ngIf="log?.project; else noProject" [rowData]="log"></ngx-project>
<ng-template #noProject>
<span>
Expand All @@ -94,7 +94,7 @@
<div class="mt-2 small">
<span *ngIf="log?.task; else noToDo">
<strong> {{ 'TIMESHEET.TODO' | translate }} : </strong>
{{ log?.task?.title }}
{{ log?.task?.title | truncate : 50 }}
</span>
<ng-template #noToDo>
<span>{{ 'TIMESHEET.NO_TODO' | translate }}</span>
Expand All @@ -119,10 +119,18 @@
{{ log.logType | titlecase }}
</span>
</div>
<div class="col">
<span class="log">
{{ log.source | replace : '_' : ' ' | titlecase }}
</span>
<div class="col source-version">
<ngx-badge-label
[text]="log?.source | replace : '_' : ' ' | titlecase"
class="badge-item"
></ngx-badge-label>

<ngx-badge-label
*ngIf="log?.version"
[text]="log?.version"
status="info"
class="badge-item"
></ngx-badge-label>
</div>
<div class="col">
{{ log.duration | durationFormat }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
@import '../../weekly/weekly/weekly.component.scss';

:host {
nb-card {
border-radius: 0 nb-theme(border-radius) nb-theme(border-radius) nb-theme(border-radius);
}
nb-card-body {
height: 100%;
}
.gauzy-button-action {
display: flex;
align-content: center;
justify-content: flex-end;
}
.log-container {
height: calc(100% - 50px);
}
.log {
width: fit-content;
font-size: 12px;
font-weight: 600;
line-height: 15px;
letter-spacing: 0em;
text-align: left;
padding: 3px 8px;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
border-radius: nb-theme(border-radius);
background: var(--gauzy-sidebar-background-3);
}
nb-card {
border-radius: 0 nb-theme(border-radius) nb-theme(border-radius) nb-theme(border-radius);
}
nb-card-body {
height: 100%;
}
.gauzy-button-action {
display: flex;
align-content: center;
justify-content: flex-end;
}
.log-container {
height: calc(100% - 50px);
}
.log {
width: fit-content;
font-size: 12px;
font-weight: 600;
line-height: 15px;
letter-spacing: 0em;
text-align: left;
padding: 3px 8px;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
border-radius: nb-theme(border-radius);
background: var(--gauzy-sidebar-background-3);
}
.source-version {
display: flex;
gap: 5%;
}
}
12 changes: 10 additions & 2 deletions packages/contracts/src/organization-project-module.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { IEmployee } from './employee.model';
import { IRelationalOrganizationProject } from './organization-projects.model';
import { IOrganizationSprint } from './organization-sprint.model';
import { IOrganizationTeam } from './organization-team.model';
import { TaskStatusEnum } from './task-status.model';
import { ITask } from './task.model';
import { IUser } from './user.model';

Expand All @@ -17,7 +16,7 @@ export interface IOrganizationProjectModule
IRelationalOrganizationProject {
name: string;
description?: string;
status?: TaskStatusEnum;
status?: ProjectModuleStatusEnum;
startDate?: Date;
endDate?: Date;
isFavorite?: boolean;
Expand All @@ -42,6 +41,15 @@ export interface IOrganizationProjectModuleFindInput
organizationSprintId?: ID;
}

export enum ProjectModuleStatusEnum {
BACKLOG = 'backlog',
PLANNED = 'planned',
IN_PROGRESS = 'in-progress',
PAUSED = 'paused',
COMPLETED = 'completed',
CANCELLED = 'cancelled'
}

export interface IOrganizationProjectModuleCreateInput extends Omit<IOrganizationProjectModule, 'id'> {}

export interface IOrganizationProjectModuleUpdateInput extends Partial<IOrganizationProjectModule> {}
3 changes: 2 additions & 1 deletion packages/contracts/src/organization-projects.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ export interface IOrganizationProjectsFindInput
}

export interface IOrganizationProjectCreateInput extends IOrganizationProjectBase {
managers?: IOrganizationProjectEmployee[];
memberIds?: ID[]; // Manager of the organization project
managerIds?: ID[]; // Manager of the organization project
}

export interface IOrganizationProjectUpdateInput extends IOrganizationProjectCreateInput {}
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts/src/organization-team.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export interface IOrganizationTeamCreateInput extends IBasePerTenantAndOrganizat
requirePlanToTrack?: boolean;
public?: boolean;
profile_link?: string;
memberIds?: string[];
managerIds?: string[];
memberIds?: ID[];
managerIds?: ID[];
tags?: ITag[];
projects?: IOrganizationProject[];
}
Expand Down
8 changes: 3 additions & 5 deletions packages/contracts/src/task.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@ import { IUser } from './user.model';
import { ITaskStatus, TaskStatusEnum } from './task-status.model';
import { ITaskPriority, TaskPriorityEnum } from './task-priority.model';
import { ITaskSize, TaskSizeEnum } from './task-size.model';
import { IRelationalOrganizationProjectModule } from './organization-project-module.model';
import { IOrganizationProjectModule } from './organization-project-module.model';

export interface ITask
extends IBasePerTenantAndOrganizationEntityModel,
IRelationalOrganizationProject,
IRelationalOrganizationProjectModule {
export interface ITask extends IBasePerTenantAndOrganizationEntityModel, IRelationalOrganizationProject {
title: string;
number?: number;
public?: boolean;
Expand All @@ -29,6 +26,7 @@ export interface ITask
members?: IEmployee[];
invoiceItems?: IInvoiceItem[];
teams?: IOrganizationTeam[];
modules?: IOrganizationProjectModule[];
organizationSprint?: IOrganizationSprint;
organizationSprintId?: ID;
creator?: IUser;
Expand Down
13 changes: 7 additions & 6 deletions packages/core/src/core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,24 +310,25 @@ export function freshTimestamp(): Date {
*
* @param startedAt The start date of the range.
* @param stoppedAt The end date of the range.
* @throws BadRequestException if the dates are invalid or if the stoppedAt date is before the startedAt date.
* @throws BadRequestException if the stoppedAt date is before the startedAt date.
*/
export function validateDateRange(startedAt: Date, stoppedAt: Date): void {
const start = moment(startedAt);
const end = moment(stoppedAt);

console.log('------ Stopped Timer ------', start.toDate(), end.toDate());
console.log('------ Timer Date Range ------', start.toDate(), end.toDate());

// Validate that both dates are valid
if (!start.isValid() || !end.isValid()) {
throw new BadRequestException('Started and Stopped date must be valid dates.');
}

// Only throw error if stoppedAt is smaller than startedAt
if (end.isBefore(start)) {
throw new BadRequestException('Stopped date must be greater than the started date.');
throw new BadRequestException('Stopped date must be greater than or equal to the started date.');
}
}


/**
* Function that returns intersection of 2 arrays
* @param arr1 Array 1
Expand Down Expand Up @@ -469,8 +470,8 @@ export const flatten = (input: any): any => {
const newKey = Array.isArray(value)
? key
: nestedKeys.length > 0
? `${key}.${nestedKeys.join('.')}`
: key;
? `${key}.${nestedKeys.join('.')}`
: key;
return acc.concat(newKey);
}
}, []) || []
Expand Down
Loading

0 comments on commit 1ac0d3c

Please sign in to comment.