[ADF-2055] Ability to pre-populate form with a file and values (#2834)

* fix translations form

* fix style webpack script

* fix tslint error problem in viewer

* fix naming problems in attach file widget

* add start process form values data initialization option

* fix translation problems

* missing return type

* start process name configuration

* add CS cross PS configuration

* start process from file example

* fix minor issues

* add documentation and move the dialog in a separate component

* easy test select app

* alfrescoRepositoryName right property

* file conversion test

* fix issue after CR

* Remove forgotten semicolon.
This commit is contained in:
Eugenio Romano
2018-01-17 17:06:00 +00:00
committed by GitHub
parent 244234db4f
commit b1fd6cb60c
48 changed files with 789 additions and 344 deletions

View File

@@ -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}}"
}
}
}

View File

@@ -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"

View File

@@ -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}}"
}
}
}

View File

@@ -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}}"
}
}
}

View File

@@ -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}}"
}
}
}

View File

@@ -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}} 権限がありません"
}
}
}

View File

@@ -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}}"
}
}
}

View File

@@ -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}}"
}
}
}

View File

@@ -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}}"
}
}
}

View File

@@ -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}}"
}
}
}

View File

@@ -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}} 权限"
}
}
}

View File

@@ -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) {

View File

@@ -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"
}
}
}

View File

@@ -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",

View File

@@ -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"
}
}
}

View File

@@ -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"
}
}
}

View File

@@ -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"
}
}
}

View File

@@ -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": "プレビューを読み込めませんでした"
}
}
}

View File

@@ -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"
}
}
}

View File

@@ -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"
}
}
}

View File

@@ -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"
}
}
}

View File

@@ -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": "Б",

View File

@@ -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": "无法加载预览"
}
}
}

View File

@@ -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);
}
}

View File

@@ -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));
});

View File

@@ -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 {

View File

@@ -16,3 +16,4 @@
*/
export * from './apps-list.component';
export * from './select-apps-dialog-component';

View File

@@ -0,0 +1,13 @@
<header mat-dialog-title id="adf-selet-app-dialog-title">{{'APP.DIALOG.TITLE' | translate}}</header>
<section mat-dialog-content>
<mat-select id="adf-selet-app-dialog-dropdown" placeholder="{{'APP.DIALOG.LIST' | translate}}" [(value)]="selectedProcess" >
<mat-option *ngFor="let currentProcessApp of processApps" [value]="currentProcessApp">
{{ currentProcessApp.name }}
</mat-option>
</mat-select>
</section>
<footer mat-dialog-actions fxLayout="row" fxLayoutAlign="end center">
<button mat-button (click)="onStart()">{{'APP.DIALOG.START' | translate}}</button>
</footer>

View File

@@ -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<DialogSelectAppTestComponent>;
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();
});
});
});

View File

@@ -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<SelectAppsDialogComponent>,
@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);
}
}

View File

@@ -25,7 +25,7 @@
<button mat-menu-item (click)="uploadFile.click()"
id="attach-local-file"
*ngIf="isAllFileSourceSelected()">
From HD
{{ 'FORM.FIELD.LOCALSTORAGE' | translate }}
<mat-icon>file_upload</mat-icon>
<input #uploadFile
class="adf-attach-widget__input-type"
@@ -38,18 +38,18 @@
*ngIf="isDefinedSourceFolder()"
id="attach-{{field.params?.fileSource?.name}}"
(click)="openSelectDialogFromFileSource()">
From {{field.params?.fileSource?.name}}
{{field.params?.fileSource?.name}}
<mat-icon>
<img class="adf-attach-widget__image-logo" [src]="alfrescoLogoUrl">
<img class="adf-attach-widget__image-logo" src="../assets/images/alfresco-flower.svg">
</mat-icon>
</button>
<div *ngIf="!isDefinedSourceFolder()">
<button mat-menu-item *ngFor="let repo of repositoryList"
id="attach-{{repo?.name}}"
(click)="openSelectDialog(repo.id, repo.name)">
From {{repo.name}}
{{repo.name}}
<mat-icon>
<img class="adf-attach-widget__image-logo" [src]="alfrescoLogoUrl">
<img class="adf-attach-widget__image-logo" src="../assets/images/alfresco-flower.svg">
</mat-icon>
</button>
</div>

View File

@@ -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;

View File

@@ -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"
}
}
}

View File

@@ -17,6 +17,7 @@
</mat-select>
</mat-form-field>
<adf-start-form *ngIf="hasStartForm()"
[data]="values"
[disableStartProcessButton]="!hasProcessName()"
[processDefinitionId]="currentProcessDef.id"
(outcomeClick)="onOutcomeClick($event)"

View File

@@ -23,7 +23,7 @@ import {
MatInputModule,
MatSelectModule
} from '@angular/material';
import { FormModule, FormService } from '@alfresco/adf-core';
import { ActivitiContentService, AppConfigService, FormModule, FormService } from '@alfresco/adf-core';
import { Observable } from 'rxjs/Observable';
import { ProcessInstanceVariable } from '../models/process-instance-variable.model';
@@ -33,6 +33,8 @@ import { StartProcessInstanceComponent } from './start-process.component';
describe('StartProcessInstanceComponent', () => {
let appConfig: AppConfigService;
let activitiContentService: ActivitiContentService;
let component: StartProcessInstanceComponent;
let fixture: ComponentFixture<StartProcessInstanceComponent>;
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);
});
});
});
});
});

View File

@@ -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<ProcessInstance> = new EventEmitter<ProcessInstance>();
@@ -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<string>('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;
}

View File

@@ -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<ProcessInstance> {
startProcess(processDefinitionId: string, name: string, outcome?: string, startFormValues?: FormValues, variables?: ProcessInstanceVariable[]): Observable<ProcessInstance> {
let startRequest: any = {
name: name,
processDefinitionId: processDefinitionId