[ADF-2451] Reviewed component docs (#3113)

* [ADF-2451] Reviewed component docs

* [ADF-2451] Updated review date on tasklist service docs
This commit is contained in:
Andy Stark
2018-03-22 17:27:30 +00:00
committed by Eugenio Romano
parent 10d437b30b
commit ea0f783015
6 changed files with 274 additions and 690 deletions

View File

@@ -8,6 +8,10 @@ var unist = require("../unistHelpers");
var typescript_1 = require("typescript");
// Max number of characters in the text for the default value column.
var maxDefaultTextLength = 20;
var nameExceptions = {
"datatable.component": "DataTableComponent",
"tasklist.service": "TaskListService"
};
function initPhase(aggData) {
}
exports.initPhase = initPhase;
@@ -214,6 +218,8 @@ function initialCap(str) {
return str[0].toUpperCase() + str.substr(1);
}
function fixAngularFilename(rawName) {
if (nameExceptions[rawName])
return nameExceptions[rawName];
var name = rawName.replace(/\]|\(|\)/g, '');
var fileNameSections = name.split('.');
var compNameSections = fileNameSections[0].split('-');

View File

@@ -12,6 +12,12 @@ import { JsxEmit, isClassDeclaration, PropertyDeclaration } from "typescript";
// Max number of characters in the text for the default value column.
const maxDefaultTextLength = 20;
let nameExceptions = {
"datatable.component": "DataTableComponent",
"tasklist.service": "TaskListService"
}
export function initPhase(aggData) {
}
@@ -301,6 +307,9 @@ function initialCap(str: string) {
function fixAngularFilename(rawName: string) {
if (nameExceptions[rawName])
return nameExceptions[rawName];
var name = rawName.replace(/\]|\(|\)/g, '');
var fileNameSections = name.split('.');

View File

@@ -54,89 +54,92 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck
@ContentChild(DataColumnListComponent)
columnList: DataColumnListComponent;
/* Data source for the table */
/** Data source for the table */
@Input()
data: DataTableAdapter;
/* change the display mode of the table list or gallery */
/** Selects the display mode of the table. Can be "list" or "gallery". */
@Input()
display: string = DisplayMode.List;
/* The rows that the datatable will show */
/** The rows that the datatable will show. */
@Input()
rows: any[] = [];
/* Row selection mode. Can be none, `single` or `multiple`. For `multiple` mode,
/** Row selection mode. Can be none, `single` or `multiple`. For `multiple` mode,
* you can use Cmd (macOS) or Ctrl (Win) modifier key to toggle selection for multiple rows.
*/
@Input()
selectionMode: string = 'single'; // none|single|multiple
/* Toggles multiple row selection, which renders checkboxes at the beginning of each row */
/** Toggles multiple row selection, which renders checkboxes at the beginning of each row. */
@Input()
multiselect: boolean = false;
/* Toggles data actions column */
/** Toggles the data actions column. */
@Input()
actions: boolean = false;
/* Position of the actions dropdown menu. Can be "left" or "right". */
/** Position of the actions dropdown menu. Can be "left" or "right". */
@Input()
actionsPosition: string = 'right'; // left|right
/* Fallback image for row where thumbnail is missing */
/** Fallback image for rows where the thumbnail is missing. */
@Input()
fallbackThumbnail: string;
/* Toggles custom context menu for the component */
/** Toggles custom context menu for the component. */
@Input()
contextMenu: boolean = false;
/* Toggle file drop support for rows (see Upload Directive for further details) */
/** Toggles file drop support for rows (see
* [Upload directive](upload.directive.md) for further details).
*/
@Input()
allowDropFiles: boolean = false;
/* The inline style to apply to every row. See
/** The inline style to apply to every row. See
* [NgStyle](https://angular.io/docs/ts/latest/api/common/index/NgStyle-directive.html)
* docs for more details and usage examples.
*/
@Input()
rowStyle: string;
/* The CSS class to apply to every row */
/** The CSS class to apply to every row. */
@Input()
rowStyleClass: string = '';
/* Toggles the header */
/** Toggles the header. */
@Input()
showHeader: boolean = true;
/* Emitted when user clicks the row */
/** Emitted when the user clicks a row. */
@Output()
rowClick = new EventEmitter<DataRowEvent>();
/* Emitted when user double-clicks the row */
/** Emitted when the user double-clicks a row. */
@Output()
rowDblClick = new EventEmitter<DataRowEvent>();
/* Emitted before context menu is displayed for a row */
/** Emitted before the context menu is displayed for a row. */
@Output()
showRowContextMenu = new EventEmitter<DataCellEvent>();
/* Emitted before actions menu is displayed for a row */
/** Emitted before the actions menu is displayed for a row. */
@Output()
showRowActionsMenu = new EventEmitter<DataCellEvent>();
/* Emitted when row action is executed by user */
/** Emitted when the user executes a row action. */
@Output()
executeRowAction = new EventEmitter<DataRowActionEvent>();
/* Flag that indicates if the datatable is in loading state and needs to show the
/** Flag that indicates if the datatable is in loading state and needs to show the
* loading template (see the docs to learn how to configure a loading template).
*/
@Input()
loading: boolean = false;
/** Flag that indicates if the datatable should show the "no permission" template. */
@Input()
noPermission: boolean = false;

View File

@@ -41,9 +41,9 @@ export class TaskListService {
}
/**
* Return all the filters in the list where the task id belong
* @param taskId - string
* @param filter - FilterRepresentationModel []
* Gets all the filters in the list that belong to a task.
* @param taskId ID of the target task
* @param filterList List of filters to search through
*/
getFilterForTaskById(taskId: string, filterList: FilterRepresentationModel[]): Observable<FilterRepresentationModel> {
return Observable.from(filterList)
@@ -52,8 +52,8 @@ export class TaskListService {
}
/**
* Return the search node for query task based on the given filter
* @param filter - FilterRepresentationModel
* Gets the search query for a task based on the supplied filter.
* @param filter The filter to use
*/
private generateTaskRequestNodeFromFilter(filter: FilterRepresentationModel): TaskQueryRequestRepresentationModel {
let requestNode = {
@@ -66,9 +66,9 @@ export class TaskListService {
}
/**
* Check if a taskId is filtered with the given filter
* @param taskId - string
* @param filter - FilterRepresentationModel
* Checks if a taskId is filtered with the given filter.
* @param taskId ID of the target task
* @param filter The filter you want to check
*/
isTaskRelatedToFilter(taskId: string, filter: FilterRepresentationModel): Observable<FilterRepresentationModel> {
let requestNodeForFilter = this.generateTaskRequestNodeFromFilter(filter);
@@ -79,8 +79,8 @@ export class TaskListService {
}
/**
* Retrieve all the tasks filtered by filterModel
* @param filter - TaskFilterRepresentationModel
* Gets all the tasks matching the supplied query.
* @param requestNode Query to search for tasks
*/
getTasks(requestNode: TaskQueryRequestRepresentationModel): Observable<TaskListModel> {
return Observable.fromPromise(this.callApiTasksFiltered(requestNode))
@@ -91,8 +91,9 @@ export class TaskListService {
}
/**
* Retrieve tasks filtered by filterModel and state
* @param filter - TaskFilterRepresentationModel
* Gets tasks matching a query and state value.
* @param requestNode Query to search for tasks
* @param state Task state. Can be "open" or "completed".
*/
findTasksByState(requestNode: TaskQueryRequestRepresentationModel, state?: string): Observable<TaskListModel> {
if (state) {
@@ -102,8 +103,9 @@ export class TaskListService {
}
/**
* Retrieve all tasks filtered by filterModel and state
* @param filter - TaskFilterRepresentationModel
* Gets all tasks matching a query and state value.
* @param requestNode Query to search for tasks.
* @param state Task state. Can be "open" or "completed".
*/
findAllTaskByState(requestNode: TaskQueryRequestRepresentationModel, state?: string): Observable<TaskListModel> {
if (state) {
@@ -116,8 +118,8 @@ export class TaskListService {
}
/**
* Retrieve all tasks filtered by filterModel irrespective of state
* @param filter - TaskFilterRepresentationModel
* Get all tasks matching the supplied query but ignoring the task state.
* @param requestNode Query to search for tasks
*/
findAllTasksWithoutState(requestNode: TaskQueryRequestRepresentationModel): Observable<TaskListModel> {
return Observable.forkJoin(
@@ -134,8 +136,8 @@ export class TaskListService {
}
/**
* Retrieve all the task details
* @param id - taskId
* Gets details for a task.
* @param taskId ID of the target task.
*/
getTaskDetails(taskId: string): Observable<TaskDetailsModel> {
return Observable.fromPromise(this.callApiTaskDetails(taskId))
@@ -146,8 +148,8 @@ export class TaskListService {
}
/**
* Retrieve all the task's checklist
* @param id - taskId
* Gets the checklist for a task.
* @param id ID of the target task
*/
getTaskChecklist(id: string): Observable<TaskDetailsModel[]> {
return Observable.fromPromise(this.callApiTaskChecklist(id))
@@ -162,7 +164,7 @@ export class TaskListService {
}
/**
* Retrieve all the form shared with this user
* Gets all available reusable forms.
*/
getFormList(): Observable<Form []> {
let opts = {
@@ -181,13 +183,18 @@ export class TaskListService {
}).catch(err => this.handleError(err));
}
/**
* Attaches a form to a task.
* @param taskId ID of the target task
* @param formId ID of the form to add
*/
attachFormToATask(taskId: string, formId: number): Observable<any> {
return Observable.fromPromise(this.apiService.getInstance().activiti.taskApi.attachForm(taskId, {'formId': formId})).catch(err => this.handleError(err));
}
/**
* Add a task
* @param task - TaskDetailsModel
* Adds a subtask (ie, a checklist task) to a parent task.
* @param task The task to add
*/
addTask(task: TaskDetailsModel): Observable<TaskDetailsModel> {
return Observable.fromPromise(this.callApiAddTask(task))
@@ -198,8 +205,8 @@ export class TaskListService {
}
/**
* Delete a task
* @param taskId - string
* Deletes a subtask (ie, a checklist task) from a parent task.
* @param taskId The task to delete
*/
deleteTask(taskId: string): Observable<TaskDetailsModel> {
return Observable.fromPromise(this.callApiDeleteTask(taskId))
@@ -207,8 +214,8 @@ export class TaskListService {
}
/**
* Make the task completed
* @param id - taskId
* Gives completed status to a task.
* @param taskId ID of the target task
*/
completeTask(taskId: string) {
return Observable.fromPromise(this.apiService.getInstance().activiti.taskApi.completeTask(taskId))
@@ -217,8 +224,8 @@ export class TaskListService {
}
/**
* Return the total number of the tasks by filter
* @param requestNode - TaskFilterRepresentationModel
* Gets the total number of the tasks found by a query.
* @param requestNode Query to search for tasks
*/
public getTotalTasks(requestNode: TaskQueryRequestRepresentationModel): Observable<any> {
requestNode.size = 0;
@@ -229,8 +236,8 @@ export class TaskListService {
}
/**
* Create a new standalone task
* @param task - TaskDetailsModel
* Creates a new standalone task.
* @param task Details of the new task
*/
createNewTask(task: TaskDetailsModel): Observable<TaskDetailsModel> {
return Observable.fromPromise(this.callApiCreateTask(task))
@@ -241,9 +248,9 @@ export class TaskListService {
}
/**
* Assign task to user/group
* @param taskId - string
* @param requestNode - any
* Assigns a task to a user or group.
* @param taskId The task to assign
* @param requestNode User or group to assign the task to
*/
assignTask(taskId: string, requestNode: any): Observable<TaskDetailsModel> {
let assignee = {assignee: requestNode.id};
@@ -254,6 +261,11 @@ export class TaskListService {
}).catch(err => this.handleError(err));
}
/**
* Assigns a task to a user.
* @param taskId ID of the task to assign
* @param userId ID of the user to assign the task to
*/
assignTaskByUserId(taskId: string, userId: number): Observable<TaskDetailsModel> {
let assignee = {assignee: userId};
return Observable.fromPromise(this.callApiAssignTask(taskId, assignee))
@@ -264,8 +276,8 @@ export class TaskListService {
}
/**
* Claim a task
* @param id - taskId
* Claims a task for the current user.
* @param taskId ID of the task to claim
*/
claimTask(taskId: string): Observable<TaskDetailsModel> {
return Observable.fromPromise(this.apiService.getInstance().activiti.taskApi.claimTask(taskId))
@@ -273,8 +285,8 @@ export class TaskListService {
}
/**
* Unclaim a task
* @param id - taskId
* Unclaims a task for the current user.
* @param taskId ID of the task to unclaim
*/
unclaimTask(taskId: string): Observable<TaskDetailsModel> {
return Observable.fromPromise(this.apiService.getInstance().activiti.taskApi.unclaimTask(taskId))
@@ -282,8 +294,9 @@ export class TaskListService {
}
/**
* Update due date
* @param dueDate - the new due date
* Updates the details (name, description, due date) for a task.
* @param taskId ID of the task to update
* @param updated Data to update the task (as a `TaskUpdateRepresentation` instance).
*/
updateTask(taskId: any, updated): Observable<TaskDetailsModel> {
return Observable.fromPromise(this.apiService.getInstance().activiti.taskApi.updateTask(taskId, updated))
@@ -291,8 +304,8 @@ export class TaskListService {
}
/**
* fetch the Task Audit information as a pdf
* @param taskId - the task id
* Fetches the Task Audit information in PDF format.
* @param taskId ID of the target task
*/
fetchTaskAuditPdfById(taskId: string): Observable<Blob> {
return Observable.fromPromise(this.apiService.getInstance().activiti.taskApi.getTaskAuditPdf(taskId))
@@ -300,8 +313,8 @@ export class TaskListService {
}
/**
* fetch the Task Audit information in a json format
* @param taskId - the task id
* Fetch the Task Audit information in JSON format
* @param taskId ID of the target task
*/
fetchTaskAuditJsonById(taskId: string): Observable<any> {
return Observable.fromPromise(this.apiService.getInstance().activiti.taskApi.getTaskAuditJson(taskId))