Documentation

main
manueltauber 2023-06-28 12:44:00 +02:00
parent 5f38657a9e
commit 01e2d10fc7
1 changed files with 69 additions and 42 deletions

View File

@ -201,7 +201,7 @@ export class NttGanttComponent implements OnInit {
* This function is triggered when a pageEvent is thrown respectively a user changes the page on the paginator
* @param start begin of slice
* @param end end of slice
*/
*/
public mapTasksToResources(start : number, end : number){
this.data = [];
this.resources = this.allResources;
@ -215,7 +215,7 @@ export class NttGanttComponent implements OnInit {
* The function refreshData fetches a new changes Array from the backend, therefore the mapRequestJSON function is called to map the requestJSON with all filter and sort parameters.
* Furthermore it evaluates the result if the applied filters delivered any Results.
* This function is the most called Funktion in the whole project, it is triggered by a pageEvent, when a filter gets applied and much more...
*/
*/
refreshData(){
this.showNoResultsError = false;
this.renderGantt = false;
@ -238,7 +238,7 @@ export class NttGanttComponent implements OnInit {
/**
* The function clearFilter clears allFilter parameters and set them to inital values, then it triggers the refreshData function to fetch the changes without any filters except the supportGroup filter.
* This function is triggered if the user disables the apply filter switch
*/
*/
clearFilter(){
this.filters = null;
this.filterEnabled = false;
@ -246,11 +246,11 @@ export class NttGanttComponent implements OnInit {
this.sortEnabled = false;
this.refreshData();
}
/**
/**
* The function mapRequestJSON maps the requestObject for the refreshData function, it evaluates if filters or sort parameters are set.
* Furtheremore it adds the sliceStart and sliceEnd values of the paginator to the requestObject, because the frontend only delivers the changes that can be displayed on one selected page of the paginator.
* If no filter is applied the function sets a default supportGroup filter, so that the user gets only changes displayed, which are in his supportGroup.
*/
*/
mapRequestJSON(){
let request =
{
@ -265,10 +265,10 @@ export class NttGanttComponent implements OnInit {
return request;
}
/**
* The function applyFilter applies the selected filters and refrehses the gantt chart with the new filters.
* The function applyFilter applies the selected filters and refrehses the gantt chart with the new filters.
* Furthermore it stores the old filters in a help variable to restore it when to user turns the apply filter switch back on.
* This function is triggered by the a filter action of the filterdialog, or if the user switches the apply filter switch.
*/
*/
applyFilter(){
if(this.filterEnabled){
this.oldFilters = this.filters
@ -282,10 +282,10 @@ export class NttGanttComponent implements OnInit {
}
}
/**
/**
* The function openFilterDialog triggers the opening of the filterDialog, recieves the results of the filterDialog and refrehses the gantt chart.
* This function is triggered by the filter button.
*/
*/
openFilterDialog(){
let dialogRef = FilterDialogComponent;
this.matDialog.open(dialogRef,
@ -302,26 +302,20 @@ export class NttGanttComponent implements OnInit {
/**############################### NTT Gantt Component Helper Functions /**###############################*/
/**
* The function languageChange executes a language change in the language service and triggers the initLanguage function.
* This function is triggered by a manual language of the user.
*/
public languageChange(args: any){
this.languageService.languageChange(args.value),
this.initLanguge();
}
public changeScalar(){
if(this.selectedScalar == this.scalars[0]){
this.timelineSettings = {topTier: {unit: 'Week'}, bottomTier: {format: 'dd', unit: 'Day', count: 1}};
this.renderplanTime = false;
}
if(this.selectedScalar == this.scalars[1]){
this.timelineSettings = {topTier: {unit: 'Month'}, bottomTier: {format: 'WW', unit: 'Week', count: 1}};
this.renderplanTime = true;
}
if(this.selectedScalar == this.scalars[2]){
this.timelineSettings = {topTier: {unit: 'Year'}, bottomTier: {format: 'MM',unit: 'Month',count: 1}};
this.renderplanTime = false;
}
}
/**
* The function initLanguge executes a language change for the ntt gantt component. Therefore the time scalar and the gantt columns get the corresponding values determined by the selected language.
* This function is triggered by the ngOnInit function or the languageChange function
* @param initial determines if the function is initially trigger by the ngOnInit function, in all other cases the gantt chart should be refrehed
*/
initLanguge(initial: boolean = false){
if(this.languageService.language == 'DE'){
@ -339,6 +333,24 @@ export class NttGanttComponent implements OnInit {
}
}
/**
* The function changeScalar executes a change of the displayed time scalar.
* This function is triggered if the user changes the time scalar.
*/
public changeScalar(){
if(this.selectedScalar == this.scalars[0]){
this.timelineSettings = {topTier: {unit: 'Week'}, bottomTier: {format: 'dd', unit: 'Day', count: 1}};
this.renderplanTime = false;
}
if(this.selectedScalar == this.scalars[1]){
this.timelineSettings = {topTier: {unit: 'Month'}, bottomTier: {format: 'WW', unit: 'Week', count: 1}};
this.renderplanTime = true;
}
if(this.selectedScalar == this.scalars[2]){
this.timelineSettings = {topTier: {unit: 'Year'}, bottomTier: {format: 'MM',unit: 'Month',count: 1}};
this.renderplanTime = false;
}
}
/**############################### NTT Gantt Component EVENTS /**###############################*/
@ -477,6 +489,7 @@ export class NttGanttComponent implements OnInit {
}
/**############################### Syncfusion Framework EVENTS /**###############################*/
/**
* The function queryTaskbarInfo catches the corresponding syncfsuions event and colors the respective diamond depending on the status
* @param args event arguments from the syncfusion gantt chart
@ -520,9 +533,9 @@ export class NttGanttComponent implements OnInit {
}
/**
* The function taskbarEdited catches the corresponding syncfsuions event and cancels the user action if the isFixed flag of a task (Date) is set true
* If the isFixed flag is false, it triggers the dataService to update the moved date
* @param args event arguments from the syncfusion gantt chart
* The function taskbarEdited catches the corresponding syncfsuions event and cancels the user action if the isFixed flag of a task (Date) is set true.
* If the isFixed flag is false, it triggers the dataService to update the moved date.
* @param args event arguments from the syncfusion gantt chart.
*/
public taskbarEdited(args: any){
if(args.data.taskData.isFixed !== false ) {
@ -541,8 +554,8 @@ export class NttGanttComponent implements OnInit {
}
/**
* The function taskbarEditing catches the corresponding syncfsuions event and cancels the user action if the isFixed flag of a task (Date) is set true
* @param args event arguments from the syncfusion gantt chart
* The function taskbarEditing catches the corresponding syncfsuions event and cancels the user action if the isFixed flag of a task (Date) is set true.
* @param args event arguments from the syncfusion gantt chart.
*/
public taskbarEditing(args: any) {
if(args.data.taskData.isFixed !== false ) {
@ -550,6 +563,10 @@ export class NttGanttComponent implements OnInit {
}
}
/**
* The function taskbarEditing catches the corresponding syncfsuions event and executes a query operation to synchronize the scrollbars of the main gannt chart and the planTimeBart gantt chart.
* @param args event arguments from the syncfusion gantt chart.
*/
public actionComplete(args: any){
if (args.action === 'HorizontalScroll') {
let elem = document.querySelector(
@ -561,24 +578,24 @@ export class NttGanttComponent implements OnInit {
}
/**
* The function load catches the corresponding syncfsuions event and triggers the loading spinner to start while the gantt chart is refrehshing
* @param args event arguments from the syncfusion gantt chart
* The function load catches the corresponding syncfsuions event and triggers the loading spinner to start while the gantt chart is refrehshing.
* @param args event arguments from the syncfusion gantt chart.
*/
public load(args: any) {
this.spin = true;
}
/**
* The function dataBound catches the corresponding syncfsuions event and stops the loading spinner
* @param args event arguments from the syncfusion gantt chart
* The function dataBound catches the corresponding syncfsuions event and stops the loading spinner.
* @param args event arguments from the syncfusion gantt chart.
*/
public dataBound(args: any) {
this.spin = false;
}
/**
* The function created catches the corresponding syncfsuions event and stops the internal loading spinner
* @param args event arguments from the syncfusion gantt chart
* The function created catches the corresponding syncfsuions event and stops the internal loading spinner.
* @param args event arguments from the syncfusion gantt chart.
*/
public created(args: any) {
this.ganttDefault.hideSpinner();
@ -586,16 +603,26 @@ export class NttGanttComponent implements OnInit {
}
/**
* The function onExpand catches the corresponding syncfsuions event and avoids a chart row from beeing expanded by the user
* @param args event arguments from the syncfusion gantt chart
* The function onExpand catches the corresponding syncfsuions event and avoids a chart row from beeing expanded by the user.
* @param args event arguments from the syncfusion gantt chart.
*/
public onExpand(args: any){
args.cancel = true;
}
/**
* The function onResizing catches the corresponding syncfsuions event and stores the actual splitter postition to synchronize the splitters of the main gannt chart and the planTimeBart gantt chart.
* @param args event arguments from the syncfusion gantt chart.
*/
public onResizing(args){
let width = '' + args.paneSize[0]+'px';
this.splitterSettings = {position: width};
}
/**
* The function actionBegin catches the corresponding syncfsuions event applies a sort by the selected column and refrehses the gantt chart or opens the Change Package direktly in Remedy if the user doubleclicks on a main date.
* @param args event arguments from the syncfusion gantt chart.
*/
public actionBegin(args: any) {
if(args.dialogModel){
args.cancel = true;
@ -640,8 +667,8 @@ export class NttGanttComponent implements OnInit {
}
/**
* The function rowSelected catches the corresponding syncfsuions event and checks if all selected resources (changes) have the same status, then it displays the corresponding buttons
* @param args event arguments from the syncfusion gantt chart
* The function rowSelected catches the corresponding syncfsuions event and checks if all selected resources (changes) have the same status, then it displays the corresponding buttons
* @param args event arguments from the syncfusion gantt chart
*/
public rowSelected(args: any) {
this.approvalPending = false;
@ -740,9 +767,9 @@ export class NttGanttComponent implements OnInit {
}
/**
* The function rowDeselected catches the corresponding syncfsuions event
* When a line is deselected, it is checked if all resource states are equal after deselecting a resource, if they are equal then the respective buttons are displayed
* @param args event arguments from the syncfusion gantt chart
* The function rowDeselected catches the corresponding syncfsuions event
* When a line is deselected, it is checked if all resource states are equal after deselecting a resource, if they are equal then the respective buttons are displayed
* @param args event arguments from the syncfusion gantt chart
*/
public rowDeselected(args: any){
this.selectedRescourceIds.forEach((element,index)=>{