diff --git a/assets/ps-example-apps/example_start_process_attach_file.zip b/assets/ps-example-apps/example_start_process_attach_file.zip new file mode 100644 index 0000000000..c827929b05 Binary files /dev/null and b/assets/ps-example-apps/example_start_process_attach_file.zip differ diff --git a/demo-shell/package.json b/demo-shell/package.json index 722c1cbbf2..87f9733d93 100644 --- a/demo-shell/package.json +++ b/demo-shell/package.json @@ -6,7 +6,7 @@ "scripts": { "ng": "ng", "start": "npm run server-versions && rimraf dist && ng serve --host 0.0.0.0 --app dist --open --aot=false", - "start:dev": "npm run lint && npm run server-versions && rimraf dist && npm run clean-lib-angular && concurrently \"ng serve --host 0.0.0.0 --disable-host-check --app dev pp-dev --proxy-config proxy.conf.js --open\" \"npm run style:dev - --watch\" ", + "start:dev": "npm run lint && npm run server-versions && rimraf dist && npm run clean-lib-angular && concurrently \"ng serve --host 0.0.0.0 --disable-host-check --app dev pp-dev --proxy-config proxy.conf.js --open\" \"npm run style:dev -- --watch\" ", "start:dist": "npm run server-versions && rimraf dist && node --max_old_space_size=30000 node_modules/.bin/ng serve --prod --build-optimizer=false --aot=false --host 0.0.0.0 --disable-host-check --app dist", "build": "npm run server-versions && rimraf dist && ng build --app dist", "build:dev": "npm run lint && npm run style:dev && npm run server-versions && rimraf dist && ng build --app dev", diff --git a/demo-shell/resources/i18n/en.json b/demo-shell/resources/i18n/en.json index 51c4e15f77..9c4e64c3a0 100644 --- a/demo-shell/resources/i18n/en.json +++ b/demo-shell/resources/i18n/en.json @@ -3,7 +3,11 @@ "VERSION": { "NO_PERMISSION": "You don't have permission to manage versions of this content", "NO_PERMISSION_EVENT": "You don't have ${event.permission} permission to ${event.action} the ${event.type}", - "CHOOSE_FILE": "Select a file to see its versions" + "CHOOSE_FILE": "Select a file to see its versions", + "DIALOG": { + "CLOSE": "Close", + "TITLE": "Manage versions" + } }, "APP_LAYOUT": { "APP_NAME": "ADF Demo Application", @@ -50,7 +54,8 @@ "DOWNLOAD": "Download", "COPY": "Copy", "MOVE": "Move", - "DELETE": "Delete" + "DELETE": "Delete", + "PROCESS_ACTION": "Start Process" } } }, diff --git a/demo-shell/src/app/components/files/files.component.html b/demo-shell/src/app/components/files/files.component.html index 27d6e86407..372589bc94 100644 --- a/demo-shell/src/app/components/files/files.component.html +++ b/demo-shell/src/app/components/files/files.component.html @@ -191,6 +191,7 @@ format="timeAgo" class="desktop-only"> + @@ -268,6 +269,13 @@ (success)="onDeleteActionSuccess($event)" handler="delete"> + + +
@@ -318,6 +327,13 @@ +
+ + +
+

Current folder ID: {{ documentList.currentFolderId }}

diff --git a/demo-shell/src/app/components/files/files.component.ts b/demo-shell/src/app/components/files/files.component.ts index afebf5d579..d5544cff06 100644 --- a/demo-shell/src/app/components/files/files.component.ts +++ b/demo-shell/src/app/components/files/files.component.ts @@ -23,14 +23,16 @@ import { MatDialog } from '@angular/material'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { MinimalNodeEntity, NodePaging, Pagination, MinimalNodeEntryEntity, SiteEntry } from 'alfresco-js-api'; import { - AlfrescoApiService, ContentService, TranslationService, + AlfrescoApiService, AuthenticationService, ContentService, TranslationService, FileUploadEvent, FolderCreatedEvent, LogService, NotificationService, UploadService, DataColumn, DataRow, UserPreferencesService, - PaginationComponent + PaginationComponent, FormValues } from '@alfresco/adf-core'; import { DocumentListComponent, PermissionStyleModel, DownloadZipDialogComponent } from '@alfresco/adf-content-services'; +import { SelectAppsDialogComponent } from '@alfresco/adf-process-services'; + import { VersionManagerDialogAdapterComponent } from './version-manager-dialog-adapter.component'; import { Subscription } from 'rxjs/Rx'; @@ -60,6 +62,10 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { // The identifier of a node. You can also use one of these well-known aliases: -my- | -shared- | -root- currentFolderId: string = DEFAULT_FOLDER_TO_SHOW; + formValues: FormValues = {}; + + processId; + @Input() selectionMode = 'multiple'; @@ -143,7 +149,8 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { private router: Router, private logService: LogService, private preference: UserPreferencesService, - @Optional() private route: ActivatedRoute) { + @Optional() private route: ActivatedRoute, + public authenticationService: AuthenticationService) { } showFile(event) { @@ -208,7 +215,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { } giveDefaultPaginationWhenNotDefined() { - this.pagination = { + this.pagination = { maxItems: this.preference.paginationSize, skipCount: 0, totalItems: 0, @@ -446,6 +453,20 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { return false; } + startProcesAction($event) { + this.formValues['file'] = $event.value.entry; + + const dialogRef = this.dialog.open(SelectAppsDialogComponent, { + width: '630px', + panelClass: 'adf-version-manager-dialog' + }); + + dialogRef.afterClosed().subscribe(selectedProcess => { + this.processId = selectedProcess.id; + }); + + } + onChangePageSize(event: Pagination): void { this.preference.paginationSize = event.maxItems; this.changedPageSize.emit(event); diff --git a/demo-shell/src/app/components/files/version-manager-dialog-adapter.component.html b/demo-shell/src/app/components/files/version-manager-dialog-adapter.component.html index e1decb8bd4..062fbf32a4 100644 --- a/demo-shell/src/app/components/files/version-manager-dialog-adapter.component.html +++ b/demo-shell/src/app/components/files/version-manager-dialog-adapter.component.html @@ -1,7 +1,7 @@ -
Manage versions
+
{{'VERSION.DIALOG.TITLE' | translate}}
- +
diff --git a/docs/README.md b/docs/README.md index d0f86d49d3..09c4918a3c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -168,30 +168,30 @@ for more information about installing and using the source code. ## Components -| Name | Description | Source link | -| ---- | ----------- | ----------- | -| [Breadcrumb component](breadcrumb.component.md) | Indicates the current position within a navigation hierarchy. | [Source](../lib/content-services/breadcrumb/breadcrumb.component.ts) | -| [Dropdown breadcrumb component](dropdown-breadcrumb.component.md) | Indicates the current position within a navigation hierarchy using a dropdown menu. | [Source](../lib/content-services/breadcrumb/dropdown-breadcrumb.component.ts) | +| Name | Description | Source link | +| --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| [Breadcrumb component](breadcrumb.component.md) | Indicates the current position within a navigation hierarchy. | [Source](../lib/content-services/breadcrumb/breadcrumb.component.ts) | +| [Dropdown breadcrumb component](dropdown-breadcrumb.component.md) | Indicates the current position within a navigation hierarchy using a dropdown menu. | [Source](../lib/content-services/breadcrumb/dropdown-breadcrumb.component.ts) | | [Content metadata component](content-metadata.component.md) | Allows a user to display and edit metadata related to a node. | [Source](../lib/content-services/content-metadata/components/content-metadata/content-metadata.component.ts) | -| [Content node selector component](content-node-selector.component.md) | Allows a user to select items from a Content Services repository. | [Source](../lib/content-services/content-node-selector/content-node-selector.component.ts) | -| [Content action component](content-action.component.md) | Adds options to a Document List actions menu for a particular content type. | [Source](../lib/content-services/document-list/components/content-action/content-action.component.ts) | -| [Document list component](document-list.component.md) | Displays the documents from a repository. | [Source](../lib/content-services/document-list/components/document-list.component.ts) | -| [Search control component](search-control.component.md) | Displays a input text which shows find-as-you-type suggestions. | [Source](../lib/content-services/search/components/search-control.component.ts) | -| [Search component](search.component.md) | Searches items for supplied search terms. | [Source](../lib/content-services/search/components/search.component.ts) | -| [Sites dropdown component](sites-dropdown.component.md) | Displays a dropdown menu to show and interact with the sites of the current user. | [Source](../lib/content-services/site-dropdown/sites-dropdown.component.ts) | -| [Like component](like.component.md) | Allows a user to add "likes" to an item. | [Source](../lib/content-services/social/like.component.ts) | -| [Rating component](rating.component.md) | Allows a user to add ratings to an item. | [Source](../lib/content-services/social/rating.component.ts) | -| [Tag actions component](tag-actions.component.md) | Shows available actions for tags. | [Source](../lib/content-services/tag/tag-actions.component.ts) | -| [Tag list component](tag-list.component.md) | Shows tags for an item. | [Source](../lib/content-services/tag/tag-list.component.ts) | -| [Tag node list component](tag-node-list.component.md) | Shows tags for a node. | [Source](../lib/content-services/tag/tag-node-list.component.ts) | -| [File uploading dialog component](file-uploading-dialog.component.md) | Shows a dialog listing all the files uploaded with the Upload Button or Drag Area components. | [Source](../lib/content-services/upload/components/file-uploading-dialog.component.ts) | -| [Upload button component](upload-button.component.md) | Activates a file upload. | [Source](../lib/content-services/upload/components/upload-button.component.ts) | -| [Upload drag area component](upload-drag-area.component.md) | Adds a drag and drop area to upload files to Alfresco. | [Source](../lib/content-services/upload/components/upload-drag-area.component.ts) | -| [Version list component](version-list.component.md) | Displays the version history of a node in a [Version Manager component](version-manager.component.md) | [Source](../lib/content-services/version-manager/version-list.component.ts) | -| [Version manager component](version-manager.component.md) | Displays the version history of a node with the ability to upload a new version. | [Source](../lib/content-services/version-manager/version-manager.component.ts) | -| [Webscript component](webscript.component.md) | Provides access to Webscript features. | [Source](../lib/content-services/webscript/webscript.component.ts) | -| _Content metadata card component_ | _Not currently documented_ | [Source](../lib/content-services/content-metadata/components/content-metadata-card/content-metadata-card.component.ts) | -| _Content node selector panel component_ | _Not currently documented_ | [Source](../lib/content-services/content-node-selector/content-node-selector-panel.component.ts) | +| [Content node selector component](content-node-selector.component.md) | Allows a user to select items from a Content Services repository. | [Source](../lib/content-services/content-node-selector/content-node-selector.component.ts) | +| [Content action component](content-action.component.md) | Adds options to a Document List actions menu for a particular content type. | [Source](../lib/content-services/document-list/components/content-action/content-action.component.ts) | +| [Document list component](document-list.component.md) | Displays the documents from a repository. | [Source](../lib/content-services/document-list/components/document-list.component.ts) | +| [Search control component](search-control.component.md) | Displays a input text which shows find-as-you-type suggestions. | [Source](../lib/content-services/search/components/search-control.component.ts) | +| [Search component](search.component.md) | Searches items for supplied search terms. | [Source](../lib/content-services/search/components/search.component.ts) | +| [Sites dropdown component](sites-dropdown.component.md) | Displays a dropdown menu to show and interact with the sites of the current user. | [Source](../lib/content-services/site-dropdown/sites-dropdown.component.ts) | +| [Like component](like.component.md) | Allows a user to add "likes" to an item. | [Source](../lib/content-services/social/like.component.ts) | +| [Rating component](rating.component.md) | Allows a user to add ratings to an item. | [Source](../lib/content-services/social/rating.component.ts) | +| [Tag actions component](tag-actions.component.md) | Shows available actions for tags. | [Source](../lib/content-services/tag/tag-actions.component.ts) | +| [Tag list component](tag-list.component.md) | Shows tags for an item. | [Source](../lib/content-services/tag/tag-list.component.ts) | +| [Tag node list component](tag-node-list.component.md) | Shows tags for a node. | [Source](../lib/content-services/tag/tag-node-list.component.ts) | +| [File uploading dialog component](file-uploading-dialog.component.md) | Shows a dialog listing all the files uploaded with the Upload Button or Drag Area components. | [Source](../lib/content-services/upload/components/file-uploading-dialog.component.ts) | +| [Upload button component](upload-button.component.md) | Activates a file upload. | [Source](../lib/content-services/upload/components/upload-button.component.ts) | +| [Upload drag area component](upload-drag-area.component.md) | Adds a drag and drop area to upload files to Alfresco. | [Source](../lib/content-services/upload/components/upload-drag-area.component.ts) | +| [Version list component](version-list.component.md) | Displays the version history of a node in a [Version Manager component](version-manager.component.md) | [Source](../lib/content-services/version-manager/version-list.component.ts) | +| [Version manager component](version-manager.component.md) | Displays the version history of a node with the ability to upload a new version. | [Source](../lib/content-services/version-manager/version-manager.component.ts) | +| [Webscript component](webscript.component.md) | Provides access to Webscript features. | [Source](../lib/content-services/webscript/webscript.component.ts) | +| _Content metadata component_ | _Not currently documented_ | [Source](../lib/content-services/content-metadata/content-metadata.component.ts) | +| _Content node selector panel component_ | _Not currently documented_ | [Source](../lib/content-services/content-node-selector/content-node-selector-panel.component.ts) | ## Directives @@ -242,6 +242,7 @@ for more information about installing and using the source code. | Name | Description | Source link | | ---- | ----------- | ----------- | | [Apps list component](apps-list.component.md) | Shows all available apps. | [Source](../lib/process-services/app-list/apps-list.component.ts) | +| [Select app dialog component](select-apps-dialog-component.md) | Shows a dialog listing all the PS apps with a slect box to slect it | [Source](../lib/process-services/app-list/select-apps-dialog-component.ts) | | [Create process attachment component](create-process-attachment.component.md) | Displays Upload Component (Drag and Click) to upload the attachment to a specified process instance | [Source](../lib/process-services/attachment/create-process-attachment.component.ts) | | [Create task attachment component](create-task-attachment.component.md) | Displays Upload Component (Drag and Click) to upload the attachment to a specified task | [Source](../lib/process-services/attachment/create-task-attachment.component.ts) | | [Process attachment list component](process-attachment-list.component.md) | Displays attached documents on a specified process instance | [Source](../lib/process-services/attachment/process-attachment-list.component.ts) | diff --git a/docs/docassets/images/select-apps-dialog.png b/docs/docassets/images/select-apps-dialog.png new file mode 100644 index 0000000000..a5f9501a92 Binary files /dev/null and b/docs/docassets/images/select-apps-dialog.png differ diff --git a/docs/docassets/images/start_process.png b/docs/docassets/images/start_process.png new file mode 100644 index 0000000000..ac808e5c63 Binary files /dev/null and b/docs/docassets/images/start_process.png differ diff --git a/docs/select-apps-dialog-component.md b/docs/select-apps-dialog-component.md new file mode 100644 index 0000000000..a4f97fb3de --- /dev/null +++ b/docs/select-apps-dialog-component.md @@ -0,0 +1,26 @@ +# Select app Component + +Shows all available apps and give you back the selected app. + +![select-apps-dialog](docassets/images/select-apps-dialog.png) + +## Basic Usage + + ```ts +import { SelectAppsDialogComponent } from '@alfresco/adf-process-services'; + +constructor(private dialog: MatDialog) { +} + +startSelectDialog(){ + const dialogRef = this.dialog.open(SelectAppsDialogComponent, { + width: '630px', + panelClass: 'adf-version-manager-dialog' + }); + + dialogRef.afterClosed().subscribe(selectedProcess => { + this.processId = selectedProcess.id; + }); +} + +``` diff --git a/docs/start-process.component.md b/docs/start-process.component.md index 45d0809914..e27c8d1c41 100644 --- a/docs/start-process.component.md +++ b/docs/start-process.component.md @@ -17,7 +17,9 @@ Starts a process. | Name | Description | | --- | --- | | appId | (required): Limit the list of processes which can be started to those contained in the specified app | +| name | (optional) name to assign to the current process | | variables | Variables in input to the process [RestVariable](https://github.com/Alfresco/alfresco-js-api/tree/master/src/alfresco-activiti-rest-api/docs/RestVariable.md)| +| values | Parameter to pass form field values in the start form if is associated | ### Events @@ -27,6 +29,74 @@ Starts a process. | cancel | Raised when the process canceled | | error | Raised when the start process fail | + +### Custom data example + +Here is an example of how to pass in form field values, these correspond to the start form that has been defined for the process: + + +```ts +const formValues:FormValues = { + 'test_1': 'value_1', + 'test_2': 'value_2', + 'test_3': 'value_1', + 'test_4': 'dropdown_id', + 'test_5': 'dropdown_label', + 'dropdown': {'id': 'dropdown_id', 'name': 'dropdown_label'} +}; +``` + +```html + + +``` + +### Attach a File to the start-form of the process + +After the repository is created in APS, you can see your new repository in the Alfresco Repositories list. +If the ID is set to 1, then all default values are fine. +However, if it is set to something else, for example, ***1002*** and the name is ***alfresco***, you must set in your 'app.config.json' the property ***alfrescoRepositoryName*** alfresco-1002: + +```ts + { + name: 'Alfresco ADF Application' + }, + ecmHost: 'http://{hostname}{:port}/ecm', + bpmHost: 'http://{hostname}{:port}/bpm', + logLevel: 'silent', + alfrescoRepositoryName : 'alfresco-1002' +``` + +After you need to pass the node in the input values object with the other properties: + +```ts + +let node: MinimalNodeEntryEntity = this.odesApiService.getNode(NODE_ID); + +const formValues: FormValues = { + 'file' : node + 'field_one': 'example text' +}; +``` + +Note In the object above the key 'file' is the name of the attach file field in the start form of the process. +The value of the file property has to be a ***MinimalNodeEntryEntity**: + +```html + + +``` + +The result will be the start form prefilled with the file: + + +![Start process load file](docassets/images/start_process.png) + + ## Details Displays Start Process, allowing the user to specify some details like process name and process definition, which are the most basic requirement to start a new process instance. The user have to select the process definition from a dropdown if there are more than one process definition available. If there is just one process definition available for the app, then it is auto-selected. There is a error message shown if no process definition is available. \ No newline at end of file diff --git a/lib/content-services/i18n/de.json b/lib/content-services/i18n/de.json index 40e2339672..260b490909 100644 --- a/lib/content-services/i18n/de.json +++ b/lib/content-services/i18n/de.json @@ -1,25 +1,4 @@ { - "FORM": { - "START_FORM": { - "TITLE": "Startformular" - }, - "PREVIEW": { - "IMAGE_NOT_AVAILABLE": "Vorschau nicht verfügbar" - }, - "FIELD": { - "UPLOAD": "Hochladen", - "REQUIRED": "*Erforderlich", - "VALIDATOR": { - "INVALID_NUMBER": "Verwenden Sie ein anderes Zahlenformat", - "INVALID_DATE": "Verwenden Sie ein anderes Datumsformat", - "INVALID_VALUE": "Geben Sie einen anderen Wert ein", - "NOT_GREATER_THAN": "Darf nicht größer als {{ maxValue }} sein", - "NOT_LESS_THAN": "Darf nicht kleiner als {{ minValue }} sein", - "AT_LEAST_LONG": "Geben Sie mindestens {{ minLength }} Zeichen ein", - "NO_LONGER_THAN": "Geben Sie höchstens {{ maxLength }} Zeichen ein" - } - } - }, "ADF-DOCUMENT-LIST": { "EMPTY": { "HEADER": "Dieser Ordner ist leer" @@ -185,4 +164,4 @@ "PERMISSON": { "LACKOF": "Sie verfügen nicht über die nötige Berechtigung ('{{permission}}'), um {{type}} zu {{action}}" } -} \ No newline at end of file +} diff --git a/lib/content-services/i18n/en.json b/lib/content-services/i18n/en.json index ecc798dd9a..77b90fcd5a 100644 --- a/lib/content-services/i18n/en.json +++ b/lib/content-services/i18n/en.json @@ -1,26 +1,4 @@ { - "FORM": { - "START_FORM": { - "TITLE": "Start Form" - }, - "PREVIEW": { - "IMAGE_NOT_AVAILABLE": "Preview not available" - }, - "FIELD": { - "SOURCE": "Select source from ", - "UPLOAD": "UPLOAD", - "REQUIRED": "*Required", - "VALIDATOR": { - "INVALID_NUMBER": "Use a different number format", - "INVALID_DATE": "Use a different date format", - "INVALID_VALUE": "Enter a different value", - "NOT_GREATER_THAN": "Can't be greater than {{ maxValue }}", - "NOT_LESS_THAN": "Can't be less than {{ minValue }}", - "AT_LEAST_LONG": "Enter at least {{ minLength }} characters", - "NO_LONGER_THAN": "Enter no more than {{ maxLength }} characters" - } - } - }, "ADF-DOCUMENT-LIST": { "EMPTY": { "HEADER": "This folder is empty" diff --git a/lib/content-services/i18n/es.json b/lib/content-services/i18n/es.json index fc1c4cbc42..702f383456 100644 --- a/lib/content-services/i18n/es.json +++ b/lib/content-services/i18n/es.json @@ -1,25 +1,4 @@ { - "FORM": { - "START_FORM": { - "TITLE": "Iniciar formulario" - }, - "PREVIEW": { - "IMAGE_NOT_AVAILABLE": "Vista previa no disponible" - }, - "FIELD": { - "UPLOAD": "Cargar", - "REQUIRED": "*Requerido", - "VALIDATOR": { - "INVALID_NUMBER": "Utilizar un formato de número diferente", - "INVALID_DATE": "Utilizar un formato de fecha diferente", - "INVALID_VALUE": "Introducir un valor diferente", - "NOT_GREATER_THAN": "No puede ser mayor que {{ maxValue }}", - "NOT_LESS_THAN": "No puede ser menor que {{ minValue }}", - "AT_LEAST_LONG": "Introducir al menos {{ minLength }} caracteres", - "NO_LONGER_THAN": "No introducir más de {{ maxLength }} caracteres" - } - } - }, "ADF-DOCUMENT-LIST": { "EMPTY": { "HEADER": "Esta carpeta está vacía" @@ -185,4 +164,4 @@ "PERMISSON": { "LACKOF": "No tiene permiso {{permission}} para {{action}} el {{type}}" } -} \ No newline at end of file +} diff --git a/lib/content-services/i18n/fr.json b/lib/content-services/i18n/fr.json index ee5b4847c0..700185c379 100644 --- a/lib/content-services/i18n/fr.json +++ b/lib/content-services/i18n/fr.json @@ -1,25 +1,4 @@ { - "FORM": { - "START_FORM": { - "TITLE": "Démarrer le formulaire" - }, - "PREVIEW": { - "IMAGE_NOT_AVAILABLE": "Aperçu non disponible" - }, - "FIELD": { - "UPLOAD": "Importer", - "REQUIRED": "*Obligatoire", - "VALIDATOR": { - "INVALID_NUMBER": "Utiliser un format de numéro différent", - "INVALID_DATE": "Utiliser un format de date différent", - "INVALID_VALUE": "Entrer une valeur différente", - "NOT_GREATER_THAN": "Ne peut pas être supérieur à {{ maxValue }}", - "NOT_LESS_THAN": "Ne peut pas être inférieur à {{ minValue }}", - "AT_LEAST_LONG": "Entrez {{ minLength }} caractères minimum", - "NO_LONGER_THAN": "Entrez {{ maxLength }} caractères maximum" - } - } - }, "ADF-DOCUMENT-LIST": { "EMPTY": { "HEADER": "Ce dossier est vide" @@ -185,4 +164,4 @@ "PERMISSON": { "LACKOF": "Vous n'avez pas les droits d'accès {{permission}} pour {{action}} le {{type}}" } -} \ No newline at end of file +} diff --git a/lib/content-services/i18n/it.json b/lib/content-services/i18n/it.json index ee66c94228..2acd8854f4 100644 --- a/lib/content-services/i18n/it.json +++ b/lib/content-services/i18n/it.json @@ -1,25 +1,4 @@ { - "FORM": { - "START_FORM": { - "TITLE": "Modulo di inizio" - }, - "PREVIEW": { - "IMAGE_NOT_AVAILABLE": "Anteprima non disponibile" - }, - "FIELD": { - "UPLOAD": "Carica", - "REQUIRED": "*Obbligatorio", - "VALIDATOR": { - "INVALID_NUMBER": "Usa un formato numerico diverso", - "INVALID_DATE": "Usa un formato di data diverso", - "INVALID_VALUE": "Immetti un valore diverso", - "NOT_GREATER_THAN": "Non può essere maggiore di {{ maxValue }}", - "NOT_LESS_THAN": "Non può essere inferiore di {{ minValue }}", - "AT_LEAST_LONG": "Immetti almeno {{ minLength }} caratteri", - "NO_LONGER_THAN": "Immetti non più di {{ maxLength }} caratteri" - } - } - }, "ADF-DOCUMENT-LIST": { "EMPTY": { "HEADER": "Questa cartella è vuota" @@ -185,4 +164,4 @@ "PERMISSON": { "LACKOF": "Non hai l'autorizzazione {{permission}} per {{action}} {{type}}" } -} \ No newline at end of file +} diff --git a/lib/content-services/i18n/ja.json b/lib/content-services/i18n/ja.json index e5d050f084..6744334c78 100644 --- a/lib/content-services/i18n/ja.json +++ b/lib/content-services/i18n/ja.json @@ -1,25 +1,4 @@ { - "FORM": { - "START_FORM": { - "TITLE": "開始フォーム" - }, - "PREVIEW": { - "IMAGE_NOT_AVAILABLE": "プレビューは使用できません" - }, - "FIELD": { - "UPLOAD": "アップロード", - "REQUIRED": "*必須", - "VALIDATOR": { - "INVALID_NUMBER": "別の番号形式を使用してください", - "INVALID_DATE": "別の日付形式を使用してください", - "INVALID_VALUE": "別の値を入力してください", - "NOT_GREATER_THAN": "{{ maxValue }} より大きい値にすることはできません", - "NOT_LESS_THAN": "{{ minValue }} より小さい値にすることはできません", - "AT_LEAST_LONG": "{{ minLength }} 文字以上で入力してください", - "NO_LONGER_THAN": "{{ maxLength }} 文字以内で入力してください" - } - } - }, "ADF-DOCUMENT-LIST": { "EMPTY": { "HEADER": "このフォルダは空です" @@ -185,4 +164,4 @@ "PERMISSON": { "LACKOF": "{{type}} を {{action}} するための {{permission}} 権限がありません" } -} \ No newline at end of file +} diff --git a/lib/content-services/i18n/nb.json b/lib/content-services/i18n/nb.json index 040fad2225..c89e75b543 100644 --- a/lib/content-services/i18n/nb.json +++ b/lib/content-services/i18n/nb.json @@ -1,25 +1,4 @@ { - "FORM": { - "START_FORM": { - "TITLE": "Start skjema" - }, - "PREVIEW": { - "IMAGE_NOT_AVAILABLE": "Forhåndsvisning ikke tilgjengelig" - }, - "FIELD": { - "UPLOAD": "Laster opp", - "REQUIRED": "*Påkrevd", - "VALIDATOR": { - "INVALID_NUMBER": "Bruk et annet nummerformat", - "INVALID_DATE": "Bruk et annet datoformat", - "INVALID_VALUE": "Angi en annen verdi", - "NOT_GREATER_THAN": "Kan ikke være større enn {{ maxValue }}", - "NOT_LESS_THAN": "Kan ikke være mindre enn {{ minValue }}", - "AT_LEAST_LONG": "Angi minst {{ minLength }} tegn", - "NO_LONGER_THAN": "Ikke angi flere enn {{ maxLength }} tegn" - } - } - }, "ADF-DOCUMENT-LIST": { "EMPTY": { "HEADER": "Denne mappen er tom" @@ -185,4 +164,4 @@ "PERMISSON": { "LACKOF": "Du har ikke {{permission}} tillatelsen til å {{action}} {{type}}" } -} \ No newline at end of file +} diff --git a/lib/content-services/i18n/nl.json b/lib/content-services/i18n/nl.json index ab84be4e38..a84b38cee9 100644 --- a/lib/content-services/i18n/nl.json +++ b/lib/content-services/i18n/nl.json @@ -1,25 +1,4 @@ { - "FORM": { - "START_FORM": { - "TITLE": "Beginformulier" - }, - "PREVIEW": { - "IMAGE_NOT_AVAILABLE": "Preview niet beschikbaar" - }, - "FIELD": { - "UPLOAD": "Uploaden", - "REQUIRED": "*Verplicht", - "VALIDATOR": { - "INVALID_NUMBER": "Gebruik een andere getalnotatie", - "INVALID_DATE": "Gebruik een andere datumnotatie", - "INVALID_VALUE": "Voer een andere waarde in", - "NOT_GREATER_THAN": "Mag niet groter zijn dan {{ maxValue }}", - "NOT_LESS_THAN": "Mag niet kleiner zijn dan {{ minValue }}", - "AT_LEAST_LONG": "Voer minimaal {{ minLength }} tekens in", - "NO_LONGER_THAN": "Voer maximaal {{ maxLength }} tekens in" - } - } - }, "ADF-DOCUMENT-LIST": { "EMPTY": { "HEADER": "Deze map is leeg" @@ -185,4 +164,4 @@ "PERMISSON": { "LACKOF": "U hebt geen {{permission}} rechten voor het {{action}} van {{type}}" } -} \ No newline at end of file +} diff --git a/lib/content-services/i18n/pt-BR.json b/lib/content-services/i18n/pt-BR.json index 7f0a53083c..615f9fdd7c 100644 --- a/lib/content-services/i18n/pt-BR.json +++ b/lib/content-services/i18n/pt-BR.json @@ -1,25 +1,4 @@ { - "FORM": { - "START_FORM": { - "TITLE": "Iniciar formulário" - }, - "PREVIEW": { - "IMAGE_NOT_AVAILABLE": "Pré-visualização não disponível" - }, - "FIELD": { - "UPLOAD": "Carregar", - "REQUIRED": "*Obrigatório", - "VALIDATOR": { - "INVALID_NUMBER": "Use um formato de número diferente", - "INVALID_DATE": "Use um formato de data diferente", - "INVALID_VALUE": "Insira um valor diferente", - "NOT_GREATER_THAN": "Não pode ser maior do que {{ maxValue }}", - "NOT_LESS_THAN": "Não pode ser menor do que {{ minValue }}", - "AT_LEAST_LONG": "Insira no mínimo {{ minLength }} caracteres", - "NO_LONGER_THAN": "Insira no máximo {{ maxLength }} caracteres" - } - } - }, "ADF-DOCUMENT-LIST": { "EMPTY": { "HEADER": "Esta pasta está vazia" @@ -185,4 +164,4 @@ "PERMISSON": { "LACKOF": "Você não tem a permissão {{permission}} para {{action}} o {{type}}" } -} \ No newline at end of file +} diff --git a/lib/content-services/i18n/ru.json b/lib/content-services/i18n/ru.json index a78ca9cba3..b61078b70a 100644 --- a/lib/content-services/i18n/ru.json +++ b/lib/content-services/i18n/ru.json @@ -1,25 +1,4 @@ { - "FORM": { - "START_FORM": { - "TITLE": "Запустить форму" - }, - "PREVIEW": { - "IMAGE_NOT_AVAILABLE": "Предварительный просмотр недоступен" - }, - "FIELD": { - "UPLOAD": "Загрузить", - "REQUIRED": "*Обязательно для заполнения", - "VALIDATOR": { - "INVALID_NUMBER": "Используйте другой формат числа", - "INVALID_DATE": "Используйте другой формат даты", - "INVALID_VALUE": "Введите другое значение", - "NOT_GREATER_THAN": "Не может быть более {{ maxValue }}", - "NOT_LESS_THAN": "Не может быть менее {{ minValue }}", - "AT_LEAST_LONG": "Введите не менее {{ minLength }} символ", - "NO_LONGER_THAN": "Введите не более {{ maxLength }} символ" - } - } - }, "ADF-DOCUMENT-LIST": { "EMPTY": { "HEADER": "Эта папка пуста" @@ -185,4 +164,4 @@ "PERMISSON": { "LACKOF": "У вас нет разрешения {{permission}}, чтобы {{action}} {{type}}" } -} \ No newline at end of file +} diff --git a/lib/content-services/i18n/zh-CN.json b/lib/content-services/i18n/zh-CN.json index af51418d22..aa952310b1 100644 --- a/lib/content-services/i18n/zh-CN.json +++ b/lib/content-services/i18n/zh-CN.json @@ -1,25 +1,4 @@ { - "FORM": { - "START_FORM": { - "TITLE": "启动表单" - }, - "PREVIEW": { - "IMAGE_NOT_AVAILABLE": "预览不可用" - }, - "FIELD": { - "UPLOAD": "上传", - "REQUIRED": "*必填项", - "VALIDATOR": { - "INVALID_NUMBER": "使用其他数字格式", - "INVALID_DATE": "使用其他日期格式", - "INVALID_VALUE": "输入其他值", - "NOT_GREATER_THAN": "不得大于 {{ maxValue }}", - "NOT_LESS_THAN": "不得小于 {{ minValue }}", - "AT_LEAST_LONG": "输入至少 {{ minLength }} 个字符", - "NO_LONGER_THAN": "不得输入超过 {{ maxLength }} 个字符" - } - } - }, "ADF-DOCUMENT-LIST": { "EMPTY": { "HEADER": "此文件夹为空" @@ -185,4 +164,4 @@ "PERMISSON": { "LACKOF": "您没有 {{action}} {{type}} 的 {{permission}} 权限" } -} \ No newline at end of file +} diff --git a/lib/core/app-config/app-config.service.ts b/lib/core/app-config/app-config.service.ts index b6f3054b63..d250a25379 100644 --- a/lib/core/app-config/app-config.service.ts +++ b/lib/core/app-config/app-config.service.ts @@ -30,7 +30,8 @@ export class AppConfigService { }, ecmHost: 'http://{hostname}{:port}/ecm', bpmHost: 'http://{hostname}{:port}/bpm', - logLevel: 'silent' + logLevel: 'silent', + alfrescoRepositoryName : 'alfresco-1' }; constructor(private http: HttpClient) { diff --git a/lib/core/i18n/de.json b/lib/core/i18n/de.json index bca5c09460..1a70b32976 100644 --- a/lib/core/i18n/de.json +++ b/lib/core/i18n/de.json @@ -1,4 +1,25 @@ { + "FORM": { + "START_FORM": { + "TITLE": "Startformular" + }, + "PREVIEW": { + "IMAGE_NOT_AVAILABLE": "Vorschau nicht verfügbar" + }, + "FIELD": { + "UPLOAD": "Hochladen", + "REQUIRED": "*Erforderlich", + "VALIDATOR": { + "INVALID_NUMBER": "Verwenden Sie ein anderes Zahlenformat", + "INVALID_DATE": "Verwenden Sie ein anderes Datumsformat", + "INVALID_VALUE": "Geben Sie einen anderen Wert ein", + "NOT_GREATER_THAN": "Darf nicht größer als {{ maxValue }} sein", + "NOT_LESS_THAN": "Darf nicht kleiner als {{ minValue }} sein", + "AT_LEAST_LONG": "Geben Sie mindestens {{ minLength }} Zeichen ein", + "NO_LONGER_THAN": "Geben Sie höchstens {{ maxLength }} Zeichen ein" + } + } + }, "CORE": { "PAGINATION": { "ITEMS_RANGE": "Angezeigt werden {{ range }} von {{ total }}", @@ -148,4 +169,4 @@ "LOADING": "Laden", "UNKNOWN_FORMAT": "Vorschau konnte nicht geladen werden" } -} \ No newline at end of file +} diff --git a/lib/core/i18n/en.json b/lib/core/i18n/en.json index 3dac2d853c..9d816b4fd2 100644 --- a/lib/core/i18n/en.json +++ b/lib/core/i18n/en.json @@ -1,4 +1,27 @@ { + "FORM": { + "START_FORM": { + "TITLE": "Start Form" + }, + "PREVIEW": { + "IMAGE_NOT_AVAILABLE": "Preview not available" + }, + "FIELD": { + "LOCALSTORAGE" : "Local storage", + "SOURCE": "Select source from ", + "UPLOAD": "UPLOAD", + "REQUIRED": "*Required", + "VALIDATOR": { + "INVALID_NUMBER": "Use a different number format", + "INVALID_DATE": "Use a different date format", + "INVALID_VALUE": "Enter a different value", + "NOT_GREATER_THAN": "Can't be greater than {{ maxValue }}", + "NOT_LESS_THAN": "Can't be less than {{ minValue }}", + "AT_LEAST_LONG": "Enter at least {{ minLength }} characters", + "NO_LONGER_THAN": "Enter no more than {{ maxLength }} characters" + } + } + }, "CORE": { "FILE_SIZE": { "BYTES": "Bytes", diff --git a/lib/core/i18n/es.json b/lib/core/i18n/es.json index 56b348ef19..f822db36e2 100644 --- a/lib/core/i18n/es.json +++ b/lib/core/i18n/es.json @@ -1,4 +1,25 @@ { + "FORM": { + "START_FORM": { + "TITLE": "Iniciar formulario" + }, + "PREVIEW": { + "IMAGE_NOT_AVAILABLE": "Vista previa no disponible" + }, + "FIELD": { + "UPLOAD": "Cargar", + "REQUIRED": "*Requerido", + "VALIDATOR": { + "INVALID_NUMBER": "Utilizar un formato de número diferente", + "INVALID_DATE": "Utilizar un formato de fecha diferente", + "INVALID_VALUE": "Introducir un valor diferente", + "NOT_GREATER_THAN": "No puede ser mayor que {{ maxValue }}", + "NOT_LESS_THAN": "No puede ser menor que {{ minValue }}", + "AT_LEAST_LONG": "Introducir al menos {{ minLength }} caracteres", + "NO_LONGER_THAN": "No introducir más de {{ maxLength }} caracteres" + } + } + }, "CORE": { "PAGINATION": { "ITEMS_RANGE": "Mostrando {{ range }} de {{ total }}", @@ -148,4 +169,4 @@ "LOADING": "Cargando", "UNKNOWN_FORMAT": "No se ha podido cargar la vista previa" } -} \ No newline at end of file +} diff --git a/lib/core/i18n/fr.json b/lib/core/i18n/fr.json index 4bcfd68a24..4f5821d343 100644 --- a/lib/core/i18n/fr.json +++ b/lib/core/i18n/fr.json @@ -1,4 +1,25 @@ { + "FORM": { + "START_FORM": { + "TITLE": "Démarrer le formulaire" + }, + "PREVIEW": { + "IMAGE_NOT_AVAILABLE": "Aperçu non disponible" + }, + "FIELD": { + "UPLOAD": "Importer", + "REQUIRED": "*Obligatoire", + "VALIDATOR": { + "INVALID_NUMBER": "Utiliser un format de numéro différent", + "INVALID_DATE": "Utiliser un format de date différent", + "INVALID_VALUE": "Entrer une valeur différente", + "NOT_GREATER_THAN": "Ne peut pas être supérieur à {{ maxValue }}", + "NOT_LESS_THAN": "Ne peut pas être inférieur à {{ minValue }}", + "AT_LEAST_LONG": "Entrez {{ minLength }} caractères minimum", + "NO_LONGER_THAN": "Entrez {{ maxLength }} caractères maximum" + } + } + }, "CORE": { "PAGINATION": { "ITEMS_RANGE": "Affichage de {{ range }} sur {{ total }}", @@ -148,4 +169,4 @@ "LOADING": "Chargement en cours", "UNKNOWN_FORMAT": "Impossible de charger l'aperçu" } -} \ No newline at end of file +} diff --git a/lib/core/i18n/it.json b/lib/core/i18n/it.json index b4ca34cb72..c2bcd267ef 100644 --- a/lib/core/i18n/it.json +++ b/lib/core/i18n/it.json @@ -1,4 +1,25 @@ { + "FORM": { + "START_FORM": { + "TITLE": "Modulo di inizio" + }, + "PREVIEW": { + "IMAGE_NOT_AVAILABLE": "Anteprima non disponibile" + }, + "FIELD": { + "UPLOAD": "Carica", + "REQUIRED": "*Obbligatorio", + "VALIDATOR": { + "INVALID_NUMBER": "Usa un formato numerico diverso", + "INVALID_DATE": "Usa un formato di data diverso", + "INVALID_VALUE": "Immetti un valore diverso", + "NOT_GREATER_THAN": "Non può essere maggiore di {{ maxValue }}", + "NOT_LESS_THAN": "Non può essere inferiore di {{ minValue }}", + "AT_LEAST_LONG": "Immetti almeno {{ minLength }} caratteri", + "NO_LONGER_THAN": "Immetti non più di {{ maxLength }} caratteri" + } + } + }, "CORE": { "PAGINATION": { "ITEMS_RANGE": "Visualizzazione di {{ range }} su {{ total }}", @@ -148,4 +169,4 @@ "LOADING": "Caricamento in corso", "UNKNOWN_FORMAT": "Impossibile caricare l'anteprima" } -} \ No newline at end of file +} diff --git a/lib/core/i18n/ja.json b/lib/core/i18n/ja.json index 480b9abd8d..5e6e3a821e 100644 --- a/lib/core/i18n/ja.json +++ b/lib/core/i18n/ja.json @@ -1,4 +1,25 @@ { + "FORM": { + "START_FORM": { + "TITLE": "開始フォーム" + }, + "PREVIEW": { + "IMAGE_NOT_AVAILABLE": "プレビューは使用できません" + }, + "FIELD": { + "UPLOAD": "アップロード", + "REQUIRED": "*必須", + "VALIDATOR": { + "INVALID_NUMBER": "別の番号形式を使用してください", + "INVALID_DATE": "別の日付形式を使用してください", + "INVALID_VALUE": "別の値を入力してください", + "NOT_GREATER_THAN": "{{ maxValue }} より大きい値にすることはできません", + "NOT_LESS_THAN": "{{ minValue }} より小さい値にすることはできません", + "AT_LEAST_LONG": "{{ minLength }} 文字以上で入力してください", + "NO_LONGER_THAN": "{{ maxLength }} 文字以内で入力してください" + } + } + }, "CORE": { "PAGINATION": { "ITEMS_RANGE": "表示中: {{ range }} / {{ total }} 件", @@ -148,4 +169,4 @@ "LOADING": "読み込み中", "UNKNOWN_FORMAT": "プレビューを読み込めませんでした" } -} \ No newline at end of file +} diff --git a/lib/core/i18n/nb.json b/lib/core/i18n/nb.json index d5d1e31d63..2804165e23 100644 --- a/lib/core/i18n/nb.json +++ b/lib/core/i18n/nb.json @@ -1,4 +1,25 @@ { + "FORM": { + "START_FORM": { + "TITLE": "Start skjema" + }, + "PREVIEW": { + "IMAGE_NOT_AVAILABLE": "Forhåndsvisning ikke tilgjengelig" + }, + "FIELD": { + "UPLOAD": "Laster opp", + "REQUIRED": "*Påkrevd", + "VALIDATOR": { + "INVALID_NUMBER": "Bruk et annet nummerformat", + "INVALID_DATE": "Bruk et annet datoformat", + "INVALID_VALUE": "Angi en annen verdi", + "NOT_GREATER_THAN": "Kan ikke være større enn {{ maxValue }}", + "NOT_LESS_THAN": "Kan ikke være mindre enn {{ minValue }}", + "AT_LEAST_LONG": "Angi minst {{ minLength }} tegn", + "NO_LONGER_THAN": "Ikke angi flere enn {{ maxLength }} tegn" + } + } + }, "CORE": { "PAGINATION": { "ITEMS_RANGE": "Vis {{ range }} av {{ total }}", @@ -148,4 +169,4 @@ "LOADING": "Laster", "UNKNOWN_FORMAT": "Kan ikke laste forhåndsvisning" } -} \ No newline at end of file +} diff --git a/lib/core/i18n/nl.json b/lib/core/i18n/nl.json index c7dd3185ae..2f9aa1ca45 100644 --- a/lib/core/i18n/nl.json +++ b/lib/core/i18n/nl.json @@ -1,4 +1,25 @@ { + "FORM": { + "START_FORM": { + "TITLE": "Beginformulier" + }, + "PREVIEW": { + "IMAGE_NOT_AVAILABLE": "Preview niet beschikbaar" + }, + "FIELD": { + "UPLOAD": "Uploaden", + "REQUIRED": "*Verplicht", + "VALIDATOR": { + "INVALID_NUMBER": "Gebruik een andere getalnotatie", + "INVALID_DATE": "Gebruik een andere datumnotatie", + "INVALID_VALUE": "Voer een andere waarde in", + "NOT_GREATER_THAN": "Mag niet groter zijn dan {{ maxValue }}", + "NOT_LESS_THAN": "Mag niet kleiner zijn dan {{ minValue }}", + "AT_LEAST_LONG": "Voer minimaal {{ minLength }} tekens in", + "NO_LONGER_THAN": "Voer maximaal {{ maxLength }} tekens in" + } + } + }, "CORE": { "PAGINATION": { "ITEMS_RANGE": "{{ range }} van {{ total }} wordt weergegeven", @@ -148,4 +169,4 @@ "LOADING": "Wordt geladen", "UNKNOWN_FORMAT": "Kan voorbeeld niet laden" } -} \ No newline at end of file +} diff --git a/lib/core/i18n/pt-BR.json b/lib/core/i18n/pt-BR.json index 1ca23ecef3..41d185a245 100644 --- a/lib/core/i18n/pt-BR.json +++ b/lib/core/i18n/pt-BR.json @@ -1,4 +1,25 @@ { + "FORM": { + "START_FORM": { + "TITLE": "Iniciar formulário" + }, + "PREVIEW": { + "IMAGE_NOT_AVAILABLE": "Pré-visualização não disponível" + }, + "FIELD": { + "UPLOAD": "Carregar", + "REQUIRED": "*Obrigatório", + "VALIDATOR": { + "INVALID_NUMBER": "Use um formato de número diferente", + "INVALID_DATE": "Use um formato de data diferente", + "INVALID_VALUE": "Insira um valor diferente", + "NOT_GREATER_THAN": "Não pode ser maior do que {{ maxValue }}", + "NOT_LESS_THAN": "Não pode ser menor do que {{ minValue }}", + "AT_LEAST_LONG": "Insira no mínimo {{ minLength }} caracteres", + "NO_LONGER_THAN": "Insira no máximo {{ maxLength }} caracteres" + } + } + }, "CORE": { "PAGINATION": { "ITEMS_RANGE": "Mostrando {{ range }} de {{ total }}", @@ -148,4 +169,4 @@ "LOADING": "Carregando", "UNKNOWN_FORMAT": "Não foi possível carregar pré-visualização" } -} \ No newline at end of file +} diff --git a/lib/core/i18n/ru.json b/lib/core/i18n/ru.json index b2ff415533..e845d3867e 100644 --- a/lib/core/i18n/ru.json +++ b/lib/core/i18n/ru.json @@ -1,4 +1,25 @@ { + "FORM": { + "START_FORM": { + "TITLE": "Запустить форму" + }, + "PREVIEW": { + "IMAGE_NOT_AVAILABLE": "Предварительный просмотр недоступен" + }, + "FIELD": { + "UPLOAD": "Загрузить", + "REQUIRED": "*Обязательно для заполнения", + "VALIDATOR": { + "INVALID_NUMBER": "Используйте другой формат числа", + "INVALID_DATE": "Используйте другой формат даты", + "INVALID_VALUE": "Введите другое значение", + "NOT_GREATER_THAN": "Не может быть более {{ maxValue }}", + "NOT_LESS_THAN": "Не может быть менее {{ minValue }}", + "AT_LEAST_LONG": "Введите не менее {{ minLength }} символ", + "NO_LONGER_THAN": "Введите не более {{ maxLength }} символ" + } + } + }, "CORE": { "FILE_SIZE": { "BYTES": "Б", diff --git a/lib/core/i18n/zh-CN.json b/lib/core/i18n/zh-CN.json index 21b1e449a4..295405c99e 100644 --- a/lib/core/i18n/zh-CN.json +++ b/lib/core/i18n/zh-CN.json @@ -1,4 +1,25 @@ { + "FORM": { + "START_FORM": { + "TITLE": "启动表单" + }, + "PREVIEW": { + "IMAGE_NOT_AVAILABLE": "预览不可用" + }, + "FIELD": { + "UPLOAD": "上传", + "REQUIRED": "*必填项", + "VALIDATOR": { + "INVALID_NUMBER": "使用其他数字格式", + "INVALID_DATE": "使用其他日期格式", + "INVALID_VALUE": "输入其他值", + "NOT_GREATER_THAN": "不得大于 {{ maxValue }}", + "NOT_LESS_THAN": "不得小于 {{ minValue }}", + "AT_LEAST_LONG": "输入至少 {{ minLength }} 个字符", + "NO_LONGER_THAN": "不得输入超过 {{ maxLength }} 个字符" + } + } + }, "CORE": { "PAGINATION": { "ITEMS_RANGE": "显示 {{range}}/{{total}}", @@ -148,4 +169,4 @@ "LOADING": "正在加载", "UNKNOWN_FORMAT": "无法加载预览" } -} \ No newline at end of file +} diff --git a/lib/core/viewer/components/viewer.component.ts b/lib/core/viewer/components/viewer.component.ts index 8e1a6a1dec..efd58208e7 100644 --- a/lib/core/viewer/components/viewer.component.ts +++ b/lib/core/viewer/components/viewer.component.ts @@ -458,17 +458,21 @@ export class ViewerComponent implements OnChanges { await this.renditionService.convert(nodeId, 'pdf').toPromise(); this.viewerType = 'pdf'; this.urlFileContent = this.apiService.contentApi.getRenditionUrl(nodeId, 'pdf'); - } catch { + } catch (error) { + this.logService.error(error); } } - } catch { + } catch (error) { + this.logService.error(error); + try { const imagePreview = await this.apiService.renditionsApi.getRendition(nodeId, 'imgpreview'); if (imagePreview.entry.status.toString() === 'CREATED') { this.viewerType = 'image'; this.urlFileContent = this.apiService.contentApi.getRenditionUrl(nodeId, 'imgpreview'); } - } catch { + } catch (error) { + this.logService.error(error); } } @@ -484,14 +488,16 @@ export class ViewerComponent implements OnChanges { this.viewerType = 'pdf'; this.urlFileContent = this.apiService.contentApi.getSharedLinkRenditionUrl(sharedId, 'pdf'); } - } catch { + } catch (error) { + this.logService.error(error); try { const rendition = await this.apiService.renditionsApi.getSharedLinkRendition(sharedId, 'imgpreview'); if (rendition.entry.status.toString() === 'CREATED') { this.viewerType = 'image'; this.urlFileContent = this.apiService.contentApi.getSharedLinkRenditionUrl(sharedId, 'imgpreview'); } - } catch { + } catch (error) { + this.logService.error(error); } } diff --git a/lib/process-services/app-list/apps-list.component.spec.ts b/lib/process-services/app-list/apps-list.component.spec.ts index f3ec7ca70b..63f7296dd4 100644 --- a/lib/process-services/app-list/apps-list.component.spec.ts +++ b/lib/process-services/app-list/apps-list.component.spec.ts @@ -55,7 +55,7 @@ describe('AppsListComponent', () => { component = fixture.componentInstance; debugElement = fixture.debugElement; - service = fixture.debugElement.injector.get(AppsProcessService); + service = TestBed.get(AppsProcessService); getAppsSpy = spyOn(service, 'getDeployedApplications').and.returnValue(Observable.of(deployedApps)); }); diff --git a/lib/process-services/app-list/apps-list.module.ts b/lib/process-services/app-list/apps-list.module.ts index 26a8dfdc28..d6423d50d6 100644 --- a/lib/process-services/app-list/apps-list.module.ts +++ b/lib/process-services/app-list/apps-list.module.ts @@ -22,6 +22,7 @@ import { MaterialModule } from '../material.module'; import { TranslateModule } from '@ngx-translate/core'; import { AppsListComponent } from './apps-list.component'; +import { SelectAppsDialogComponent } from './select-apps-dialog-component'; @NgModule({ imports: [ @@ -31,11 +32,16 @@ import { AppsListComponent } from './apps-list.component'; TranslateModule ], declarations: [ - AppsListComponent + AppsListComponent, + SelectAppsDialogComponent ], providers: [], exports: [ - AppsListComponent + AppsListComponent, + SelectAppsDialogComponent + ], + entryComponents: [ + SelectAppsDialogComponent ] }) export class AppsListModule { diff --git a/lib/process-services/app-list/public-api.ts b/lib/process-services/app-list/public-api.ts index fb2c71a74d..48eb0254f0 100644 --- a/lib/process-services/app-list/public-api.ts +++ b/lib/process-services/app-list/public-api.ts @@ -16,3 +16,4 @@ */ export * from './apps-list.component'; +export * from './select-apps-dialog-component'; diff --git a/lib/process-services/app-list/select-apps-dialog-component.html b/lib/process-services/app-list/select-apps-dialog-component.html new file mode 100644 index 0000000000..e49a1c08f6 --- /dev/null +++ b/lib/process-services/app-list/select-apps-dialog-component.html @@ -0,0 +1,13 @@ +
{{'APP.DIALOG.TITLE' | translate}}
+
+ + + + {{ currentProcessApp.name }} + + + +
+
+ +
diff --git a/lib/process-services/app-list/select-apps-dialog-component.spec.ts b/lib/process-services/app-list/select-apps-dialog-component.spec.ts new file mode 100644 index 0000000000..3e236b10dc --- /dev/null +++ b/lib/process-services/app-list/select-apps-dialog-component.spec.ts @@ -0,0 +1,131 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Component } from '@angular/core'; +import { async, TestBed } from '@angular/core/testing'; +import { ComponentFixture } from '@angular/core/testing'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MaterialModule } from '../material.module'; +import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing'; +import { MatDialog } from '@angular/material'; +import { OverlayContainer } from '@angular/cdk/overlay'; +import { AppsProcessService } from '@alfresco/adf-core'; +import { deployedApps } from '../mock/apps-list.mock'; +import { Observable } from 'rxjs/Observable'; + +import { SelectAppsDialogComponent } from './select-apps-dialog-component'; + +@Component({ + selector: 'adf-dialog-test', + template: '' +}) +export class DialogSelectAppTestComponent { + + processId: any; + + dialogRef: any; + + constructor(private dialog: MatDialog) { + } + + startProcesAction() { + this.dialogRef = this.dialog.open(SelectAppsDialogComponent, { + width: '630px' + }); + + this.dialogRef.afterClosed().subscribe(selectedProcess => { + this.processId = selectedProcess.id; + }); + } + +} + +describe('Select app dialog', () => { + + let fixture: ComponentFixture; + let component: DialogSelectAppTestComponent; + let dialogRef; + let overlayContainerElement: HTMLElement; + let service: AppsProcessService; + + beforeEach(async(() => { + dialogRef = { + close: jasmine.createSpy('close') + }; + + TestBed.configureTestingModule({ + imports: [ + MaterialModule, + FormsModule, + ReactiveFormsModule, + BrowserDynamicTestingModule + ], + declarations: [ + SelectAppsDialogComponent, + DialogSelectAppTestComponent + ], + providers: [ + AppsProcessService, + { + provide: OverlayContainer, + useFactory: () => { + overlayContainerElement = document.createElement('div'); + return { getContainerElement: () => overlayContainerElement }; + } + } + { + provide: MatDialogRef, useValue: dialogRef + }, + { + provide: MAT_DIALOG_DATA, + useValue: {} + } + ] + }); + + TestBed.overrideModule(BrowserDynamicTestingModule, { + set: { entryComponents: [SelectAppsDialogComponent] } + }); + + TestBed.compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DialogSelectAppTestComponent); + component = fixture.componentInstance; + + service = TestBed.get(AppsProcessService); + + spyOn(service, 'getDeployedApplications').and.returnValue(Observable.of(deployedApps)); + }); + + describe('Dialog', () => { + + beforeEach(() => { + fixture.detectChanges(); + }; + + it('should init title and dropdown', () => { + component.startProcesAction(); + + expect(overlayContainerElement.querySelector('.adf-selet-app-dialog-title')).toBeDefined(); + expect(overlayContainerElement.querySelector('.adf-selet-app-dialog-dropdown')).toBeDefined(); + }); + }); + +}); diff --git a/lib/process-services/app-list/select-apps-dialog-component.ts b/lib/process-services/app-list/select-apps-dialog-component.ts new file mode 100644 index 0000000000..953de62b17 --- /dev/null +++ b/lib/process-services/app-list/select-apps-dialog-component.ts @@ -0,0 +1,56 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AppsProcessService, NotificationService, TranslationService } from '@alfresco/adf-core'; +import { Component, Inject } from '@angular/core'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; + +@Component({ + selector: 'adf-select-apps-dialog', + templateUrl: 'select-apps-dialog-component.html' +}) +export class SelectAppsDialogComponent { + + processApps: any; + + selectedProcess: any; + + constructor(private appsProcessService: AppsProcessService, + private translateService: TranslationService, + private notificationService: NotificationService, + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any) { + + this.appsProcessService.getDeployedApplications().subscribe( + (apps: any[]) => { + this.processApps = apps.filter((currentApp) => { + return currentApp.id; + }); + }, + (err) => { + this.translateService.get('TAG.MESSAGES.EXIST').subscribe((error) => { + this.notificationService.openSnackMessage(error, 4000); + }); + } + ); + + } + + onStart(): void { + this.dialogRef.close(this.selectedProcess); + } +} diff --git a/lib/process-services/content-widget/attach-file-widget.component.html b/lib/process-services/content-widget/attach-file-widget.component.html index e15123e9a1..561efd3ac3 100644 --- a/lib/process-services/content-widget/attach-file-widget.component.html +++ b/lib/process-services/content-widget/attach-file-widget.component.html @@ -25,7 +25,7 @@
diff --git a/lib/process-services/content-widget/attach-file-widget.component.ts b/lib/process-services/content-widget/attach-file-widget.component.ts index f355ebbbf8..9eab0f881f 100644 --- a/lib/process-services/content-widget/attach-file-widget.component.ts +++ b/lib/process-services/content-widget/attach-file-widget.component.ts @@ -40,11 +40,9 @@ import { Observable } from 'rxjs/Observable'; }) export class AttachFileWidgetComponent extends UploadWidgetComponent implements OnInit { - alfrescoLogoUrl: string = '../assets/images/alfresco-flower.svg'; repositoryList = []; - constructor( - public formService: FormService, + constructor(public formService: FormService, private logger: LogService, public thumbnails: ThumbnailService, public processContentService: ProcessContentService, @@ -69,36 +67,36 @@ export class AttachFileWidgetComponent extends UploadWidgetComponent implements return !!this.field.params && !!this.field.params.fileSource; } - isMultipleSourceUpload() { + isMultipleSourceUpload(): boolean { return !this.field.readOnly && this.isFileSourceConfigured() && !this.isOnlyLocalSourceSelected(); } - isAllFileSourceSelected() { + isAllFileSourceSelected(): boolean { return this.field.params && this.field.params.fileSource && this.field.params.fileSource.serviceId === 'all-file-sources'; } - isOnlyLocalSourceSelected() { + isOnlyLocalSourceSelected(): boolean { return this.field.params && this.field.params.fileSource && this.field.params.fileSource.serviceId === 'local-file'; } - isSimpleUploadButton() { + isSimpleUploadButton(): boolean { return this.isUploadButtonVisible() && - !this.isFileSourceConfigured() || - this.isOnlyLocalSourceSelected(); + !this.isFileSourceConfigured() || + this.isOnlyLocalSourceSelected(); } - isUploadButtonVisible() { + isUploadButtonVisible(): boolean { return (!this.hasFile || this.multipleOption) && !this.field.readOnly; } - isDefinedSourceFolder() { + isDefinedSourceFolder(): boolean { return !!this.field.params && - !!this.field.params.fileSource && - !!this.field.params.fileSource.selectedFolder; + !!this.field.params.fileSource && + !!this.field.params.fileSource.selectedFolder; } openSelectDialogFromFileSource() { @@ -106,7 +104,7 @@ export class AttachFileWidgetComponent extends UploadWidgetComponent implements if (this.isDefinedSourceFolder()) { this.contentDialog.openFileBrowseDialogByFolderId(params.fileSource.selectedFolder.pathId).subscribe( (selections: MinimalNodeEntryEntity[]) => { - this.uploadFileFromShare(selections, + this.uploadFileFromCS(selections, this.field.params.fileSource.selectedFolder.accountId, this.field.params.fileSource.selectedFolder.siteId); }); @@ -117,11 +115,11 @@ export class AttachFileWidgetComponent extends UploadWidgetComponent implements const accountIdentifier = 'alfresco-' + repoId + repoName; this.contentDialog.openFileBrowseDialogBySite().subscribe( (selections: MinimalNodeEntryEntity[]) => { - this.uploadFileFromShare(selections, accountIdentifier); + this.uploadFileFromCS(selections, accountIdentifier); }); } - private uploadFileFromShare(fileNodeList: MinimalNodeEntryEntity[], accountId: string, siteId?: string) { + private uploadFileFromCS(fileNodeList: MinimalNodeEntryEntity[], accountId: string, siteId?: string) { let filesSaved = []; Observable.from(fileNodeList) .mergeMap(node => @@ -131,7 +129,9 @@ export class AttachFileWidgetComponent extends UploadWidgetComponent implements ).subscribe((res) => { filesSaved.push(res); }, - (error) => { this.logger.error(error); }, + (error) => { + this.logger.error(error); + }, () => { this.field.value = filesSaved; this.field.json.value = filesSaved; diff --git a/lib/process-services/i18n/en.json b/lib/process-services/i18n/en.json index 1a4266b833..e1e063157f 100644 --- a/lib/process-services/i18n/en.json +++ b/lib/process-services/i18n/en.json @@ -302,5 +302,13 @@ "NEW_TASK": "New Task", "NEW_PROCESS": "New Process" } + }, + "APP":{ + "DIALOG" :{ + "START" : "Start", + "TITLE" : "Select a process", + "LIST": "Proces list", + "ERROR" : "Possible connection with process service not present" + } } } diff --git a/lib/process-services/process-list/components/start-process.component.html b/lib/process-services/process-list/components/start-process.component.html index e5003b9e7f..bba11f209e 100644 --- a/lib/process-services/process-list/components/start-process.component.html +++ b/lib/process-services/process-list/components/start-process.component.html @@ -17,6 +17,7 @@ { + let appConfig: AppConfigService; + let activitiContentService: ActivitiContentService; let component: StartProcessInstanceComponent; let fixture: ComponentFixture; let processService: ProcessService; @@ -54,6 +56,7 @@ describe('StartProcessInstanceComponent', () => { StartProcessInstanceComponent ], providers: [ + ActivitiContentService, ProcessService, FormService ] @@ -61,7 +64,8 @@ describe('StartProcessInstanceComponent', () => { })); beforeEach(() => { - + appConfig = TestBed.get(AppConfigService); + activitiContentService = TestBed.get(ActivitiContentService); fixture = TestBed.createComponent(StartProcessInstanceComponent); component = fixture.componentInstance; processService = fixture.debugElement.injector.get(ProcessService); @@ -70,7 +74,7 @@ describe('StartProcessInstanceComponent', () => { getDefinitionsSpy = spyOn(processService, 'getProcessDefinitions').and.returnValue(Observable.of(testProcessDefs)); startProcessSpy = spyOn(processService, 'startProcess').and.returnValue(Observable.of(newProcess)); getStartFormDefinitionSpy = spyOn(formService, 'getStartFormDefinition').and.returnValue(Observable.of(taskFormMock)); - + spyOn(activitiContentService, 'applyAlfrescoNode').and.returnValue(Observable.of({ id: 1234 })); }); it('should create instance of StartProcessInstanceComponent', () => { @@ -81,7 +85,7 @@ describe('StartProcessInstanceComponent', () => { it('should call service to fetch process definitions with appId', () => { let change = new SimpleChange(null, '123', true); - component.ngOnChanges({'appId': change}); + component.ngOnChanges({ 'appId': change }); fixture.detectChanges(); expect(getDefinitionsSpy).toHaveBeenCalledWith('123'); @@ -89,7 +93,7 @@ describe('StartProcessInstanceComponent', () => { it('should call service to fetch process definitions without appId', () => { let change = new SimpleChange(null, null, true); - component.ngOnChanges({'appId': change}); + component.ngOnChanges({ 'appId': change }); fixture.detectChanges(); expect(getDefinitionsSpy).toHaveBeenCalledWith(null); @@ -97,7 +101,7 @@ describe('StartProcessInstanceComponent', () => { it('should call service to fetch process definitions with appId when provided', () => { let change = new SimpleChange(null, '123', true); - component.ngOnChanges({'appId': change}); + component.ngOnChanges({ 'appId': change }); fixture.detectChanges(); expect(getDefinitionsSpy).toHaveBeenCalledWith('123'); @@ -105,7 +109,7 @@ describe('StartProcessInstanceComponent', () => { it('should display the correct number of processes in the select list', () => { let change = new SimpleChange(null, '123', true); - component.ngOnChanges({'appId': change}); + component.ngOnChanges({ 'appId': change }); fixture.detectChanges(); let selectElement = fixture.nativeElement.querySelector('mat-select'); @@ -114,7 +118,7 @@ describe('StartProcessInstanceComponent', () => { it('should display the option def details', () => { let change = new SimpleChange(null, '123', true); - component.ngOnChanges({'appId': change}); + component.ngOnChanges({ 'appId': change }); component.processDefinitions = testProcessDefs; fixture.detectChanges(); fixture.whenStable().then(() => { @@ -131,7 +135,7 @@ describe('StartProcessInstanceComponent', () => { it('should indicate an error to the user if process defs cannot be loaded', async(() => { getDefinitionsSpy = getDefinitionsSpy.and.returnValue(Observable.throw({})); let change = new SimpleChange(null, '123', true); - component.ngOnChanges({'appId': change}); + component.ngOnChanges({ 'appId': change }); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -144,7 +148,7 @@ describe('StartProcessInstanceComponent', () => { it('should show no process available message when no process definition is loaded', async(() => { getDefinitionsSpy = getDefinitionsSpy.and.returnValue(Observable.of([])); let change = new SimpleChange(null, '123', true); - component.ngOnChanges({'appId': change}); + component.ngOnChanges({ 'appId': change }); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -156,7 +160,7 @@ describe('StartProcessInstanceComponent', () => { it('should auto-select process def from dropdown if there is just one process def', () => { let change = new SimpleChange(null, '123', true); - component.ngOnChanges({'appId': change}); + component.ngOnChanges({ 'appId': change }); component.processDefinitions[0] = testProcessDefRepr; fixture.detectChanges(); fixture.whenStable().then(() => { @@ -183,17 +187,17 @@ describe('StartProcessInstanceComponent', () => { })); it('should reload processes when appId input changed', () => { - component.ngOnChanges({appId: change}); + component.ngOnChanges({ appId: change }); expect(getDefinitionsSpy).toHaveBeenCalledWith(456); }); it('should reload processes when appId input changed to null', () => { - component.ngOnChanges({appId: nullChange}); + component.ngOnChanges({ appId: nullChange }); expect(getDefinitionsSpy).toHaveBeenCalledWith(null); }); it('should get current processDeff', () => { - component.ngOnChanges({appId: change}); + component.ngOnChanges({ appId: change }); component.onProcessDefChange('my:Process'); fixture.detectChanges(); expect(getDefinitionsSpy).toHaveBeenCalled(); @@ -206,7 +210,7 @@ describe('StartProcessInstanceComponent', () => { beforeEach(() => { component.name = 'My new process'; let change = new SimpleChange(null, 123, true); - component.ngOnChanges({'appId': change}); + component.ngOnChanges({ 'appId': change }); }); it('should call service to start process if required fields provided', async(() => { @@ -261,7 +265,7 @@ describe('StartProcessInstanceComponent', () => { it('should throw error event when process cannot be started', async(() => { let errorSpy = spyOn(component.error, 'error'); - let error = {message: 'My error'}; + let error = { message: 'My error' }; startProcessSpy = startProcessSpy.and.returnValue(Observable.throw(error)); component.onProcessDefChange('my:process1'); component.startProcess(); @@ -331,7 +335,7 @@ describe('StartProcessInstanceComponent', () => { beforeEach(async(() => { component.name = 'My new process'; let change = new SimpleChange(null, '123', true); - component.ngOnChanges({'appId': change}); + component.ngOnChanges({ 'appId': change }); fixture.detectChanges(); })); @@ -374,7 +378,7 @@ describe('StartProcessInstanceComponent', () => { beforeEach(() => { getDefinitionsSpy.and.returnValue(Observable.of(testProcessDefWithForm)); let change = new SimpleChange(null, '123', true); - component.ngOnChanges({'appId': change}); + component.ngOnChanges({ 'appId': change }); component.onProcessDefChange('my:process1'); fixture.detectChanges(); fixture.whenStable(); @@ -397,7 +401,7 @@ describe('StartProcessInstanceComponent', () => { })); it('should emit cancel event on cancel Button', () => { - let cancelButton = fixture.nativeElement.querySelector('#cancle_process'); + let cancelButton = fixture.nativeElement.querySelector('#cancle_process'); let cancelSpy: jasmine.Spy = spyOn(component.cancel, 'emit'); cancelButton.click(); fixture.detectChanges(); @@ -405,6 +409,35 @@ describe('StartProcessInstanceComponent', () => { }); }); + describe('CS content connection', () => { + + fit('alfrescoRepositoryName default configuration property', () => { + expect(component.getAlfrescoRepositoryName()).toBe('alfresco-1Alfresco'); + }); + + fit('alfrescoRepositoryName configuration property should be fetched', () => { + appConfig.config = Object.assign(appConfig.config, { + 'alfrescoRepositoryName': 'alfresco-123' + }; + + expect(component.getAlfrescoRepositoryName()).toBe('alfresco-123Alfresco'); + }); + + fit('if values in input is a node should be linked in the process service', () => { + + component.values = {}; + component.values['file'] = { + isFile: true, + name= 'example-file' + }; + + component.moveNodeFromCStoPS(); + + fixture.whenStable().then(() => { + expect(component.values.file[0].id).toBe(1234); + }); + }); + }); }); }); diff --git a/lib/process-services/process-list/components/start-process.component.ts b/lib/process-services/process-list/components/start-process.component.ts index c0af3d8cf0..3dde162421 100644 --- a/lib/process-services/process-list/components/start-process.component.ts +++ b/lib/process-services/process-list/components/start-process.component.ts @@ -15,8 +15,23 @@ * limitations under the License. */ -import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild, ViewEncapsulation } from '@angular/core'; -import { StartFormComponent, FormRenderingService } from '@alfresco/adf-core'; +import { + Component, + EventEmitter, + Input, + OnChanges, + Output, + SimpleChanges, + ViewChild, + ViewEncapsulation +} from '@angular/core'; +import { + ActivitiContentService, + AppConfigService, + StartFormComponent, + FormRenderingService, + FormValues +} from '@alfresco/adf-core'; import { ProcessInstanceVariable } from '../models/process-instance-variable.model'; import { ProcessDefinitionRepresentation } from './../models/process-definition.model'; import { ProcessInstance } from './../models/process-instance.model'; @@ -37,6 +52,12 @@ export class StartProcessInstanceComponent implements OnChanges { @Input() variables: ProcessInstanceVariable[]; + @Input() + values: FormValues; + + @Input() + name: string; + @Output() start: EventEmitter = new EventEmitter(); @@ -51,19 +72,23 @@ export class StartProcessInstanceComponent implements OnChanges { processDefinitions: ProcessDefinitionRepresentation[] = []; - name: string; - currentProcessDef: ProcessDefinitionRepresentation = new ProcessDefinitionRepresentation(); errorMessageId: string = ''; constructor(private activitiProcess: ProcessService, - private formRenderingService: FormRenderingService) { + private formRenderingService: FormRenderingService, + private activitiContentService: ActivitiContentService, + private appConfig: AppConfigService) { this.formRenderingService.setComponentTypeResolver('upload', () => AttachFileWidgetComponent, true); this.formRenderingService.setComponentTypeResolver('select-folder', () => AttachFolderWidgetComponent, true); } ngOnChanges(changes: SimpleChanges) { + if (changes['values'] && changes['values'].currentValue) { + this.moveNodeFromCStoPS(); + } + let appIdChange = changes['appId']; let appId = appIdChange ? appIdChange.currentValue : null; this.load(appId); @@ -82,6 +107,30 @@ export class StartProcessInstanceComponent implements OnChanges { ); } + getAlfrescoRepositoryName(): string { + let alfrescoRepositoryName = this.appConfig.get('alfrescoRepositoryName'); + if (!alfrescoRepositoryName) { + alfrescoRepositoryName = 'alfresco-1'; + } + return alfrescoRepositoryName + 'Alfresco'; + } + + moveNodeFromCStoPS() { + let accountIdentifier = this.getAlfrescoRepositoryName(); + + for (let key in this.values) { + if (this.values.hasOwnProperty(key)) { + let currentValue = this.values[key]; + + if (currentValue.isFile) { + this.activitiContentService.applyAlfrescoNode(currentValue, null, accountIdentifier).subscribe((res) => { + this.values[key] = [res]; + }); + } + } + } + } + public startProcess(outcome?: string) { if (this.currentProcessDef.id && this.name) { this.resetErrorMessage(); @@ -121,7 +170,7 @@ export class StartProcessInstanceComponent implements OnChanges { this.cancel.emit(); } - hasStartForm() { + hasStartForm(): boolean { return this.currentProcessDef && this.currentProcessDef.hasStartForm; } @@ -129,7 +178,7 @@ export class StartProcessInstanceComponent implements OnChanges { return this.processDefinitions ? (this.processDefinitions.length > 0 || this.errorMessageId) : this.errorMessageId; } - isStartFormMissingOrValid() { + isStartFormMissingOrValid(): boolean { if (this.startForm) { return this.startForm.form && this.startForm.form.isValid; } else { @@ -137,7 +186,7 @@ export class StartProcessInstanceComponent implements OnChanges { } } - validateForm() { + validateForm(): boolean { return this.currentProcessDef.id && this.name && this.isStartFormMissingOrValid(); } @@ -149,7 +198,7 @@ export class StartProcessInstanceComponent implements OnChanges { this.errorMessageId = ''; } - hasErrorMessage() { + hasErrorMessage(): boolean { return this.processDefinitions.length === 0 && !this.errorMessageId; } diff --git a/lib/process-services/process-list/services/process.service.ts b/lib/process-services/process-list/services/process.service.ts index 3239cb1249..b087c37587 100644 --- a/lib/process-services/process-list/services/process.service.ts +++ b/lib/process-services/process-list/services/process.service.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { AlfrescoApiService } from '@alfresco/adf-core'; +import { AlfrescoApiService, FormValues } from '@alfresco/adf-core'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs/Observable'; import { TaskDetailsModel } from '../../task-list'; @@ -98,7 +98,7 @@ export class ProcessService { .catch(err => this.handleProcessError(err)); } - startProcess(processDefinitionId: string, name: string, outcome?: string, startFormValues?: any, variables?: ProcessInstanceVariable[]): Observable { + startProcess(processDefinitionId: string, name: string, outcome?: string, startFormValues?: FormValues, variables?: ProcessInstanceVariable[]): Observable { let startRequest: any = { name: name, processDefinitionId: processDefinitionId