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

[Feat] Task views API #8369

Merged
merged 11 commits into from
Oct 9, 2024
1 change: 1 addition & 0 deletions packages/contracts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export * from './task-related-issue-type.model';
export * from './task-size.model';
export * from './task-status.model';
export * from './task-version.model';
export * from './task-view.model';
export * from './task.model';
export * from './daily-plan.model';
export * from './tenant.model';
Expand Down
6 changes: 6 additions & 0 deletions packages/contracts/src/organization-sprint.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import { IRelationalRole } from './role.model';
import { JsonData } from './activity-log.model';
import { IUser } from './user.model';

// Base interface with optional properties
export interface IRelationalOrganizationSprint {
organizationSprint?: IOrganizationSprint;
organizationSprintId?: ID;
}

export interface IOrganizationSprintBase extends IBasePerTenantAndOrganizationEntityModel {
name?: string;
goal?: string;
Expand Down
37 changes: 37 additions & 0 deletions packages/contracts/src/task-view.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
import { IRelationalOrganizationTeam } from './organization-team.model';
import { IRelationalOrganizationProject } from './organization-projects.model';
import { IRelationalOrganizationProjectModule } from './organization-project-module.model';
import { IRelationalOrganizationSprint } from './organization-sprint.model';
import { JsonData } from './activity-log.model';

export interface ITaskViewBase
extends IBasePerTenantAndOrganizationEntityModel,
IRelationalOrganizationTeam,
IRelationalOrganizationProject,
IRelationalOrganizationProjectModule,
IRelationalOrganizationSprint {
name?: string;
description?: string;
visibilityLevel?: VisibilityLevelEnum;
queryParams?: JsonData;
filterOptions?: JsonData;
displayOptions?: JsonData;
properties?: Record<string, boolean>;
isLocked?: boolean;
}

export interface ITaskView extends ITaskViewBase {
name: string; // Ensure name is always defined
}

export interface ITaskViewCreateInput extends ITaskViewBase {}

export interface ITaskViewUpdateInput extends ITaskViewCreateInput {}

export enum VisibilityLevelEnum {
MODULE_AND_SPRINT = 0,
TEAM_AND_PROJECT = 1,
ORGANIZATION = 2,
WORKSPACE = 3
}
13 changes: 9 additions & 4 deletions packages/contracts/src/task.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { IBasePerTenantAndOrganizationEntityModel, IBaseRelationsEntityModel, ID
import { IEmployee } from './employee.model';
import { IInvoiceItem } from './invoice-item.model';
import { IRelationalOrganizationProject } from './organization-projects.model';
import { IOrganizationSprint, IOrganizationSprintTaskHistory } from './organization-sprint.model';
import {
IOrganizationSprint,
IRelationalOrganizationSprint,
IOrganizationSprintTaskHistory
} from './organization-sprint.model';
import { IOrganizationTeam } from './organization-team.model';
import { ITag } from './tag.model';
import { IUser } from './user.model';
Expand All @@ -11,7 +15,10 @@ import { ITaskPriority, TaskPriorityEnum } from './task-priority.model';
import { ITaskSize, TaskSizeEnum } from './task-size.model';
import { IOrganizationProjectModule } from './organization-project-module.model';

export interface ITask extends IBasePerTenantAndOrganizationEntityModel, IRelationalOrganizationProject {
export interface ITask
extends IBasePerTenantAndOrganizationEntityModel,
IRelationalOrganizationProject,
IRelationalOrganizationSprint {
title: string;
number?: number;
public?: boolean;
Expand All @@ -27,8 +34,6 @@ export interface ITask extends IBasePerTenantAndOrganizationEntityModel, IRelati
invoiceItems?: IInvoiceItem[];
teams?: IOrganizationTeam[];
modules?: IOrganizationProjectModule[];
organizationSprint?: IOrganizationSprint;
organizationSprintId?: ID;
taskSprints?: IOrganizationSprint[];
taskSprintHistories?: IOrganizationSprintTaskHistory[];
creator?: IUser;
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ import { CommentModule } from './comment/comment.module';
import { StatsModule } from './stats/stats.module'; // Global Stats Module
import { ReactionModule } from './reaction/reaction.module';
import { ActivityLogModule } from './activity-log/activity-log.module';
import { TaskViewModule } from './tasks/views/view.module';

const { unleashConfig } = environment;

Expand Down Expand Up @@ -445,7 +446,8 @@ if (environment.THROTTLE_ENABLED) {
StatsModule, // Global Stats Module
ReactionModule,
CommentModule,
ActivityLogModule
ActivityLogModule,
TaskViewModule // Task views Module
],
controllers: [AppController],
providers: [
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/core/entities/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ import {
TaskSize,
TaskStatus,
TaskVersion,
TaskView,
Tenant,
TenantSetting,
TimeLog,
Expand Down Expand Up @@ -277,6 +278,7 @@ export const coreEntities = [
TaskSize,
TaskStatus,
TaskVersion,
TaskView,
Tenant,
TenantSetting,
TimeLog,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/core/entities/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export * from '../../tasks/sizes/size.entity';
export * from '../../tasks/statuses/status.entity';
export * from '../../tasks/task.entity';
export * from '../../tasks/versions/version.entity';
export * from '../../tasks/views/view.entity';
export * from '../../tenant/tenant-setting/tenant-setting.entity';
export * from '../../tenant/tenant.entity';
export * from '../../time-off-policy/time-off-policy.entity';
Expand Down
Loading
Loading