Skip to content

Commit

Permalink
Merge pull request #8530 from ever-co/feat/#8131-project-modules-mana…
Browse files Browse the repository at this point in the history
…gement

[Feature] Organization Project Modules management (Created a modal for module creation && Implemented the logic for module creation)
  • Loading branch information
rahul-rocket authored Nov 9, 2024
2 parents faf89ba + d0885c3 commit c2d62b6
Show file tree
Hide file tree
Showing 24 changed files with 878 additions and 45 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<nb-card
[nbSpinner]="loading"
nbSpinnerStatus="primary"
nbSpinnerSize="large"
>
<nb-card [nbSpinner]="loading" nbSpinnerStatus="primary" nbSpinnerSize="large">
<nb-card-header class="main-header pb-0">
<div class="main-header">
<h4>
Expand Down Expand Up @@ -35,9 +31,7 @@ <h4>
</div>
<div class="pagination-container">
<ng-container *ngIf="smartTableSource">
<ngx-pagination
[source]="smartTableSource"
></ngx-pagination>
<ngx-pagination [source]="smartTableSource"></ngx-pagination>
</ng-container>
</div>
</ng-template>
Expand Down Expand Up @@ -70,7 +64,13 @@ <h4>

<!-- Actions Button -->
<ng-template #actionButtons>
<ng-template [ngxPermissionsOnly]="[PermissionsEnum.ALL_ORG_EDIT, PermissionsEnum.ORG_PROJECT_EDIT, PermissionsEnum.ORG_PROJECT_DELETE]">
<ng-template
[ngxPermissionsOnly]="[
PermissionsEnum.ALL_ORG_EDIT,
PermissionsEnum.ORG_PROJECT_EDIT,
PermissionsEnum.ORG_PROJECT_DELETE
]"
>
<div class="actions">
<ng-template [ngxPermissionsOnly]="['ALL_ORG_EDIT', 'ORG_PROJECT_EDIT']">
<button
Expand All @@ -85,6 +85,19 @@ <h4>
{{ 'BUTTONS.EDIT' | translate }}
</button>
</ng-template>
<ng-template [ngxPermissionsOnly]="['ALL_ORG_EDIT', 'ORG_PROJECT_EDIT']">
<button
nbButton
status="basic"
class="action primary"
size="small"
(click)="createProjectModuleDialog(selectedProject)"
[disabled]="disableButton"
>
<nb-icon class="mr-1" icon="plus-circle-outline"></nb-icon>
{{ 'BUTTONS.ADD_MODULE' | translate }}
</button>
</ng-template>
<ng-template [ngxPermissionsOnly]="[PermissionsEnum.ALL_ORG_EDIT, PermissionsEnum.ORG_PROJECT_DELETE]">
<button
[nbTooltip]="'BUTTONS.DELETE' | translate"
Expand All @@ -105,13 +118,7 @@ <h4>
<!-- Visible Button -->
<ng-template #visibleButton>
<ng-template [ngxPermissionsOnly]="[PermissionsEnum.ALL_ORG_EDIT, PermissionsEnum.ORG_PROJECT_ADD]">
<button
type="button"
nbButton
status="success"
size="small"
(click)="navigateToProject()"
>
<button type="button" nbButton status="success" size="small" (click)="navigateToProject()">
<nb-icon icon="plus-outline"></nb-icon>
{{ 'BUTTONS.ADD' | translate }}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
ToastrService
} from '@gauzy/ui-core/core';
import {
AddProjectModuleDialogComponent,
CardGridComponent,
ContactLinksComponent,
DateViewComponent,
Expand Down Expand Up @@ -610,4 +611,31 @@ export class ProjectListComponent extends PaginationFilterBaseComponent implemen
// Navigate to the specified path
this._router.navigate(path);
}

/**
* Opens a dialog for creating a new project module
* @param project The project for which to create a module
* @returns Promise that resolves when the dialog is closed
*/
public async createProjectModuleDialog(project: IOrganizationProject): Promise<void> {
try {
const result = await firstValueFrom(
this._dialogService.open(AddProjectModuleDialogComponent, {
context: {
project,
createModule: true
}
}).onClose
);

if (result) {
// Refresh the project list or handle the result as needed
this._refresh$.next(true);
this.project$.next(true);
}
} catch (error) {
console.error('Error while creating project module', error?.message);
this._errorHandlingService.handleError(error);
}
}
}
4 changes: 3 additions & 1 deletion apps/gauzy/src/app/pages/projects/projects.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import {
SmartDataViewLayoutModule,
CardGridModule,
EntityWithMembersModule,
ProjectMutationModule
ProjectMutationModule,
AddProjectModuleDialogModule
} from '@gauzy/ui-core/shared';
import { ProjectsRoutingModule } from './projects-routing.module';
import { TableComponentsModule } from '@gauzy/ui-core/shared';
Expand Down Expand Up @@ -43,6 +44,7 @@ import { ProjectListComponent } from './components/project-list/list.component';
SmartDataViewLayoutModule,
CardGridModule,
ProjectMutationModule,
AddProjectModuleDialogModule,
NgxPermissionsModule.forChild()
],
declarations: [
Expand Down
3 changes: 2 additions & 1 deletion packages/ui-core/core/src/lib/services/organization/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export * from './organization-sprint.service';
export * from './organization-task-setting.service';
export * from './organization-team-store.service';
export * from './organization-teams.service';
export * from './organization-vendors.service';
export * from './organization-vendors.service';
export * from './organization-projects-module.service';
25 changes: 24 additions & 1 deletion packages/ui-core/i18n/assets/i18n/ach.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@
"COLLAPSE": "crwdns11461:0crwdne11461:0",
"EXPAND": "crwdns11463:0crwdne11463:0",
"SHOW_MORE": "crwdns11483:0crwdne11483:0",
"START_WORK": "crwdns11525:0crwdne11525:0"
"START_WORK": "crwdns11525:0crwdne11525:0",
"ADD_MODULE": "Yamo Module"
},
"SM_TABLE": {
"NO_DATA": {
Expand Down Expand Up @@ -2901,6 +2902,28 @@
},
"PROJECT_MANAGEMENT_PAGE": {
"THIS_TAB_WILL_SHOW_PROJECT_MANAGEMENT_CHARTS_AND_AGGREGATED_DATA": "crwdns10591:0crwdne10591:0"
,
"PROJECT_MODULE": {
"PROJECT": "Omwoky",
"SELECT_PROJECT": "Yera omwoky",
"STATUS": "Kibye",
"TEAM_MEMBERS": "Abatuuk",
"TEAMS": "Mbangu",
"SELECT_TEAMS": "Yera mbangu",
"CHOOSE_TEAMS": "Kwany mbangu",
"NAME": "Nying",
"ENTER_NAME": "Kel nying",
"PARENT_MODULE": "Omwoky me lutino",
"SELECT_PARENT": "Yera omwoky me lutino",
"START_DATE": "Dwe kede ka",
"SELECT_START_DATE": "Yera dwe kede ka",
"END_DATE": "Dwe kede mogo",
"SELECT_END_DATE": "Yera dwe kede mogo",
"DESCRIPTION": "Kweyo",
"IS_FAVORITE": "Fɛrɛbɔ"

}

},
"SETTINGS_FEATURES": {
"INVOICE": "crwdns10593:0crwdne10593:0",
Expand Down
24 changes: 22 additions & 2 deletions packages/ui-core/i18n/assets/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@
"ACTIVATE": "تفعيل",
"ADD_PLUGIN": "إضافة ملحق",
"LOAD_PLUGIN": "تحميل المكون الإضافي",
"FROM_CDN": "من CDN"
"FROM_CDN": "من CDN",
"ADD_MODULE": "إضافة وحدة"
},
"SM_TABLE": {
"NO_DATA": {
Expand Down Expand Up @@ -3152,7 +3153,26 @@
}
},
"PROJECT_MANAGEMENT_PAGE": {
"THIS_TAB_WILL_SHOW_PROJECT_MANAGEMENT_CHARTS_AND_AGGREGATED_DATA": "سيعرض هذا الجدول الرسوم البيانية لإدارة المشروع والبيانات المجمعة."
"THIS_TAB_WILL_SHOW_PROJECT_MANAGEMENT_CHARTS_AND_AGGREGATED_DATA": "سيعرض هذا الجدول الرسوم البيانية لإدارة المشروع والبيانات المجمعة.",
"PROJECT_MODULE": {
"PROJECT": "مشروع",
"SELECT_PROJECT": "اختر مشروعًا",
"STATUS": "الحالة",
"TEAM_MEMBERS": "أعضاء الفريق",
"TEAMS": "فرق",
"SELECT_TEAMS": "اختر الفرق",
"CHOOSE_TEAMS": "اختيار الفرق",
"NAME": "الاسم",
"ENTER_NAME": "أدخل الاسم",
"PARENT_MODULE": "الوحدة الأصلية",
"SELECT_PARENT": "اختر الوحدة الأصلية",
"START_DATE": "تاريخ البدء",
"SELECT_START_DATE": "اختر تاريخ البدء",
"END_DATE": "تاريخ الانتهاء",
"SELECT_END_DATE": "اختر تاريخ الانتهاء",
"DESCRIPTION": "الوصف",
"IS_FAVORITE": "مفضل"
}
},
"SETTINGS_FEATURES": {
"INVOICE": "فاتورة",
Expand Down
24 changes: 22 additions & 2 deletions packages/ui-core/i18n/assets/i18n/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@
"ACTIVATE": "Активирайте",
"ADD_PLUGIN": "Добавете плъгин",
"LOAD_PLUGIN": "Зареди плъгин",
"FROM_CDN": "От CDN"
"FROM_CDN": "От CDN",
"ADD_MODULE": "Добавяне на модул"
},
"SM_TABLE": {
"NO_DATA": {
Expand Down Expand Up @@ -3206,7 +3207,26 @@
"CATEGORY_EDIT_DELETED": "Category was removed"
},
"PROJECT_MANAGEMENT_PAGE": {
"THIS_TAB_WILL_SHOW_PROJECT_MANAGEMENT_CHARTS_AND_AGGREGATED_DATA": "This tab will show project management charts and aggregated data."
"THIS_TAB_WILL_SHOW_PROJECT_MANAGEMENT_CHARTS_AND_AGGREGATED_DATA": "This tab will show project management charts and aggregated data.",
"PROJECT_MODULE": {
"PROJECT": "Проект",
"SELECT_PROJECT": "Изберете проект",
"STATUS": "Статус",
"TEAM_MEMBERS": "Членове на екипа",
"TEAMS": "Отбори",
"SELECT_TEAMS": "Изберете отбори",
"CHOOSE_TEAMS": "Изберете отбори",
"NAME": "Име",
"ENTER_NAME": "Въведете име",
"PARENT_MODULE": "Родителски модул",
"SELECT_PARENT": "Изберете родителски модул",
"START_DATE": "Начална дата",
"SELECT_START_DATE": "Изберете начална дата",
"END_DATE": "Крайна дата",
"SELECT_END_DATE": "Изберете крайна дата",
"DESCRIPTION": "Описание",
"IS_FAVORITE": "Любим"
}
},
"SETTINGS_FEATURES": {
"INVOICE": "Фактура",
Expand Down
24 changes: 22 additions & 2 deletions packages/ui-core/i18n/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@
"ACTIVATE": "Aktivieren",
"ADD_PLUGIN": "Plugin hinzufügen",
"LOAD_PLUGIN": "Plugin laden",
"FROM_CDN": "Von CDN"
"FROM_CDN": "Von CDN",
"ADD_MODULE": "Modul hinzufügen"
},
"SM_TABLE": {
"NO_DATA": {
Expand Down Expand Up @@ -3150,7 +3151,26 @@
}
},
"PROJECT_MANAGEMENT_PAGE": {
"THIS_TAB_WILL_SHOW_PROJECT_MANAGEMENT_CHARTS_AND_AGGREGATED_DATA": "Dieses Tab zeigt Projektmanagementdiagramme und zusammengefasste Daten."
"THIS_TAB_WILL_SHOW_PROJECT_MANAGEMENT_CHARTS_AND_AGGREGATED_DATA": "Dieses Tab zeigt Projektmanagementdiagramme und zusammengefasste Daten.",
"PROJECT_MODULE": {
"PROJECT": "Projekt",
"SELECT_PROJECT": "Projekt auswählen",
"STATUS": "Status",
"TEAM_MEMBERS": "Teammitglieder",
"TEAMS": "Teams",
"SELECT_TEAMS": "Teams auswählen",
"CHOOSE_TEAMS": "Wählen Sie Teams",
"NAME": "Name",
"ENTER_NAME": "Name eingeben",
"PARENT_MODULE": "Übergeordnetes Modul",
"SELECT_PARENT": "Übergeordnetes Modul auswählen",
"START_DATE": "Startdatum",
"SELECT_START_DATE": "Startdatum wählen",
"END_DATE": "Enddatum",
"SELECT_END_DATE": "Enddatum wählen",
"DESCRIPTION": "Beschreibung",
"IS_FAVORITE": "Favorit"
}
},
"SETTINGS_FEATURES": {
"INVOICE": "Rechnung",
Expand Down
28 changes: 26 additions & 2 deletions packages/ui-core/i18n/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@
"ACTIVATE": "Activate",
"ADD_PLUGIN": "Add Plugin",
"LOAD_PLUGIN": "Load Plugin",
"FROM_CDN": "From CDN"
"FROM_CDN": "From CDN",
"ADD_MODULE": "Add Module"
},
"SM_TABLE": {
"NO_DATA": {
Expand Down Expand Up @@ -3277,7 +3278,30 @@
}
},
"PROJECT_MANAGEMENT_PAGE": {
"THIS_TAB_WILL_SHOW_PROJECT_MANAGEMENT_CHARTS_AND_AGGREGATED_DATA": "This tab will show project management charts and aggregated data."
"THIS_TAB_WILL_SHOW_PROJECT_MANAGEMENT_CHARTS_AND_AGGREGATED_DATA": "This tab will show project management charts and aggregated data.",
"PROJECT_MODULE": {
"PROJECT": "Project",
"SELECT_PROJECT": "Select a project",
"STATUS": "Status",
"TEAM_MEMBERS": "Team Members",
"TEAMS": "Teams",
"SELECT_TEAMS": "Select Teams",
"CHOOSE_TEAMS": "Choose teams",
"NAME": "Module Name",
"ENTER_NAME": "Enter the module name",
"PARENT_MODULE": "Parent Module",
"SELECT_PARENT": "Select a parent module",
"START_DATE": "Start Date",
"SELECT_START_DATE": "Select start date",
"END_DATE": "End Date",
"SELECT_END_DATE": "Select end date",
"DESCRIPTION": "Description",
"MANAGER": "Manager",
"SELECT_MANAGER": "Select a manager",
"ORGANIZATION_SPRINTS": "Organization Sprints",
"SELECT_SPRINTS": "Select sprints",
"IS_FAVORITE": "Favorite"
}
},
"SETTINGS_FEATURES": {
"INVOICE": "Invoice",
Expand Down
24 changes: 22 additions & 2 deletions packages/ui-core/i18n/assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@
"ACTIVATE": "Activar",
"ADD_PLUGIN": "Añadir plugin",
"LOAD_PLUGIN": "Cargar Plugin",
"FROM_CDN": "Desde CDN"
"FROM_CDN": "Desde CDN",
"ADD_MODULE": "Añadir módulo"
},
"SM_TABLE": {
"NO_DATA": {
Expand Down Expand Up @@ -3156,7 +3157,26 @@
}
},
"PROJECT_MANAGEMENT_PAGE": {
"THIS_TAB_WILL_SHOW_PROJECT_MANAGEMENT_CHARTS_AND_AGGREGATED_DATA": "Esta pestaña mostrará gráficos de gestión de proyectos y datos agregados."
"THIS_TAB_WILL_SHOW_PROJECT_MANAGEMENT_CHARTS_AND_AGGREGATED_DATA": "Esta pestaña mostrará gráficos de gestión de proyectos y datos agregados.",
"PROJECT_MODULE": {
"PROJECT": "Proyecto",
"SELECT_PROJECT": "Seleccionar un proyecto",
"STATUS": "Estado",
"TEAM_MEMBERS": "Miembros del equipo",
"TEAMS": "Equipos",
"SELECT_TEAMS": "Seleccionar equipos",
"CHOOSE_TEAMS": "Elegir equipos",
"NAME": "Nombre",
"ENTER_NAME": "Ingrese el nombre",
"PARENT_MODULE": "Módulo padre",
"SELECT_PARENT": "Seleccionar módulo padre",
"START_DATE": "Fecha de inicio",
"SELECT_START_DATE": "Seleccionar fecha de inicio",
"END_DATE": "Fecha de finalización",
"SELECT_END_DATE": "Seleccionar fecha de finalización",
"DESCRIPTION": "Descripción",
"IS_FAVORITE": "Favorito"
}
},
"SETTINGS_FEATURES": {
"INVOICE": "Factura",
Expand Down
Loading

0 comments on commit c2d62b6

Please sign in to comment.