[ADF-1769] Added prop tables and fixed script (#2896)

* [ADF-1769] Added prop tables and fixed script

* [ADF-1769] Corrected JSDoc formatting errors

* [ADF-1769] Restored default column to prop tables
This commit is contained in:
Andy Stark
2018-01-31 09:22:05 +00:00
committed by Eugenio Romano
parent 8a4959d172
commit 900fd70d63
56 changed files with 601 additions and 519 deletions

View File

@@ -38,8 +38,11 @@ function updatePhase(tree, pathname, aggData) {
});
}
}
return true;
}
else {
return false;
}
return true;
}
exports.updatePhase = updatePhase;
function initialCap(str) {
@@ -87,14 +90,15 @@ function getPropDataFromClassChain(checker, classDec, inputs, outputs) {
// Main class
getPropDataFromClass(checker, classDec, inputs, outputs);
// Inherited classes
for (var _i = 0, _a = classDec.heritageClauses; _i < _a.length; _i++) {
var hc = _a[_i];
var hcType = checker.getTypeFromTypeNode(hc.types[0]);
console.log(checker.getFullyQualifiedName(hcType.symbol));
for (var _b = 0, _c = hcType.symbol.declarations; _b < _c.length; _b++) {
var dec = _c[_b];
if (typescript_1.isClassDeclaration(dec)) {
getPropDataFromClassChain(checker, dec, inputs, outputs);
if (classDec.heritageClauses) {
for (var _i = 0, _a = classDec.heritageClauses; _i < _a.length; _i++) {
var hc = _a[_i];
var hcType = checker.getTypeFromTypeNode(hc.types[0]);
for (var _b = 0, _c = hcType.symbol.declarations; _b < _c.length; _b++) {
var dec = _c[_b];
if (typescript_1.isClassDeclaration(dec)) {
getPropDataFromClassChain(checker, dec, inputs, outputs);
}
}
}
}
@@ -147,7 +151,7 @@ function buildInputsTable(inputs) {
unist.makeTableRow([
unist.makeTableCell([unist.makeText("Name")]),
unist.makeTableCell([unist.makeText("Type")]),
// unist.makeTableCell([unist.makeText("Default value")]),
unist.makeTableCell([unist.makeText("Default value")]),
unist.makeTableCell([unist.makeText("Description")])
])
];
@@ -161,15 +165,23 @@ function buildInputsTable(inputs) {
pDesc = pDesc.replace(/[\n\r]+/, " ");
}
var descCellContent = remark().parse(pDesc).children;
var defaultCellContent;
if (pDefault) {
/*
descCellContent.push(unist.makeHTML("<br/>"));
descCellContent.push(unist.makeText(" Default value: "));
descCellContent.push(unist.makeInlineCode(pDefault));
*/
defaultCellContent = unist.makeInlineCode(pDefault);
}
else {
defaultCellContent = unist.makeText("");
}
var cells = [
unist.makeTableCell([unist.makeText(pName)]),
unist.makeTableCell([unist.makeInlineCode(pType)]),
//unist.makeTableCell([unist.makeText(pDefault)]),
//unist.makeTableCell([unist.makeInlineCode(pDefault)]),
unist.makeTableCell([defaultCellContent]),
unist.makeTableCell(descCellContent)
];
rows.push(unist.makeTableRow(cells));

View File

@@ -47,9 +47,13 @@ export function updatePhase(tree, pathname, aggData) {
});
}
}
return true;
} else {
return false;
}
return true;
}
@@ -122,14 +126,14 @@ function getPropDataFromClassChain(
getPropDataFromClass(checker, classDec, inputs, outputs);
// Inherited classes
for(const hc of classDec.heritageClauses) {
let hcType = checker.getTypeFromTypeNode(hc.types[0]);
console.log(checker.getFullyQualifiedName(hcType.symbol));
for (const dec of hcType.symbol.declarations) {
if (isClassDeclaration(dec)) {
getPropDataFromClassChain(checker, dec, inputs, outputs);
if (classDec.heritageClauses) {
for(const hc of classDec.heritageClauses) {
let hcType = checker.getTypeFromTypeNode(hc.types[0]);
for (const dec of hcType.symbol.declarations) {
if (isClassDeclaration(dec)) {
getPropDataFromClassChain(checker, dec, inputs, outputs);
}
}
}
}
@@ -201,7 +205,7 @@ function buildInputsTable(inputs: any[]) {
unist.makeTableRow([
unist.makeTableCell([unist.makeText("Name")]),
unist.makeTableCell([unist.makeText("Type")]),
// unist.makeTableCell([unist.makeText("Default value")]),
unist.makeTableCell([unist.makeText("Default value")]),
unist.makeTableCell([unist.makeText("Description")])
])
];
@@ -219,16 +223,24 @@ function buildInputsTable(inputs: any[]) {
var descCellContent = remark().parse(pDesc).children;
var defaultCellContent;
if (pDefault) {
/*
descCellContent.push(unist.makeHTML("<br/>"));
descCellContent.push(unist.makeText(" Default value: "));
descCellContent.push(unist.makeInlineCode(pDefault));
*/
defaultCellContent = unist.makeInlineCode(pDefault);
} else {
defaultCellContent = unist.makeText("");
}
var cells = [
unist.makeTableCell([unist.makeText(pName)]),
unist.makeTableCell([unist.makeInlineCode(pType)]),
//unist.makeTableCell([unist.makeText(pDefault)]),
//unist.makeTableCell([unist.makeInlineCode(pDefault)]),
unist.makeTableCell([defaultCellContent]),
unist.makeTableCell(descCellContent)
];

View File

@@ -26,10 +26,11 @@ import { RatingService } from './services/rating.service';
encapsulation: ViewEncapsulation.None
})
export class LikeComponent implements OnChanges {
/** Identifier of a node to apply likes to. */
@Input()
nodeId: string;
/** Emitted when the "vote" gets changed. */
@Output()
changeVote = new EventEmitter();

View File

@@ -32,6 +32,7 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy {
@ViewChild(FileUploadingListComponent)
uploadList: FileUploadingListComponent;
/** Dialog position. Can be 'left' or 'right'. */
@Input()
position: string = 'right';

View File

@@ -54,6 +54,11 @@ export class FormFieldComponent implements OnInit, OnDestroy {
@ViewChild('container', { read: ViewContainerRef })
container: ViewContainerRef;
/** Contains all the necessary data needed to determine what UI Widget
* to use when rendering the field in the form. You would typically not
* create this data manually but instead create the form in APS and export
* it to get to all the `FormFieldModel` definitions.
*/
@Input()
field: FormFieldModel = null;

View File

@@ -26,6 +26,7 @@ import { FormService } from './../services/form.service';
})
export class FormListComponent implements OnChanges {
/** The array that contains the information to show inside the list. */
@Input()
forms: any [] = [];

View File

@@ -41,81 +41,109 @@ export class FormComponent implements OnInit, OnChanges {
static COMPLETE_BUTTON_COLOR: string = 'primary';
static COMPLETE_OUTCOME_NAME: string ='Complete'
/** Underlying form model instance. */
@Input()
form: FormModel;
/** Task id to fetch corresponding form and values. */
@Input()
taskId: string;
/** Content Services node ID for the form metadata. */
@Input()
nodeId: string;
/** The id of the form definition to load and display with custom values. */
@Input()
formId: string;
/** Name of the form definition to load and display with custom values. */
@Input()
formName: string;
/** Toggle saving of form metadata. */
@Input()
saveMetadata: boolean = false;
/** Custom form values map to be used with the rendered form. */
@Input()
data: FormValues;
/** Path of the folder where the metadata will be stored. */
@Input()
path: string;
/** Name to assign to the new node where the metadata are stored. */
@Input()
nameNode: string;
/** Toggle rendering of the form title. */
@Input()
showTitle: boolean = true;
/** Toggle rendering of the `Complete` outcome button. */
@Input()
showCompleteButton: boolean = true;
/** If true then the `Complete` outcome button is shown but it will be disabled. */
@Input()
disableCompleteButton: boolean = false;
/** If true then the `Start Process` outcome button is shown but it will be disabled. */
@Input()
disableStartProcessButton: boolean = false;
/** Toggle rendering of the `Save` outcome button. */
@Input()
showSaveButton: boolean = true;
/** Toggle debug options. */
@Input()
showDebugButton: boolean = false;
/** Toggle readonly state of the form. Forces all form widgets to render as readonly if enabled. */
@Input()
readOnly: boolean = false;
/** Toggle rendering of the `Refresh` button. */
@Input()
showRefreshButton: boolean = true;
/** Toggle rendering of the validation icon next to the form title. */
@Input()
showValidationIcon: boolean = true;
/** Contains a list of form field validator instances. */
@Input()
fieldValidators: FormFieldValidator[] = [];
/** Emitted when the form is submitted with the `Save` or custom outcomes. */
@Output()
formSaved: EventEmitter<FormModel> = new EventEmitter<FormModel>();
/** Emitted when the form is submitted with the `Complete` outcome. */
@Output()
formCompleted: EventEmitter<FormModel> = new EventEmitter<FormModel>();
/** Emitted when form content is clicked. */
@Output()
formContentClicked: EventEmitter<ContentLinkModel> = new EventEmitter<ContentLinkModel>();
/** Emitted when the form is loaded or reloaded. */
@Output()
formLoaded: EventEmitter<FormModel> = new EventEmitter<FormModel>();
/** Emitted when form values are refreshed due to a data property change. */
@Output()
formDataRefreshed: EventEmitter<FormModel> = new EventEmitter<FormModel>();
/** Emitted when any outcome is executed. Default behaviour can be prevented
* via `event.preventDefault()`.
*/
@Output()
executeOutcome: EventEmitter<FormOutcomeEvent> = new EventEmitter<FormOutcomeEvent>();
/** Emitted when any error occurs. */
@Output()
onError: EventEmitter<any> = new EventEmitter<any>();

View File

@@ -34,12 +34,15 @@ export class InfoDrawerTabComponent {
host: { 'class': 'adf-info-drawer' }
})
export class InfoDrawerComponent {
/** The title of the info drawer. */
@Input()
title: string|null = null;
/** The selected index tab. */
@Input()
selectedIndex: number = 0;
/** Emitted when the currently active tab changes. */
@Output()
currentTab: EventEmitter<number> = new EventEmitter<number>();

View File

@@ -55,61 +55,61 @@ export class LoginComponent implements OnInit {
isPasswordShow: boolean = false;
/* Should the `Remember me` checkbox be shown? */
/** Should the `Remember me` checkbox be shown? */
@Input()
showRememberMe: boolean = true;
/* Should the extra actions (`Need Help`, `Register`, etc) be shown? */
/** Should the extra actions (`Need Help`, `Register`, etc) be shown? */
@Input()
showLoginActions: boolean = true;
/* Sets the URL of the NEED HELP link in the footer */
/** Sets the URL of the NEED HELP link in the footer. */
@Input()
needHelpLink: string = '';
/* Sets the URL of the REGISTER link in the footer */
/** Sets the URL of the REGISTER link in the footer. */
@Input()
registerLink: string = '';
/* Path to a custom logo image */
/** Path to a custom logo image. */
@Input()
logoImageUrl: string = './assets/images/alfresco-logo.svg';
/* Path to a custom background image */
/** Path to a custom background image. */
@Input()
backgroundImageUrl: string = './assets/images/background.svg';
/* The copyright text below the login box */
/** The copyright text below the login box. */
@Input()
copyrightText: string = '\u00A9 2016 Alfresco Software, Inc. All Rights Reserved.';
/* Possible valid values are ECM, BPM or ALL. By default, this component
/** Possible valid values are ECM, BPM or ALL. By default, this component
* will log in only to ECM. If you want to log in in both systems then use ALL.
*/
@Input()
providers: string;
/* Custom validation rules for the login form */
/** Custom validation rules for the login form. */
@Input()
fieldsValidation: any;
/* Prevents the CSRF Token from being submitted. Only valid for Alfresco Process Services. */
/** Prevents the CSRF Token from being submitted. Only valid for Alfresco Process Services. */
@Input()
disableCsrf: boolean;
/* Route to redirect to on successful login. */
/** Route to redirect to on successful login. */
@Input()
successRoute: string = null;
/* Emitted when the login is successful */
/** Emitted when the login is successful. */
@Output()
success = new EventEmitter<LoginSuccessEvent>();
/* Emitted when the login fails */
/** Emitted when the login fails. */
@Output()
error = new EventEmitter<LoginErrorEvent>();
/* Emitted when the login form is submitted */
/** Emitted when the login form is submitted. */
@Output()
executeSubmit = new EventEmitter<LoginSubmitEvent>();

View File

@@ -50,18 +50,23 @@ export class InfinitePaginationComponent implements OnInit, OnDestroy {
hasMoreItems: false
};
/** Pagination object. */
@Input()
pagination: Pagination;
/** Component that provides custom pagination support. */
@Input()
target: PaginatedComponent;
/** Number of items that are added with each "load more" event. */
@Input()
pageSize: number = InfinitePaginationComponent.DEFAULT_PAGE_SIZE;
/** Is a new page loading? */
@Input('loading')
isLoading: boolean = false;
/** Emitted when the "Load More" button is clicked. */
@Output()
loadMore: EventEmitter<Pagination> = new EventEmitter<Pagination>();

View File

@@ -56,27 +56,35 @@ export class PaginationComponent implements OnInit, OnDestroy {
CHANGE_PAGE_NUMBER: 'CHANGE_PAGE_NUMBER'
};
/** Component that provides custom pagination support. */
@Input()
target: PaginatedComponent;
/** An array of page sizes. */
@Input()
supportedPageSizes: number[] = [5, 25, 50, 100];
/** Pagination object. */
@Input()
pagination: Pagination;
/** Emitted when paginaton changes in any way. */
@Output()
change: EventEmitter<PaginationQueryParams> = new EventEmitter<PaginationQueryParams>();
/** Emitted when the page number changes. */
@Output()
changePageNumber: EventEmitter<Pagination> = new EventEmitter<Pagination>();
/** Emitted when the page size changes. */
@Output()
changePageSize: EventEmitter<Pagination> = new EventEmitter<Pagination>();
/** Emitted when the next page is requested. */
@Output()
nextPage: EventEmitter<Pagination> = new EventEmitter<Pagination>();
/** Emitted when the previous page is requested. */
@Output()
prevPage: EventEmitter<Pagination> = new EventEmitter<Pagination>();

View File

@@ -42,9 +42,11 @@ export class HostSettingsComponent {
urlFormControlEcm = new FormControl('', [Validators.required, Validators.pattern(this.HOST_REGEX)]);
urlFormControlBpm = new FormControl('', [Validators.required, Validators.pattern(this.HOST_REGEX)]);
/** Determines which configurations are shown. Possible valid values are "ECM", "BPM" or "ALL". */
@Input()
providers: string = 'ALL';
/** Emitted when the URL is invalid. */
@Output()
error = new EventEmitter<string>();

View File

@@ -30,18 +30,31 @@ export class ProcessAttachmentListComponent implements OnChanges, AfterContentIn
@ContentChild(EmptyListComponent)
emptyTemplate: EmptyListComponent;
/** (**required**) The ID of the process instance to display. */
@Input()
processInstanceId: string;
/** Disable/Enable read-only mode for attachment list. */
@Input()
disabled: boolean = false;
/** Emitted when the attachment is double-clicked or the
* view option is selected from the context menu by the user from
* within the component. Returns a Blob representing the object
* that was clicked.
*/
@Output()
attachmentClick = new EventEmitter();
/** Emitted when the attachment list has fetched all the attachments.
* Returns a list of attachments.
*/
@Output()
success = new EventEmitter();
/** Emitted when the attachment list is not able to fetch the attachments
* (eg, following a network error).
*/
@Output()
error: EventEmitter<any> = new EventEmitter<any>();

View File

@@ -27,12 +27,15 @@ import { Observer } from 'rxjs/Observer';
})
export class ProcessCommentsComponent implements OnChanges {
/** (**required**) The numeric ID of the process instance to display comments for. */
@Input()
processInstanceId: string;
/** Should the comments be read-only? */
@Input()
readOnly: boolean = true;
/** Emitted when an error occurs. */
@Output()
error: EventEmitter<any> = new EventEmitter<any>();

View File

@@ -33,15 +33,19 @@ export class PeopleListComponent implements AfterViewInit, AfterContentInit {
@ViewChild(DataTableComponent)
peopleDataTable: DataTableComponent;
/** The array of user data used to populate the people list. */
@Input()
users: UserProcessModel[];
/** Toggles whether or not actions should be visible, i.e. the 'Three-Dots' menu. */
@Input()
actions: boolean = false;
/** Emitted when the user clicks a row in the people list. */
@Output()
clickRow: EventEmitter<UserProcessModel> = new EventEmitter<UserProcessModel>();
/** Emitted when the user clicks in the 'Three Dots' drop down menu for a row. */
@Output()
clickAction: EventEmitter<UserEventModel> = new EventEmitter<UserEventModel>();

View File

@@ -30,12 +30,15 @@ import { PeopleSearchComponent } from '../people-search/people-search.component'
})
export class PeopleComponent implements OnInit, AfterViewInit {
/** The array of User objects to display. */
@Input()
people: UserProcessModel[] = [];
/** The numeric ID of the task. */
@Input()
taskId: string = '';
/** Should the data be read-only? */
@Input()
readOnly: boolean = false;

View File

@@ -30,24 +30,33 @@ import { ProcessFilterService } from './../services/process-filter.service';
})
export class ProcessFiltersComponent implements OnInit, OnChanges {
/** The parameters to filter the task filter. If there is no match then the default one
* (ie, the first filter in the list) is selected.
*/
@Input()
filterParam: FilterProcessRepresentationModel;
/** Emitted when the user selects a filter from the list. */
@Output()
filterClick: EventEmitter<ProcessInstanceFilterRepresentation> = new EventEmitter<ProcessInstanceFilterRepresentation>();
/** Emitted when the list of filters has been successfully loaded from the server. */
@Output()
success: EventEmitter<ProcessInstanceFilterRepresentation[]> = new EventEmitter<ProcessInstanceFilterRepresentation[]>();
/** Emitted when an error occurs. */
@Output()
error: EventEmitter<any> = new EventEmitter<any>();
/** Display filters available to the current user for the application with the specified ID. */
@Input()
appId: number;
/** Display filters available to the current user for the application with the specified name. */
@Input()
appName: string;
/** Toggle to show or hide the filter's icon. */
@Input()
showIcon: boolean = true;

View File

@@ -32,6 +32,7 @@ import { ProcessInstanceTasksComponent } from './process-instance-tasks.componen
})
export class ProcessInstanceDetailsComponent implements OnChanges {
/** (required) The numeric ID of the process instance to display. */
@Input()
processInstanceId: string;
@@ -41,23 +42,29 @@ export class ProcessInstanceDetailsComponent implements OnChanges {
@ViewChild(ProcessInstanceTasksComponent)
tasksList: ProcessInstanceTasksComponent;
/** Toggles whether to show or hide the title. */
@Input()
showTitle: boolean = true;
/** Toggles whether to show or hide the refresh button. */
@Input()
showRefreshButton: boolean = true;
/** Emitted when the current process is cancelled by the user from within the component. */
@Output()
processCancelled: EventEmitter<any> = new EventEmitter<any>();
/** Emitted when an error occurs. */
@Output()
error: EventEmitter<any> = new EventEmitter<any>();
/** Emitted when a task is clicked. */
@Output()
taskClick: EventEmitter<TaskDetailsEvent> = new EventEmitter<TaskDetailsEvent>();
processInstanceDetails: ProcessInstance;
/** Emitted when the "show diagram" button is clicked. */
@Output()
showProcessDiagram: EventEmitter<any> = new EventEmitter<any>();

View File

@@ -26,6 +26,7 @@ import { ProcessInstance } from '../models/process-instance.model';
})
export class ProcessInstanceHeaderComponent implements OnChanges {
/** (**required**) Full details of the process instance to display information about. */
@Input()
processInstance: ProcessInstance;

View File

@@ -32,12 +32,17 @@ import { ProcessService } from './../services/process.service';
})
export class ProcessInstanceTasksComponent implements OnInit, OnChanges {
/** (**required**) The ID of the process instance to display tasks for. */
@Input()
processInstanceDetails: ProcessInstance;
/** Toggles whether to show a refresh button next to the list of tasks to allow
* it to be updated from the server.
*/
@Input()
showRefreshButton: boolean = true;
/** Emitted when an error occurs. */
@Output()
error: EventEmitter<any> = new EventEmitter<any>();
@@ -59,6 +64,7 @@ export class ProcessInstanceTasksComponent implements OnInit, OnChanges {
@ViewChild('taskdetails')
taskdetails: any;
/** Emitted when a task is clicked. */
@Output()
taskClick: EventEmitter<TaskDetailsEvent> = new EventEmitter<TaskDetailsEvent>();

View File

@@ -33,35 +33,47 @@ export class ProcessInstanceListComponent implements OnChanges, AfterContentInit
@ContentChild(DataColumnListComponent) columnList: DataColumnListComponent;
/** The id of the app. */
@Input()
appId: number;
/** The processDefinitionKey of the process. */
@Input()
processDefinitionKey: string;
/** Defines the state of the processes. Possible values are `running`, `completed` and `all` */
@Input()
state: string;
/** Defines the sort ordering of the list. Possible values are `created-desc`, `created-asc`,
* `ended-desc`, `ended-asc`.
*/
@Input()
sort: string;
/** The name of the list. */
@Input()
name: string;
/** The presetColumn of the custom schema to fetch. */
@Input()
presetColumn: string;
requestNode: ProcessFilterParamRepresentationModel;
/** Data source to define the datatable. */
@Input()
data: DataTableAdapter;
/** Emitted when a row in the process list is clicked. */
@Output()
rowClick: EventEmitter<string> = new EventEmitter<string>();
/** Emitted when the list of process instances has been loaded successfully from the server. */
@Output()
success: EventEmitter<ProcessInstance[]> = new EventEmitter<ProcessInstance[]>();
/** Emitted when an error occurs while loading the list of process instances from the server. */
@Output()
error: EventEmitter<any> = new EventEmitter<any>();