mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-16 18:13:06 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee5fe6dab9 | ||
|
|
6516b9f0ce |
+4
-16
@@ -1,4 +1,5 @@
|
||||
# Editor configuration, see http://editorconfig.org
|
||||
# http://editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
@@ -9,23 +10,10 @@ end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.json]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.yaml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.yml]
|
||||
[package.json]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.md]
|
||||
max_line_length = off
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[resources/*.json]
|
||||
indent_size = 2
|
||||
max_line_length = off
|
||||
insert_final_newline = false
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
.angular
|
||||
nxcache
|
||||
node_modules
|
||||
dist
|
||||
coverage
|
||||
.github
|
||||
.vscode
|
||||
scripts
|
||||
/angular.json
|
||||
docs/**/*.md
|
||||
lib/js-api/docs/**/*.md
|
||||
.storybook
|
||||
webpack.config.js
|
||||
lib/core/src/lib/icon
|
||||
-249
@@ -1,249 +0,0 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
|
||||
ignorePatterns: ['projects/**/*', '**/node_modules/**/*', 'lib/cli/node_modules/**/*', '**/node_modules', '**/assets', '**/scripts', '**/docs'],
|
||||
|
||||
plugins: ['@nx'],
|
||||
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.ts'],
|
||||
parserOptions: {
|
||||
project: ['tsconfig.json'],
|
||||
createDefaultProgram: true
|
||||
},
|
||||
extends: [
|
||||
'plugin:@nx/typescript',
|
||||
'plugin:@nx/angular',
|
||||
'plugin:@cspell/recommended',
|
||||
'plugin:@angular-eslint/recommended',
|
||||
'plugin:@angular-eslint/template/process-inline-templates',
|
||||
'plugin:jsdoc/recommended-typescript-error'
|
||||
// Uncomment this once all linting issues are fixed
|
||||
// Note to developers:
|
||||
// you can uncomment the full ruleset locally when fixing issues, and then comment
|
||||
// that will allow splitting the work into smaller chunks
|
||||
// 'plugin:unicorn/recommended'
|
||||
],
|
||||
plugins: [
|
||||
'eslint-plugin-unicorn',
|
||||
'eslint-plugin-rxjs',
|
||||
'prettier',
|
||||
'ban',
|
||||
'license-header',
|
||||
'@cspell',
|
||||
'eslint-plugin-import',
|
||||
'@angular-eslint/eslint-plugin',
|
||||
'@typescript-eslint',
|
||||
'jsdoc'
|
||||
],
|
||||
rules: {
|
||||
// Uncomment this to enable prettier checks as part of the ESLint
|
||||
// 'prettier/prettier': 'error',
|
||||
'ban/ban': [
|
||||
'error',
|
||||
{ name: 'eval', message: 'Calls to eval is not allowed.' },
|
||||
{ name: 'fdescribe', message: 'Calls to fdescribe is not allowed' },
|
||||
{ name: 'fit', message: 'Calls to fit is not allowed' },
|
||||
{ name: 'xit', message: 'Calls to xit is not allowed' },
|
||||
{ name: 'xdescribe', message: 'Calls to xdescribe is not allowed' },
|
||||
{ name: ['test', 'only'], message: 'Calls to test.only is not allowed' },
|
||||
{ name: ['describe', 'only'], message: 'Calls to describe.only is not allowed' }
|
||||
],
|
||||
'@angular-eslint/component-selector': [
|
||||
'error',
|
||||
{
|
||||
type: 'element',
|
||||
prefix: ['adf', 'app'],
|
||||
style: 'kebab-case'
|
||||
}
|
||||
],
|
||||
'@angular-eslint/directive-selector': [
|
||||
'error',
|
||||
{
|
||||
type: ['element', 'attribute'],
|
||||
prefix: ['adf', 'app'],
|
||||
style: 'kebab-case'
|
||||
}
|
||||
],
|
||||
'@angular-eslint/no-host-metadata-property': 'off',
|
||||
'@angular-eslint/no-input-prefix': 'error',
|
||||
'@angular-eslint/prefer-inject': 'error',
|
||||
'@typescript-eslint/consistent-type-definitions': 'error',
|
||||
'@typescript-eslint/dot-notation': 'off',
|
||||
'@typescript-eslint/explicit-member-accessibility': [
|
||||
'off',
|
||||
{
|
||||
accessibility: 'explicit'
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/await-thenable': 'error',
|
||||
'@typescript-eslint/prefer-optional-chain': 'error',
|
||||
'@typescript-eslint/prefer-readonly': 'error',
|
||||
'@typescript-eslint/no-inferrable-types': 'off',
|
||||
'@typescript-eslint/no-require-imports': 'off',
|
||||
'@typescript-eslint/no-var-requires': 'error',
|
||||
'@typescript-eslint/naming-convention': [
|
||||
'error',
|
||||
{
|
||||
selector: [
|
||||
'classProperty',
|
||||
'objectLiteralProperty',
|
||||
'typeProperty',
|
||||
'classMethod',
|
||||
'objectLiteralMethod',
|
||||
'typeMethod',
|
||||
'accessor',
|
||||
'enumMember'
|
||||
],
|
||||
format: null,
|
||||
modifiers: ['requiresQuotes']
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/member-ordering': 'off',
|
||||
'@typescript-eslint/no-empty-function': 'off',
|
||||
'prefer-arrow/prefer-arrow-functions': 'off',
|
||||
'prefer-promise-reject-errors': 'error',
|
||||
'brace-style': 'off',
|
||||
'@typescript-eslint/brace-style': 'error',
|
||||
'comma-dangle': 'error',
|
||||
'default-case': 'error',
|
||||
'import/order': 'off',
|
||||
'max-len': [
|
||||
'error',
|
||||
{
|
||||
code: 240
|
||||
}
|
||||
],
|
||||
'no-bitwise': 'off',
|
||||
'no-console': [
|
||||
'error',
|
||||
{
|
||||
allow: [
|
||||
'warn',
|
||||
'dir',
|
||||
'timeLog',
|
||||
'assert',
|
||||
'clear',
|
||||
'count',
|
||||
'countReset',
|
||||
'group',
|
||||
'groupEnd',
|
||||
'table',
|
||||
'dirxml',
|
||||
'error',
|
||||
'groupCollapsed',
|
||||
'Console',
|
||||
'profile',
|
||||
'profileEnd',
|
||||
'timeStamp',
|
||||
'context'
|
||||
]
|
||||
}
|
||||
],
|
||||
'no-duplicate-imports': 'error',
|
||||
'no-multiple-empty-lines': 'error',
|
||||
'no-redeclare': 'off',
|
||||
'@typescript-eslint/no-redeclare': ['off', { ignoreDeclarationMerge: true }],
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{
|
||||
argsIgnorePattern: '^_',
|
||||
varsIgnorePattern: '^_',
|
||||
caughtErrorsIgnorePattern: '^_'
|
||||
}
|
||||
],
|
||||
'no-return-await': 'error',
|
||||
'rxjs/no-create': 'error',
|
||||
'rxjs/no-subject-unsubscribe': 'error',
|
||||
'rxjs/no-subject-value': 'error',
|
||||
'rxjs/no-unsafe-takeuntil': 'error',
|
||||
'unicorn/filename-case': 'error',
|
||||
'unicorn/prefer-optional-catch-binding': 'error',
|
||||
'@typescript-eslint/no-unused-expressions': [
|
||||
'error',
|
||||
{
|
||||
allowShortCircuit: true,
|
||||
allowTernary: true
|
||||
}
|
||||
],
|
||||
'license-header/header': [
|
||||
'error',
|
||||
[
|
||||
'/*!',
|
||||
' * @license',
|
||||
' * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.',
|
||||
' *',
|
||||
' * 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.',
|
||||
' */'
|
||||
]
|
||||
],
|
||||
'no-restricted-syntax': [
|
||||
'error',
|
||||
{
|
||||
selector: "Identifier[name='CUSTOM_ELEMENTS_SCHEMA']",
|
||||
message: 'The use of CUSTOM_ELEMENTS_SCHEMA is not allowed. Consider alternatives for proper schema handling.'
|
||||
},
|
||||
{
|
||||
selector: "Identifier[name='NO_ERRORS_SCHEMA']",
|
||||
message: 'The use of NO_ERRORS_SCHEMA is not allowed. Consider alternatives for proper schema handling.'
|
||||
},
|
||||
{
|
||||
selector: 'TSEnumDeclaration',
|
||||
message: 'Enums are not allowed. Use string literal types (e.g., type Foo = "a" | "b") or const objects instead.'
|
||||
},
|
||||
{
|
||||
selector: ':matches(Literal[value=/ng-reflect-/], TemplateElement[value.cooked=/ng-reflect-/])',
|
||||
message: '*ng-reflect-* attributes should not be used. Consider alternatives for proper selectors.'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['*.html'],
|
||||
extends: ['plugin:@angular-eslint/template/recommended', 'plugin:@angular-eslint/template/accessibility'],
|
||||
parser: '@angular-eslint/template-parser',
|
||||
rules: {
|
||||
'@angular-eslint/template/prefer-self-closing-tags': 'error'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['*.spec.ts'],
|
||||
plugins: ['@alfresco/eslint-angular'],
|
||||
rules: {
|
||||
'@alfresco/eslint-angular/no-angular-material-selectors': 'error',
|
||||
'@angular-eslint/component-class-suffix': 'off'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['*.ts'],
|
||||
extends: ['plugin:@angular-eslint/template/process-inline-templates'],
|
||||
excludedFiles: ['*.spec.ts']
|
||||
},
|
||||
{
|
||||
files: ['*.json'],
|
||||
parser: 'jsonc-eslint-parser',
|
||||
rules: {
|
||||
'comma-dangle': ['error', 'never']
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/*.stories.ts'],
|
||||
rules: {
|
||||
'@cspell/spellchecker': 'off'
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
extends: ['plugin:storybook/recommended']
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"extends": ["./.eslintrc.js"]
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
# Each line is a file pattern followed by one or more owners.
|
||||
|
||||
# These owners will be the default owners for everything in
|
||||
# the repo. Unless a later match takes precedence,
|
||||
# these users will be requested for
|
||||
# review when someone opens a pull request.
|
||||
* @eromano @popovicsandras @DenysVuika
|
||||
|
||||
# Order is important; the last matching pattern takes the most
|
||||
# precedence. When someone opens a pull request that only
|
||||
# modifies JS files, only @js-owner and not the global
|
||||
# owner(s) will be requested for a review.
|
||||
/e2e/ @eromano @cristinaj
|
||||
|
||||
# The `docs/*` pattern will match files like
|
||||
# `docs/getting-started.md` but not further nested files like
|
||||
# `docs/build-app/troubleshooting.md`.
|
||||
/docs/ @m-hulbert @eromano
|
||||
@@ -1,72 +0,0 @@
|
||||
name: "before-install"
|
||||
description: "launch before_install.sh and then parse env vars"
|
||||
inputs:
|
||||
act:
|
||||
description: 'enable act debug'
|
||||
required: false
|
||||
type: boolean
|
||||
default: 'false'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: base vars
|
||||
shell: bash
|
||||
run: |
|
||||
{
|
||||
echo "GIT_HASH=$(git rev-parse HEAD)";
|
||||
echo "BASE_HASH=$(git merge-base origin/${GITHUB_BASE_REF} HEAD)";
|
||||
echo "HEAD_HASH=HEAD";
|
||||
echo "HEAD_COMMIT_HASH=${GH_COMMIT}";
|
||||
echo "NX_CALCULATION_FLAGS=--all";
|
||||
echo "BUILD_OPTS=--configuration production";
|
||||
echo CI_FORCE_RUN=false;
|
||||
echo NODE_VERSION=$(node -v);
|
||||
} >> $GITHUB_ENV
|
||||
|
||||
- name: affected:* flag parser
|
||||
shell: bash
|
||||
if: ${{ contains(github.event.head_commit.message , '[affected:*]') }}
|
||||
run: |
|
||||
echo "Setting up CI to run with commit flag [affected:*] flag."
|
||||
echo "BREAK_ACTION=true" >> $GITHUB_ENV
|
||||
|
||||
- name: PULL_REQUEST event
|
||||
if: ${{ env.BREAK_ACTION == false && github.event_name == 'pull_request' && !github.event.pull_request.merged }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Setting up CI flags for Pull Request event"
|
||||
NX_CALCULATION_FLAGS="--base=origin/${GITHUB_BASE_REF} --head=$HEAD_HASH"
|
||||
{
|
||||
echo "NX_CALCULATION_FLAGS=$NX_CALCULATION_FLAGS";
|
||||
echo "BASE_HASH=origin/${GITHUB_BASE_REF}";
|
||||
echo "BREAK_ACTION=true";
|
||||
} >> $GITHUB_ENV
|
||||
|
||||
- name: RELEASE on master/develop patch branch
|
||||
if: ${{ env.BREAK_ACTION == false && github.event.pull_request.merged }}
|
||||
shell: bash
|
||||
env:
|
||||
REF_NAME: ${{ github.ref_name }}
|
||||
run: |
|
||||
if [[ "$REF_NAME" =~ ^master(-patch.*)?$ ]]; then
|
||||
# into master(-patch*)
|
||||
echo "Setting up CI flags for Push on master patch"
|
||||
elif [[ "$REF_NAME" =~ ^develop-patch.*$ ]]; then
|
||||
# into develop-patch*
|
||||
echo "Setting up CI flags for Push develop patch"
|
||||
else
|
||||
echo "Setting up CI flags for Push on develop branch"
|
||||
# base=$(git describe --tags $(git rev-list --tags --max-count=1))
|
||||
# we publish always all the libs until we don't handle partial release
|
||||
echo "NX_CALCULATION_FLAGS=--all" >> $GITHUB_ENV
|
||||
fi
|
||||
echo "BREAK_ACTION=true" >> $GITHUB_ENV
|
||||
|
||||
- name: SCHEDULE event
|
||||
if: ${{ github.event_name == 'schedule' }}
|
||||
shell: bash
|
||||
env:
|
||||
EV_NAME: ${{ github.event_name }}
|
||||
run: |
|
||||
echo "Setting up CI to run on SCHEDULE"
|
||||
echo "NX_CALCULATION_FLAGS=--all" >> $GITHUB_ENV
|
||||
@@ -1,23 +0,0 @@
|
||||
name: Git tag creation
|
||||
description: 'Creates a git tag in the specified repository for a given commit.'
|
||||
|
||||
inputs:
|
||||
tagName:
|
||||
description: 'The github tag to be created'
|
||||
required: true
|
||||
releaseNote:
|
||||
description: 'The github release note to be created'
|
||||
required: false
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
name: Create git tag
|
||||
env:
|
||||
TAG_NAME: ${{ inputs.tagName }}
|
||||
RELEASE_NOTE: ${{ inputs.releaseNote }}
|
||||
with:
|
||||
script: |
|
||||
const createGitTag = require('./.github/actions/create-git-tag/create-git-tag.js');
|
||||
await createGitTag({ core, github, context, tagName: process.env.TAG_NAME });
|
||||
@@ -1,42 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
module.exports = async ({ github, context, core, tagName }) => {
|
||||
const tagSHA = context.payload?.after ?? context.sha;
|
||||
|
||||
core.notice(`Creating tag with title: ${tagName}, and SHA: ${tagSHA}`);
|
||||
|
||||
const createdTag = await github.rest.git.createTag({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
tag: tagName,
|
||||
message: 'Release note',
|
||||
object: tagSHA,
|
||||
type: 'commit'
|
||||
});
|
||||
|
||||
const createdRef = await github.rest.git.createRef({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: 'refs/tags/' + tagName,
|
||||
sha: createdTag.data.sha
|
||||
});
|
||||
|
||||
if (createdRef.status === 201) {
|
||||
core.notice(`Tag ${tagName} was created successfully`);
|
||||
}
|
||||
};
|
||||
@@ -1,43 +0,0 @@
|
||||
name: "Download build artifacts"
|
||||
description: "Download build artifacts"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Restore dist from cache
|
||||
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||
with:
|
||||
path: dist
|
||||
key: dist-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
restore-keys: |
|
||||
dist-${{ github.run_id }}-
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- name: Restore nxcache from cache
|
||||
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||
with:
|
||||
path: nxcache
|
||||
key: nxcache-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
restore-keys: |
|
||||
nxcache-${{ github.run_id }}-
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- name: Restore node_modules from cache
|
||||
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||
with:
|
||||
path: node_modules
|
||||
key: node-modules-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
restore-keys: |
|
||||
node-modules-${{ github.run_id }}-
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- name: show files
|
||||
shell: bash
|
||||
run: |
|
||||
pwd
|
||||
ls -lha
|
||||
echo "====DIST===="
|
||||
find dist -maxdepth 1 -type d
|
||||
echo "====NXCACHE===="
|
||||
find nxcache -maxdepth 1 -type d
|
||||
echo "====ADF===="
|
||||
find node_modules/@alfresco/ -maxdepth 1 -type d
|
||||
@@ -1,32 +0,0 @@
|
||||
name: 'enable dryrun'
|
||||
description: 'check if must run pipeline in dryrun mode'
|
||||
|
||||
inputs:
|
||||
dry-run-flag:
|
||||
description: 'enable dryrun'
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
outputs:
|
||||
dryrun:
|
||||
description: "long sha of the tag"
|
||||
value: ${{ steps.dryrun.outputs.dryrun }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
|
||||
steps:
|
||||
- name: set dryrun flag to TRUE
|
||||
shell: bash
|
||||
id: dryrun
|
||||
env:
|
||||
DRY_RUN_FLAG: ${{ inputs.dry-run-flag }}
|
||||
run: |
|
||||
if [[ '$DRY_RUN_FLAG' == 'true' ]]; then
|
||||
echo "dryrun=--dryrun" >> $GITHUB_OUTPUT;
|
||||
echo "enabling dryrun"
|
||||
else
|
||||
echo "dryrun=" >> $GITHUB_OUTPUT;
|
||||
echo "dryrun NOT enabled"
|
||||
fi
|
||||
@@ -1,19 +0,0 @@
|
||||
name: 'Get tag sha'
|
||||
description: 'get the sha of the latest or a specific tag'
|
||||
|
||||
outputs:
|
||||
tag_sha:
|
||||
description: "long sha of the tag"
|
||||
value: ${{ steps.sha_out.outputs.tag_sha }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
|
||||
steps:
|
||||
- name: get tag short sha
|
||||
shell: bash
|
||||
id: sha_out
|
||||
run: |
|
||||
tag_sha=$(git rev-list -n 1 $(git tag --sort=-creatordate | head -n 1))
|
||||
echo "tag_sha=$tag_sha" >> $GITHUB_OUTPUT
|
||||
echo $tag_sha
|
||||
@@ -1,31 +0,0 @@
|
||||
name: 'Check NPM bundle'
|
||||
description: 'check npm bundle'
|
||||
|
||||
inputs:
|
||||
branch_name:
|
||||
description: "override GITHUB_REF_NAME"
|
||||
required: false
|
||||
default: ${{ github.ref_name }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
|
||||
steps:
|
||||
- name: load "NPM TAG"
|
||||
id: set-npm-tag
|
||||
uses: ./.github/actions/set-npm-tag
|
||||
with:
|
||||
branch_name: ${{ inputs.branch_name }}
|
||||
- name: check npm bundle
|
||||
shell: bash
|
||||
id: sha_out
|
||||
env:
|
||||
TAG_NPM: ${{ steps.set-npm-tag.outputs.npm-tag }}
|
||||
run: |
|
||||
if [[ -z $TAG_NPM ]]; then
|
||||
echo "TAG_NPM not set, aborting"
|
||||
exit 1
|
||||
fi
|
||||
ADF_VERSION=$(npm view @alfresco/adf-core@${TAG_NPM} version)
|
||||
echo "check bundle on TAG_NPM='${TAG_NPM}' and ADF_VERSION='${ADF_VERSION}'"
|
||||
./scripts/github/build/npm-check-bundles.sh -v ${ADF_VERSION}
|
||||
@@ -1,45 +0,0 @@
|
||||
name: "set npm tag"
|
||||
description: "se NPM tag"
|
||||
|
||||
inputs:
|
||||
branch_name:
|
||||
description: "override GITHUB_REF_NAME"
|
||||
required: false
|
||||
default: ${{ github.ref_name }}
|
||||
|
||||
outputs:
|
||||
npm-tag:
|
||||
description: "NPM tag"
|
||||
value: ${{ steps.set-npm-tag.outputs.npm-tag }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
|
||||
- name: set TAG_NPM
|
||||
id: set-npm-tag
|
||||
shell: bash
|
||||
env:
|
||||
BRANCH_NAME: ${{ inputs.branch_name }}
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
||||
TAG_NPM="branch"
|
||||
else
|
||||
TAG_NPM="alpha"
|
||||
VERSION_IN_PACKAGE_JSON=$(node -p "require('./package.json')".version)
|
||||
echo "version in package.json=${VERSION_IN_PACKAGE_JSON}"
|
||||
if [[ $BRANCH_NAME =~ ^master(-patch.*)?$ ]]; then
|
||||
# Pre-release versions
|
||||
if [[ $VERSION_IN_PACKAGE_JSON =~ ^[0-9]*\.[0-9]*\.[0-9]*-A\.[0-9]*$ ]]; then
|
||||
TAG_NPM=next
|
||||
# Stable major versions
|
||||
else
|
||||
TAG_NPM=latest
|
||||
fi
|
||||
fi
|
||||
if [[ $BRANCH_NAME =~ ^develop(-patch.*)?$ ]]; then
|
||||
TAG_NPM=alpha
|
||||
fi
|
||||
fi
|
||||
echo "npm-tag=$TAG_NPM" >> $GITHUB_OUTPUT
|
||||
echo "Computed tag: $TAG_NPM"
|
||||
@@ -1,50 +0,0 @@
|
||||
name: 'Setup'
|
||||
description: 'Initialize cache, env var load'
|
||||
inputs:
|
||||
enable-node-modules-cache:
|
||||
description: 'enable caching for node modules'
|
||||
required: false
|
||||
type: boolean
|
||||
default: 'true'
|
||||
act:
|
||||
description: 'enable act debug'
|
||||
required: false
|
||||
type: boolean
|
||||
default: 'false'
|
||||
outputs:
|
||||
npm-tag:
|
||||
description: 'NPM tag'
|
||||
value: ${{ steps.set-npm-tag.outputs.npm-tag }}
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: install NPM
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: get latest tag sha
|
||||
id: tag-sha
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/git-latest-tag@40f2376b812403b51e0cea49eaff04c1b8d65cfd # v15.7.1
|
||||
# CACHE
|
||||
- name: Node Modules cache
|
||||
id: node-modules-cache
|
||||
if: ${{ inputs.enable-node-modules-cache == 'true' }}
|
||||
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||
env:
|
||||
cache-name: node-modules-cache
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
key: .npm-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
.npm-${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
.npm-${{ runner.os }}-build-
|
||||
.npm-${{ runner.os }}-
|
||||
- name: load "NPM TAG"
|
||||
id: set-npm-tag
|
||||
uses: ./.github/actions/set-npm-tag
|
||||
- name: before install script
|
||||
uses: ./.github/actions/before-install
|
||||
with:
|
||||
act: ${{ inputs.act }}
|
||||
@@ -1,25 +0,0 @@
|
||||
name: "Upload build artifacts"
|
||||
description: "Upload build artifacts"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Save dist to cache
|
||||
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||
with:
|
||||
path: dist
|
||||
key: dist-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
|
||||
- name: Save nxcache to cache
|
||||
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||
with:
|
||||
path: nxcache
|
||||
key: nxcache-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
|
||||
- name: Save node_modules to cache
|
||||
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||
with:
|
||||
path: node_modules
|
||||
key: node-modules-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
name: "CodeQL config"
|
||||
|
||||
paths-ignore:
|
||||
- 'e2e/resources/**'
|
||||
- 'docs/**'
|
||||
@@ -1,78 +0,0 @@
|
||||
# General Code Review Instructions
|
||||
|
||||
## Review Priorities
|
||||
When performing a code review, prioritize issues in the following order:
|
||||
|
||||
🔴 CRITICAL (Block merge)
|
||||
* Security: Vulnerabilities, exposed secrets, authentication/authorization issues, injection, XSS
|
||||
* Memory/resource leaks
|
||||
* Crashes or undefined behavior
|
||||
* Correctness: Logic errors, data corruption risks, race conditions, missing error handling
|
||||
* Data Loss: Risk of data loss or corruption
|
||||
|
||||
🟡 IMPORTANT (Requires discussion)
|
||||
* Code Quality: Severe violations of SOLID principles, excessive duplication
|
||||
* Test Coverage: Missing tests for critical paths or new functionality
|
||||
* Performance: Obvious performance bottlenecks (N+1 queries, memory leaks)
|
||||
* Architecture: Significant deviations from established patterns
|
||||
|
||||
🟢 SUGGESTION (Non-blocking improvements)
|
||||
* Readability: Poor naming, complex logic that could be simplified
|
||||
* Optimization: Performance improvements without functional impact
|
||||
* Best Practices: Minor deviations from conventions
|
||||
* Documentation: Missing or incomplete comments/documentation
|
||||
|
||||
## General Review Principles
|
||||
When performing a code review, follow these principles:
|
||||
|
||||
* Be specific: Reference exact lines, files, and provide concrete examples
|
||||
* Be pragmatic: Not every suggestion needs immediate implementation
|
||||
* Provide context: Explain WHY something is an issue and the potential impact
|
||||
* Suggest solutions: Show corrected code when applicable, not just what's wrong
|
||||
* Be constructive: Focus on improving the code, not criticizing the author
|
||||
* Recognize good practices: Acknowledge well-written code and smart solutions
|
||||
* Group related comments: Avoid multiple comments about the same topic
|
||||
* Ask clarifying questions when code intent is unclear
|
||||
|
||||
## Code Quality Standards
|
||||
When performing a code review, check for:
|
||||
|
||||
### Clean Code
|
||||
* Descriptive and meaningful names for variables, functions, and classes
|
||||
* Single Responsibility Principle: each function/class does one thing well
|
||||
* DRY (Don't Repeat Yourself): no code duplication
|
||||
* Functions should be small and focused (ideally < 20-30 lines)
|
||||
* Avoid deeply nested code (max 3-4 levels), unit tests should be an exception from this rule
|
||||
* Avoid magic numbers and strings (use constants)
|
||||
* Code should be self-documenting; comments only when necessary
|
||||
* Code follows consistent style and conventions
|
||||
* No commented-out code or TODO without tickets
|
||||
|
||||
## Error Handling
|
||||
* Proper error handling at appropriate levels
|
||||
* Meaningful error messages
|
||||
* No silent failures or ignored exceptions
|
||||
* Fail fast: validate inputs early
|
||||
* Use appropriate error types/exceptions
|
||||
|
||||
## Testing Standards
|
||||
When performing a code review, verify test quality:
|
||||
|
||||
* Coverage: Critical paths and new functionality must have tests
|
||||
* Test Names: Descriptive names that explain what is being tested
|
||||
* Independence: Tests should not depend on each other or external state
|
||||
* Assertions: Use specific assertions, avoid generics
|
||||
* Edge Cases: Test boundary conditions, null values, empty inputs
|
||||
* Mock Appropriately: Mock external dependencies, not domain logic
|
||||
* New code has appropriate test coverage
|
||||
* No tests that always pass or are commented out
|
||||
|
||||
## Architecture and Design
|
||||
When performing a code review, verify architectural principles:
|
||||
|
||||
* Separation of Concerns: Clear boundaries between layers/modules
|
||||
* Dependency Direction: High-level modules don't depend on low-level details
|
||||
* Interface Segregation: Prefer small, focused interfaces
|
||||
* Loose Coupling: Components should be independently testable
|
||||
* High Cohesion: Related functionality grouped together
|
||||
* Consistent Patterns: Follow established patterns in the codebase
|
||||
@@ -1,64 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
day: "sunday"
|
||||
time: "07:00"
|
||||
open-pull-requests-limit: 5
|
||||
target-branch: develop
|
||||
groups:
|
||||
angular:
|
||||
patterns:
|
||||
- "@angular/*"
|
||||
angular-devkit:
|
||||
patterns:
|
||||
- "@angular-devkit/*"
|
||||
ngrx:
|
||||
patterns:
|
||||
- "@ngrx/*"
|
||||
nrwl:
|
||||
patterns:
|
||||
- "@nrwl/*"
|
||||
ignore:
|
||||
- dependency-name: "pdfjs-dist"
|
||||
- dependency-name: "@types/*"
|
||||
- dependency-name: "typescript"
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/.github/actions/before-install"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/.github/actions/download-node-modules-and-artifacts"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/.github/actions/enable-dryrun"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/.github/actions/get-latest-tag-sha"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/.github/actions/npm-check-bundle"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/.github/actions/set-npm-tag"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/.github/actions/setup"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/.github/actions/upload-node-modules-and-artifacts"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
@@ -1,23 +0,0 @@
|
||||
---
|
||||
applyTo: "**/*.html"
|
||||
---
|
||||
|
||||
# HTML Development Standards
|
||||
|
||||
* Simple Templates: Keep templates as simple as possible, avoiding complex logic directly in the template. Delegate complex logic to the component's TypeScript code.
|
||||
* Native Control Flow: Use the new built-in control flow syntax (`@if`, `@for`, `@switch`) instead of the older structural directives (`*ngIf`, `*ngFor`, `*ngSwitch`).
|
||||
* NgOptimizedImage: Use `NgOptimizedImage` for all static images to automatically optimize image loading and performance.
|
||||
* Async Pipe: Use the `async` pipe to handle observables in templates. This automatically subscribes and unsubscribes, preventing memory leaks.
|
||||
* Prefer pipes over functions in templates for performance reasons, as pipes are only re-evaluated when their inputs change.
|
||||
|
||||
## Accessibility Standards
|
||||
|
||||
* Add `alt` text to all images
|
||||
* Label form inputs with `<mat-label>` or `aria-label`
|
||||
* Ensure interactive elements have accessible names
|
||||
* Add `role`, `aria-labelledby`, and `aria-describedby` when semantic HTML isn't sufficient
|
||||
* All interactive elements must be keyboard accessible
|
||||
* Ensure 4.5:1 contrast ratio for normal text, 3:1 for large text
|
||||
* Use `aria-live="polite"` for status updates
|
||||
* Watch out for misused/non-semantic elements (e.g., <div> instead of <section>)
|
||||
* Avoid broken heading hierarchy (e.g., h1 → h3 without h2)
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
applyTo: "**/*.scss"
|
||||
---
|
||||
|
||||
# SCSS Development Standards
|
||||
|
||||
* Avoid using `!important` to override styles unless absolutely necessary; instead, increase specificity or refactor the code structure.
|
||||
* Avoid using Angular Material internal class; prefer using Angular Material Design 3 theming and tokens.
|
||||
* Use variables for colors, fonts, and other design tokens to maintain consistency across the project.
|
||||
* Use mixins for reusable styles and to avoid code duplication.
|
||||
* Ensure that styles are responsive and work well across different screen sizes and devices.
|
||||
* Use CSS Grid and Flexbox for layout to create flexible and responsive designs.
|
||||
* Avoid using overly specific selectors (e.g., #header .nav ul li a)
|
||||
* Be DRY (avoid repeated styles for similar elements)
|
||||
* Check for inconsistent naming (e.g., mixing BEM and arbitrary classes)
|
||||
* Make sure selected colors have right contrast (satisfy WCAG AA)
|
||||
* All interactive elements should have focus state
|
||||
* Avoid disabled outline without alternative focus indicators
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
---
|
||||
applyTo: "**/*.ts"
|
||||
---
|
||||
|
||||
# TypeScript Development Standards
|
||||
|
||||
## Type Safety
|
||||
|
||||
* Strict Type Checking: Always enable and adhere to strict type checking. This helps catch errors early and improves code quality.
|
||||
* Prefer Type Inference: Allow TypeScript to infer types when they are obvious from the context. This reduces verbosity while maintaining type safety.
|
||||
* Avoid `any`: Do not use the `any` type unless absolutely necessary as it bypasses type checking. Prefer `unknown` when a type is uncertain and you need to handle it safely.
|
||||
* Use strict null checks (no `null` or `undefined` without explicit handling)
|
||||
* Use type guards and union types for robust type checking
|
||||
* Check for missing return types in function signatures
|
||||
* Avoid implicit `any` (untyped function parameters)
|
||||
|
||||
## Naming Conventions
|
||||
|
||||
* Use PascalCase for types, interfaces, and classes
|
||||
* Use camelCase for variables, functions, and methods
|
||||
* Use UPPER_CASE for constants
|
||||
|
||||
## Modern TypeScript Patterns
|
||||
|
||||
* Use optional chaining (`?.`) and nullish coalescing (`??`)
|
||||
* Prefer `const` over `let`; never use `var`
|
||||
* Use arrow functions for callbacks and short functions
|
||||
* Avoid enums - they generate additional code at compile time, which increases the size of the final file. This can have a negative impact on the loading speed and performance of the app. Prefer union types or literal types instead.
|
||||
* Avoid unhandled promise rejections (missing .catch() or try/catch)
|
||||
* Use proper async/await pattern
|
||||
* Avoid inefficient array operations (e.g., nested .map())
|
||||
* Use destructuring for object/array access
|
||||
* Prefer arrow functions
|
||||
|
||||
## Angular Best Practices
|
||||
|
||||
* Standalone Components: Always use standalone components, directives, and pipes. Avoid using `NgModules` for new features or refactoring existing ones.
|
||||
* Implicit Standalone: When creating standalone components, you do not need to explicitly set `standalone: true` inside the `@Component`, `@Directive` and `@Pipe` decorators, as it is implied by default.
|
||||
* Lazy Loading: Implement lazy loading for feature routes to improve initial load times of your application.
|
||||
* Use Angular Material or other modern UI libraries for consistent styling and UI components.
|
||||
* Implement proper error handling with RxJS operators (e.g., catchError)
|
||||
* Verify if newly added functionalities can utilize Angular Signals for fine-grained reactivity, reducing change detection overhead.
|
||||
* Utilize AOT (Ahead-of-Time) compilation and tree-shaking for efficient, smaller bundle sizes.
|
||||
* Prefer class binding over `ngClass` and `ngStyle` for better performance.
|
||||
* Use protected on class members that are only used by a component's template, as it allows for better encapsulation while still being accessible to the template.
|
||||
* Use readonly for properties that shouldn't change.
|
||||
* Use `takeUntilDestroyed` & `destroyRef`: The `takeUntilDestroyed` and `destroyRef` have been introduced with Angular 16 and help to reduce boilerplate code related to unsubscribing on the `OnDestroy` hook.
|
||||
* Organize the order of properties and methods in Angular components for readability and maintainability. Recommended order is:
|
||||
1. **Injected services** Whether they are public or private, it's clear they are dependencies of the class.
|
||||
2. **Inputs**: Properties that receive data from outside.
|
||||
3. **Outputs**: Events that the component can trigger.
|
||||
4. **ViewChild/ContentChild**: References to HTML elements.
|
||||
5. **Public static properties**: Constants and static members that are accessible to everyone.
|
||||
6. **Readonly properties**: Immutable public properties.
|
||||
7. **Public properties**: Data and functions available to everyone.
|
||||
8. **Private static properties**: Constants and static members that are only accessible within the class.
|
||||
9. **Private readonly properties**: Immutable private properties.
|
||||
10. **Private properties**: Data and functions used only inside the component.
|
||||
11. **Setters and Getters**: Methods for accessing and modifying properties.
|
||||
12. **Constructor**: Used to initialize the component.
|
||||
13. **Lifecycle Hooks**: Methods that run at specific times in the component’s lifecycle.
|
||||
14. **Public methods**: Functions available to everyone.
|
||||
15. **Private methods**: Functions used only inside the component.
|
||||
|
||||
## Components
|
||||
|
||||
* Single Responsibility: Keep components small, focused, and responsible for a single piece of functionality.
|
||||
* Reactive Forms: Prefer Reactive forms over Template-driven forms for complex forms, validation, and dynamic controls due to their explicit, immutable, and synchronous nature.
|
||||
* Use Typed Forms: Typed Forms in Angular are a new feature introduced in Angular 14 that provide stronger type checking for reactive forms. They allow developers to define the structure and types of form controls, making it easier to catch errors at compile-time rather than runtime.
|
||||
|
||||
## Services
|
||||
|
||||
* Single Responsibility: Design services around a single, well-defined responsibility.
|
||||
* `providedIn: 'root'`: Use the `providedIn: 'root'` option when declaring injectable services to ensure they are singletons and tree-shakable.
|
||||
* `inject()` Function: Prefer the `inject()` function over constructor injection when injecting dependencies, especially within `provide` functions, `computed` properties, or outside of constructor context.
|
||||
|
||||
## Unit testing
|
||||
|
||||
* Write unit tests for components, services, and pipes using Jasmine and Karma.
|
||||
* Test cases should be reasonably groupped based on tested functionality/behaviour using describe blocks.
|
||||
* Use plain English test names based on the should <expectedBehavior> when <stateUnderTest> pattern as a guideline.
|
||||
* Use Angular's TestBed for component testing with mocked dependencies
|
||||
* Avoid Direct Calls to Component Lifecycle Hooks: Instead of directly invoking lifecycle hooks like `ngOnInit()`, use Angular's testing utilities to trigger them naturally. For example, use `fixture.detectChanges()` to trigger change detection, which will automatically call `ngOnInit()` and other lifecycle hooks in the correct order.
|
||||
* Use fixture.componentRef.setInput() Instead of Direct Input Assignment: When testing components with inputs, use `fixture.componentRef.setInput()` to set input values. This method ensures that Angular's change detection is properly triggered, allowing the component to react to input changes as it would in a real application.
|
||||
* Use the Provide Mock Store for testing components that rely on NgRx state management. This allows you to mock the store and control the state during tests without needing to set up a full NgRx environment.
|
||||
* Mock HTTP requests using provideHttpClientTesting
|
||||
* Import only the minimal required modules
|
||||
* Avoid NO_ERRORS_SCHEMA and CUSTOM_ELEMENTS_SCHEMA in tests to ensure proper error detection
|
||||
* Do not verify mocked methods
|
||||
* Avoid mocking component methods unless necessary; prefer testing actual behavior
|
||||
* Avoid testing private methods directly; test them through public methods instead
|
||||
* Avoid testing methods or behaviours of children components; use shallow testing or mock child components instead
|
||||
* Use the overrideProviders API to replace components, directives, pipes, or services declared deep within the module hierarchy
|
||||
* Avoid async/await in synchronous unit tests
|
||||
* Prefer data-automation-id over CSS class when possible
|
||||
* Do not use toBeDefined() to check if an element is visible.
|
||||
@@ -1,56 +0,0 @@
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [develop, master]
|
||||
paths-ignore:
|
||||
- 'e2e/resources/**'
|
||||
- 'docs/**'
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [develop]
|
||||
paths-ignore:
|
||||
- 'e2e/resources/**'
|
||||
- 'docs/**'
|
||||
schedule:
|
||||
- cron: '0 5 * * 0'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
fetch-depth: 2
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v3.29.5
|
||||
# Override language selection by uncommenting this and choosing your languages
|
||||
with:
|
||||
languages: javascript
|
||||
config-file: ./.github/codeql/codeql-config.yml
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@0d579ffd059c29b07949a3cce3983f0780820c98 # v3.29.5
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v3.29.5
|
||||
@@ -1,32 +0,0 @@
|
||||
name: Package published
|
||||
on:
|
||||
registry_package:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.registry_package.package_type == 'npm' && github.event.registry_package.name == 'adf-core'
|
||||
steps:
|
||||
- name: Dispatch event to monorepo
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
env:
|
||||
PACKAGE_NAME: ${{ github.event.registry_package.name }}
|
||||
PACKAGE_VERSION: ${{ github.event.registry_package.package_version.name }}
|
||||
with:
|
||||
github-token: ${{ secrets.PAT_WRITE_PKG }}
|
||||
retries: 3
|
||||
script: |
|
||||
const payload = {
|
||||
package_name: process.env.PACKAGE_NAME,
|
||||
package_version: process.env.PACKAGE_VERSION
|
||||
};
|
||||
|
||||
await github.rest.repos.createDispatchEvent({
|
||||
owner: context.repo.owner,
|
||||
repo: "alfresco-apps",
|
||||
event_type: "package-published",
|
||||
client_payload: payload
|
||||
});
|
||||
|
||||
console.log(`Trigger a dispatch event for the monorepo`);
|
||||
@@ -1,33 +0,0 @@
|
||||
name: Pull Translations from Crowdin
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 7-17 * * 1-5"
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
secrets:
|
||||
BOT_GITHUB_TOKEN:
|
||||
required: true
|
||||
CROWDIN_TRANSLATIONS_TOKEN:
|
||||
required: true
|
||||
jobs:
|
||||
pull-from-crowdin:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: develop
|
||||
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
- name: Pull translations from Crowdin
|
||||
uses: crowdin/github-action@8818ff65bfc4322384f983ea37e3926948c11745 # v2.15.0
|
||||
with:
|
||||
skip_ref_checkout: true
|
||||
upload_sources: false
|
||||
download_translations: true
|
||||
create_pull_request: true
|
||||
localization_branch_name: automated-translations-update
|
||||
pull_request_title: "GH auto: Automated Update of Translations from Crowdin"
|
||||
pull_request_base_branch_name: develop
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TRANSLATIONS_TOKEN }}
|
||||
@@ -1,299 +0,0 @@
|
||||
name: "pull-request"
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
dry-run-flag:
|
||||
description: "enable dry-run on artifact push"
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
devel:
|
||||
description: "devel"
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
cron-run:
|
||||
description: "disables jobs which should not run when cron runs e2es"
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
branches:
|
||||
- develop
|
||||
- master
|
||||
- develop-patch*
|
||||
- master-patch*
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
HEAD_REF: ${{ github.head_ref }}
|
||||
GH_COMMIT: ${{ github.sha }}
|
||||
GH_BUILD_NUMBER: ${{ github.run_id }}
|
||||
LOG_LEVEL: "ERROR"
|
||||
NODE_OPTIONS: "--max-old-space-size=5120"
|
||||
|
||||
jobs:
|
||||
pre-checks:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Ensure SHA pinned actions
|
||||
uses: hyland/github-actions-ensure-sha-pinned-actions@1afac08cba4e5ea12263a46f49683570690ae3af # v1.2.0
|
||||
|
||||
- name: Check package-lock.json version
|
||||
run: |
|
||||
if [[ $(jq '.lockfileVersion == 3' package-lock.json) == "true" ]] ; then
|
||||
echo "package-lock.json has a correct version"
|
||||
else
|
||||
echo "package-lock must be version 3"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
check-if-pr-is-approved:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get branch name
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@40f2376b812403b51e0cea49eaff04c1b8d65cfd # v15.7.1
|
||||
|
||||
- name: Save commit message
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/get-commit-message@40f2376b812403b51e0cea49eaff04c1b8d65cfd # v15.7.1
|
||||
with:
|
||||
header-only: true
|
||||
|
||||
- name: ci:force flag parser
|
||||
shell: bash
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
ACTOR: ${{ github.actor }}
|
||||
run: |
|
||||
if [ "$EVENT_NAME" == "schedule" ] || [ "$ACTOR" == "dependabot[bot]" ]; then
|
||||
echo -e "\033[32mci:force check can be skipped\033[0m"
|
||||
skip_check="true"
|
||||
elif [[ "$COMMIT_MESSAGE" == *"[ci:force]"* ]]; then
|
||||
echo -e "\033[32m[ci:force] flag detected. No need for approval.\033[0m"
|
||||
skip_check="true"
|
||||
fi
|
||||
|
||||
- name: Get PR number
|
||||
if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }}
|
||||
uses: kamatama41/get-pr-number-action@0bcaab5752c0b699149e74667c8ce2f764cbb7fa # v0.9.1
|
||||
id: action
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: show pr number
|
||||
shell: bash
|
||||
env:
|
||||
PR_NUMBER: ${{ steps.action.outputs.number }}
|
||||
run: |
|
||||
echo "PR: $PR_NUMBER"
|
||||
|
||||
- name: check if pr is approved
|
||||
env:
|
||||
DEVEL_FLAG: ${{ inputs.devel }}
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
skip_check: "false"
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
ACTOR: ${{ github.actor }}
|
||||
PR_NUMBER: ${{ steps.action.outputs.number }}
|
||||
run: |
|
||||
if [ "$EVENT_NAME" == "schedule" ] || [ "$ACTOR" == "dependabot[bot]" ]; then
|
||||
echo -e "\033[32mci:force check can be skipped\033[0m"
|
||||
skip_check="true"
|
||||
elif [[ "$COMMIT_MESSAGE" == *"[ci:force]"* ]]; then
|
||||
echo -e "\033[32m[ci:force] flag detected. No need for approval.\033[0m"
|
||||
skip_check="true"
|
||||
fi
|
||||
|
||||
if [ "$ACTOR" == "dependabot[bot]" ] || [ "$ACTOR" == "alfresco-build" ]; then
|
||||
echo -e "\033[32mCommit by $ACTOR. No need for approval.\033[0m"
|
||||
skip_check="true"
|
||||
fi
|
||||
if [ "$EVENT_NAME" == "schedule" ] || [ "$EVENT_NAME" == "workflow_dispatch" ]; then
|
||||
echo -e "\033[32mSchedule event\033[0m"
|
||||
skip_check="true"
|
||||
fi
|
||||
|
||||
if [[ "$DEVEL_FLAG" == "true" ]]; then
|
||||
echo -e "\033[32mDevel flag\033[0m"
|
||||
skip_check="true"
|
||||
fi
|
||||
|
||||
if [ "$skip_check" == "false" ]; then
|
||||
echo "Checking PR approval"
|
||||
prNumber=$PR_NUMBER
|
||||
echo "PR: $prNumber"
|
||||
checkApproval=$(gh api /repos/$GITHUB_REPOSITORY/pulls/$prNumber/reviews | jq '.[] | select(.state == "APPROVED") | .user.login')
|
||||
if [[ $checkApproval ]]; then
|
||||
echo -e "\033[32mPR approved\033[0m"
|
||||
else
|
||||
echo -e "\033[31mPR NOT approved\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
setup:
|
||||
# long timeout required when cache has to be recreated
|
||||
timeout-minutes: 30
|
||||
name: "Setup"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [check-if-pr-is-approved, pre-checks]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history for all tags and branches
|
||||
- uses: ./.github/actions/setup
|
||||
- name: install
|
||||
run: |
|
||||
npm ci
|
||||
npm run bundle:js-api
|
||||
npm run bundle:cli
|
||||
- uses: ./.github/actions/upload-node-modules-and-artifacts
|
||||
|
||||
unit-tests:
|
||||
timeout-minutes: 30
|
||||
name: "Unit tests: ${{ matrix.unit-tests.name }}"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [setup]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
# max-parallel: 4
|
||||
matrix:
|
||||
unit-tests:
|
||||
- name: js-api
|
||||
exclude: "core,insights,content-services,process-services,process-services-cloud,eslint-plugin-eslint-angular"
|
||||
- name: content-services
|
||||
exclude: "insights,core,extensions,process-services,process-services-cloud,eslint-plugin-eslint-angular,js-api"
|
||||
- name: core
|
||||
exclude: "insights,content-services,process-services,process-services-cloud,eslint-plugin-eslint-angular,js-api"
|
||||
- name: insights
|
||||
exclude: "core,extensions,content-services,process-services-cloud,process-services,eslint-plugin-eslint-angular,js-api"
|
||||
- name: process-services
|
||||
exclude: "core,extensions,content-services,process-services-cloud,insights,eslint-plugin-eslint-angular,js-api"
|
||||
- name: process-services-cloud
|
||||
exclude: "insights,core,extensions,content-services,process-services$,eslint-plugin-eslint-angular,js-api"
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history for all tags and branches
|
||||
- uses: ./.github/actions/setup
|
||||
- uses: ./.github/actions/download-node-modules-and-artifacts
|
||||
- name: Run unit tests
|
||||
env:
|
||||
EXCLUDE_PATTERN: ${{ matrix.unit-tests.exclude }}
|
||||
run: |
|
||||
/usr/bin/xvfb-run --auto-servernum npm run test:affected -- $NX_CALCULATION_FLAGS --exclude=$EXCLUDE_PATTERN
|
||||
|
||||
lint:
|
||||
# long timeout required when cache has to be recreated
|
||||
timeout-minutes: 30
|
||||
name: "Lint"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [setup]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history for all tags and branches
|
||||
- uses: ./.github/actions/setup
|
||||
- uses: ./.github/actions/download-node-modules-and-artifacts
|
||||
- run: npm run lint:affected -- $NX_CALCULATION_FLAGS
|
||||
|
||||
build-libs:
|
||||
# long timeout required when cache has to be recreated
|
||||
timeout-minutes: 30
|
||||
name: "Build libs"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [setup]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history for all tags and branches
|
||||
- uses: ./.github/actions/setup
|
||||
- uses: ./.github/actions/download-node-modules-and-artifacts
|
||||
- run: NX_REJECT_UNKNOWN_LOCAL_CACHE=0 npm run build:affected -- $NX_CALCULATION_FLAGS --prod
|
||||
- uses: ./.github/actions/upload-node-modules-and-artifacts
|
||||
|
||||
build-storybook:
|
||||
timeout-minutes: 30
|
||||
name: "Build storybook"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [setup]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history for all tags and branches
|
||||
- uses: ./.github/actions/setup
|
||||
- uses: ./.github/actions/download-node-modules-and-artifacts
|
||||
- run: npm run build-storybook
|
||||
- uses: ./.github/actions/upload-node-modules-and-artifacts
|
||||
|
||||
PR-forbidden-labels:
|
||||
if: ${{ inputs.cron-run == '' || inputs.cron-run == 'false' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: checkoutRepo
|
||||
name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: PR contains forbidden labels
|
||||
id: pr-forbidden
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
script: |
|
||||
const issueHasLabels = require('./scripts/github/update/check-issue-has-label.js');
|
||||
const checkLabels = ['next version ➡️', 'do not merge🙅🏻♂️'];
|
||||
|
||||
const hasLabel = await issueHasLabels({github, context, checkLabels})
|
||||
|
||||
if(hasLabel) {
|
||||
core.setFailed('The PR contains a forbidden label! You are not allowed to merge until the label is there.');
|
||||
}
|
||||
- name: Check value after
|
||||
env:
|
||||
STEP_RESULT: ${{ toJson(steps.pr-forbidden.*.result) }}
|
||||
HAS_FAILURE: ${{ contains(toJson(steps.pr-forbidden.*.result), 'failure') }}
|
||||
run: |
|
||||
echo "Step result: $STEP_RESULT"
|
||||
echo "Has failure: $HAS_FAILURE"
|
||||
|
||||
finalize:
|
||||
if: ${{ always() }}
|
||||
runs-on: ubuntu-latest
|
||||
name: Final Results
|
||||
needs:
|
||||
[
|
||||
check-if-pr-is-approved,
|
||||
pre-checks,
|
||||
setup,
|
||||
unit-tests,
|
||||
lint,
|
||||
build-libs,
|
||||
build-storybook,
|
||||
]
|
||||
steps:
|
||||
- name: Check job execution status
|
||||
if: >-
|
||||
${{
|
||||
contains(needs.*.result, 'failure')
|
||||
|| contains(needs.*.result, 'cancelled')
|
||||
}}
|
||||
run: exit 1
|
||||
@@ -1,18 +0,0 @@
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
name: Automatic Rebase
|
||||
jobs:
|
||||
rebase:
|
||||
name: Rebase
|
||||
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the latest code
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Automatic Rebase
|
||||
uses: cirrus-actions/rebase@b87d48154a87a85666003575337e27b8cd65f691 # 1.8
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -1,209 +0,0 @@
|
||||
name: "release"
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
dry-run-flag:
|
||||
description: 'enable dry-run on artifact push'
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
dry-run-flag:
|
||||
description: 'enable dry-run on artifact push'
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
pull_request:
|
||||
types: [closed]
|
||||
branches:
|
||||
- develop
|
||||
- develop-patch*
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- master-patch-*
|
||||
|
||||
permissions:
|
||||
id-token: write # Required for OIDC
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
HEAD_REF: ${{ github.head_ref }}
|
||||
GH_COMMIT: ${{ github.sha }}
|
||||
GH_BUILD_NUMBER: ${{ github.run_id }}
|
||||
LOG_LEVEL: "ERROR"
|
||||
NODE_OPTIONS: "--max-old-space-size=5120"
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
timeout-minutes: 20
|
||||
if: github.event.pull_request.merged == true || github.ref_name == 'master' || github.ref_name == 'master-patch-*' || github.event_name == 'workflow_dispatch'
|
||||
name: "Setup"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: ./.github/actions/setup
|
||||
with:
|
||||
enable-node-modules-cache: false
|
||||
- name: install
|
||||
run: |
|
||||
npm ci
|
||||
npm run bundle:js-api
|
||||
npm run bundle:cli
|
||||
- uses: ./.github/actions/upload-node-modules-and-artifacts
|
||||
|
||||
release-npm:
|
||||
needs: [setup]
|
||||
outputs:
|
||||
release_version: ${{ steps.set-version.outputs.release_version }}
|
||||
timeout-minutes: 30
|
||||
if: github.event.pull_request.merged == true || github.ref_name == 'master' || github.ref_name == 'master-patch-*' || github.event_name == 'workflow_dispatch'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
id-token: write # Required for OIDC
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- id: setup
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
enable-node-modules-cache: false
|
||||
- id: set-dryrun
|
||||
uses: ./.github/actions/enable-dryrun
|
||||
with:
|
||||
dry-run-flag: ${{ inputs.dry-run-flag }}
|
||||
- uses: ./.github/actions/download-node-modules-and-artifacts
|
||||
- name: Set libraries versions
|
||||
id: set-version
|
||||
run: |
|
||||
set -u;
|
||||
./scripts/github/build/bumpversion.sh
|
||||
- name: Set migrations
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
script: |
|
||||
const setMigrations = require('./scripts/github/release/set-migrations.js');
|
||||
setMigrations();
|
||||
- name: build libraries
|
||||
run: |
|
||||
npm run build:libs
|
||||
npm run build:schematics
|
||||
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||
name: release libraries GH registry
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
registry-url: 'https://npm.pkg.github.com'
|
||||
scope: '@alfresco'
|
||||
- run: npm run publish -- --tag=${{ steps.setup.outputs.npm-tag }}
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||
name: release libraries Npm registry
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
registry-url: 'https://${{ vars.NPM_REGISTRY_ADDRESS }}'
|
||||
scope: '@alfresco'
|
||||
- run: npm run publish -- --tag=${{ steps.setup.outputs.npm-tag }}
|
||||
|
||||
create-git-tag:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [setup, release-npm]
|
||||
if: github.event_name != 'workflow_dispatch'
|
||||
name: Create github tag
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- uses: './.github/actions/create-git-tag'
|
||||
with:
|
||||
tagName: ${{ needs.release-npm.outputs.release_version }}
|
||||
|
||||
propagate:
|
||||
needs: [release-npm]
|
||||
if: ${{ contains(toJson(github.event.pull_request.labels.*.name), 'hxp-upstream') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: HxP upstream invoke
|
||||
uses: the-actions-org/workflow-dispatch@3133c5d135c7dbe4be4f9793872b6ef331b53bc7 # v4.0.0
|
||||
with:
|
||||
repo: Alfresco/hxp-frontend-apps
|
||||
ref: develop
|
||||
workflow: upstream-adf.yml
|
||||
token: ${{ secrets.ALFRESCO_BUILD_GH_TOKEN }}
|
||||
wait-for-completion: false
|
||||
inputs: >
|
||||
{
|
||||
"tag_version": "alpha"
|
||||
}
|
||||
|
||||
npm-check-bundle:
|
||||
needs: [release-npm]
|
||||
timeout-minutes: 15
|
||||
if: github.event.pull_request.merged == true || github.ref_name == 'master' || github.ref_name == 'master-patch-*' || github.event_name == 'workflow_dispatch'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: ./.github/actions/npm-check-bundle
|
||||
|
||||
push-translation-keys-to-crowdin:
|
||||
name: Push translations keys to Crowdin
|
||||
if: github.ref_name == 'develop' && github.event_name != 'workflow_dispatch'
|
||||
runs-on: ubuntu-latest
|
||||
needs: [setup]
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: read
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Push Source Files to Crowdin
|
||||
uses: crowdin/github-action@8818ff65bfc4322384f983ea37e3926948c11745 # v2.15.0
|
||||
with:
|
||||
upload_sources: true
|
||||
upload_sources_args: --delete-obsolete
|
||||
env:
|
||||
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TRANSLATIONS_TOKEN }}
|
||||
|
||||
pull-translation-keys-from-crowdin:
|
||||
needs: push-translation-keys-to-crowdin
|
||||
name: Run Crowdin pull pipeline for up-to-date sync
|
||||
uses: ./.github/workflows/pull-from-crowdin.yml
|
||||
secrets:
|
||||
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
CROWDIN_TRANSLATIONS_TOKEN: ${{ secrets.CROWDIN_TRANSLATIONS_TOKEN }}
|
||||
|
||||
finalize:
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
name: Final Results
|
||||
needs: [release-npm, npm-check-bundle]
|
||||
steps:
|
||||
- name: Check job execution status
|
||||
if: >-
|
||||
${{
|
||||
contains(needs.*.result, 'failure')
|
||||
|| contains(needs.*.result, 'cancelled')
|
||||
}}
|
||||
run: exit 1
|
||||
+16
-21
@@ -1,26 +1,21 @@
|
||||
*.log
|
||||
node_modules
|
||||
bundles
|
||||
workspace.xml
|
||||
.idea/
|
||||
*.iml
|
||||
.env.*
|
||||
.env
|
||||
dist
|
||||
tmp
|
||||
temp
|
||||
dist/
|
||||
ng2-components/coverage/
|
||||
!systemjs.config.js
|
||||
demo-shell-ng2/app/components/router/
|
||||
ng2-components/ng2-alfresco-userinfo-old/demo/src/app/
|
||||
ng2-components/ng2-alfresco-userinfo-old/src/services/bpm-user.service.spec.ts
|
||||
ng2-components/ng2-alfresco-userinfo-old/src/services/ecm-user.service.spec.ts
|
||||
src/environments/
|
||||
/ng2-components/ng2-example-webpack/
|
||||
/ng2-components/config/coverage/
|
||||
*.npmrc
|
||||
/demo-shell-ng2/ng2-components/
|
||||
.happypack/
|
||||
.happypack/
|
||||
.history
|
||||
.ng_pkg_build/
|
||||
coverage/
|
||||
out-tsc
|
||||
/reports/
|
||||
e2e-result-*
|
||||
licenses.txt
|
||||
.DS_Store
|
||||
desktop.ini
|
||||
.angular
|
||||
.nx
|
||||
nxcache
|
||||
.husky
|
||||
.cursor/rules/nx-rules.mdc
|
||||
.github/instructions/nx.instructions.md
|
||||
package-lock.*
|
||||
/ng2-components/ng2-alfresco-core/prebuilt-themes/
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
export NODE_OPTIONS=--max_old_space_size=8192
|
||||
lint-staged
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"*.{ts,js}": ["prettier --write", "eslint"],
|
||||
"*.{css,scss}": ["prettier --write", "stylelint --fix"]
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"printWidth": 150
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { dirname } from 'node:path';
|
||||
import type { StorybookConfig } from '@storybook/angular';
|
||||
|
||||
const config: StorybookConfig = {
|
||||
framework: {
|
||||
name: getAbsolutePath('@storybook/angular'),
|
||||
options: {}
|
||||
},
|
||||
staticDirs: [],
|
||||
stories: ['lib/**/*.stories.ts'],
|
||||
features: {
|
||||
backgrounds: false
|
||||
},
|
||||
core: {
|
||||
disableTelemetry: true
|
||||
}
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
function getAbsolutePath(value: string): any {
|
||||
return dirname(fileURLToPath(import.meta.resolve(`${value}/package.json`)));
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import type { Preview } from '@storybook/angular';
|
||||
|
||||
const preview: Preview = {
|
||||
parameters: {
|
||||
docs: { inlineStories: true },
|
||||
controls: { expanded: true }
|
||||
},
|
||||
tags: ['autodocs']
|
||||
};
|
||||
|
||||
export default preview;
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"exclude": [
|
||||
"../**/*.spec.js",
|
||||
"../**/*.spec.ts",
|
||||
"../**/*.spec.tsx",
|
||||
"../**/*.spec.jsx"
|
||||
],
|
||||
"include": ["../**/*"]
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
_theming.scss
|
||||
lib/core/src/lib/viewer/components/pdf-viewer-host.component.scss
|
||||
@@ -1,65 +0,0 @@
|
||||
{
|
||||
"extends": ["stylelint-config-standard-scss"],
|
||||
"rules": {
|
||||
"color-function-notation": "legacy",
|
||||
"alpha-value-notation": "number",
|
||||
"color-no-invalid-hex": true,
|
||||
"function-calc-no-unspaced-operator": true,
|
||||
"function-name-case": "lower",
|
||||
"function-url-quotes": "always",
|
||||
"function-url-scheme-disallowed-list": [
|
||||
"data"
|
||||
],
|
||||
"length-zero-no-unit": true,
|
||||
"string-no-newline": true,
|
||||
"unit-no-unknown": true,
|
||||
"unit-allowed-list": [
|
||||
"px",
|
||||
"%",
|
||||
"deg",
|
||||
"ms",
|
||||
"em",
|
||||
"vh",
|
||||
"vw",
|
||||
"vmin",
|
||||
"s",
|
||||
"rem"
|
||||
],
|
||||
"shorthand-property-no-redundant-values": true,
|
||||
"declaration-no-important": true,
|
||||
"no-duplicate-at-import-rules": true,
|
||||
"declaration-block-no-duplicate-properties": [
|
||||
true,
|
||||
{
|
||||
"ignore": [
|
||||
"consecutive-duplicates-with-different-values"
|
||||
]
|
||||
}
|
||||
],
|
||||
"declaration-block-single-line-max-declarations": 1,
|
||||
"declaration-property-value-disallowed-list": [
|
||||
{
|
||||
"/.*/": [
|
||||
"initial"
|
||||
]
|
||||
},
|
||||
{
|
||||
"message": "The `initial` value is not supported in IE."
|
||||
}
|
||||
],
|
||||
"selector-pseudo-element-colon-notation": "double",
|
||||
"selector-pseudo-element-no-unknown": [true, {
|
||||
"ignorePseudoElements": ["ng-deep"]
|
||||
}],
|
||||
"selector-type-case": "lower",
|
||||
"selector-max-id": 0,
|
||||
"selector-class-pattern": [
|
||||
"^_?(adf|adf-|app|app-|example-|demo-|textLayer|canvasWrapper|page)",
|
||||
{
|
||||
"resolveNestedSelectors": true
|
||||
}
|
||||
],
|
||||
"scss/dollar-variable-empty-line-before": null,
|
||||
"scss/at-rule-conditional-no-parentheses": null
|
||||
}
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
language: node_js
|
||||
dist: trusty
|
||||
sudo: false
|
||||
node_js:
|
||||
- "8"
|
||||
|
||||
before_install:
|
||||
- "export DISPLAY=:99.0"
|
||||
- "sh -e /etc/init.d/xvfb start"
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- MODULE=ng2-components-alfresco
|
||||
- MODULE=ng2-components-activiti
|
||||
- MODULE=ng2-demo-shell
|
||||
|
||||
install:
|
||||
- if ([ "$MODULE" == "ng2-components-alfresco" -o "$MODULE" == "ng2-components-activiti" ]); then
|
||||
if ([ "$TRAVIS_BRANCH" = "master" ]); then
|
||||
(./scripts/npm-build-all.sh || exit 1;);
|
||||
else
|
||||
(./scripts/npm-build-all.sh -vjsapi alpha || exit 1;);
|
||||
fi
|
||||
fi
|
||||
|
||||
script:
|
||||
- if ([ "$MODULE" == "ng2-components-activiti" ]); then
|
||||
(./scripts/npm-build-all.sh -si -sb -t "ng2-activiti*" || exit 1;);
|
||||
fi
|
||||
- if ([ "$MODULE" == "ng2-components-alfresco" ]); then
|
||||
(./scripts/npm-build-all.sh -si -sb -t "ng2-alfresco*" || exit 1;);
|
||||
fi
|
||||
- if ([ "$MODULE" == "ng2-demo-shell" ]); then
|
||||
if ([ "$TRAVIS_BRANCH" = "master" ]); then
|
||||
(./scripts/start.sh -t -ss || exit 1;);
|
||||
else
|
||||
(./scripts/start.sh -dev -t -ss -vjsapi alpha || exit 1;);
|
||||
fi
|
||||
fi
|
||||
|
||||
# jobs:
|
||||
# include:
|
||||
# - stage: Publish alpha to NPM
|
||||
# before_install: skip
|
||||
# install: skip
|
||||
# script: skip
|
||||
# deploy:
|
||||
# provider: script
|
||||
# script: (./scripts/update-version.sh -v $(./scripts/next_version.sh)-$(git rev-parse HEAD) -vj $(npm view alfresco-js-api@alpha version) -gnu) && (./scripts/npm-publish.sh -r $NPM_REGISTRY_ADDRESS -token $NPM_REGISTRY_TOKEN -t alpha --sleep 20 || exit 1;);
|
||||
# on:
|
||||
# branch: development
|
||||
# skip_cleanup: true
|
||||
# - stage: Publish beta to NPM
|
||||
# before_install: skip
|
||||
# install: skip
|
||||
# script: skip
|
||||
# deploy:
|
||||
# provider: script
|
||||
# script: (./scripts/update-version.sh -v $TRAVIS_TAG -gnu) && (./scripts/npm-publish.sh -r $NPM_REGISTRY_ADDRESS -token $NPM_REGISTRY_TOKEN -t beta --sleep 20 || exit 1;);
|
||||
# on:
|
||||
# tags: true
|
||||
# skip_cleanup: true
|
||||
|
||||
|
||||
# Send coverage data to codecov
|
||||
after_success:
|
||||
bash <(curl -s https://codecov.io/bash) -X gcov
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- ./node_modules/material-design-lite
|
||||
- ./node_modules/material-design-icons
|
||||
- demo-shell-ng2/node_modules
|
||||
- ng2-components/node_modules
|
||||
Vendored
+20
-30
@@ -1,33 +1,23 @@
|
||||
// Place your settings in this file to overwrite default and user settings.
|
||||
{
|
||||
"files.exclude": {
|
||||
"**/.git": true,
|
||||
"**/.svn": true,
|
||||
"**/.hg": true,
|
||||
"**/.DS_Store": true,
|
||||
"**/.happypack": true
|
||||
},
|
||||
"markdownlint.config": {
|
||||
"MD032": false,
|
||||
"MD004": false,
|
||||
"MD024": false,
|
||||
"MD009": false,
|
||||
"MD013": false,
|
||||
"MD036": false,
|
||||
"MD033": false,
|
||||
"MD031": false
|
||||
},
|
||||
"stylelint.enable": true,
|
||||
"css.validate": false,
|
||||
"scss.validate": false,
|
||||
"stylelint.configFile": "${workspaceFolder}/.stylelintrc.json",
|
||||
"stylelint.configBasedir": "${workspaceFolder}",
|
||||
"stylelint.validate": [
|
||||
"css",
|
||||
"less",
|
||||
"postcss",
|
||||
"scss"
|
||||
],
|
||||
"editor.guides.indentation": true,
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
"files.exclude": {
|
||||
"**/.git": true,
|
||||
"**/.svn": true,
|
||||
"**/.hg": true,
|
||||
"**/.DS_Store": true,
|
||||
"**/coverage": true,
|
||||
"**/.happypack": true
|
||||
},
|
||||
"editor.renderIndentGuides": true,
|
||||
"tslint.configFile": "ng2-components/tslint.json",
|
||||
"markdownlint.config": {
|
||||
"MD032": false,
|
||||
"MD004": false,
|
||||
"MD024": false,
|
||||
"MD009": false,
|
||||
"MD013": false,
|
||||
"MD036": false,
|
||||
"MD033" : false,
|
||||
"MD031" : false
|
||||
}
|
||||
}
|
||||
|
||||
+38
-46
@@ -1,30 +1,25 @@
|
||||
# CORS solving strategies
|
||||
### CORS solving strategies
|
||||
|
||||
A web client built with ADF typically won't be loaded from the same web server that the Alfresco Platform is running on.
|
||||
This means you need to tell the Alfresco server explicitly that any request coming in from this custom web client should be allowed access
|
||||
to the Content Repository. This is done by enabling
|
||||
[Cross Origin Resource Sharing](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)
|
||||
(CORS).
|
||||
The web client that we are building with the application development framework will be loaded from a different web server than the Alfresco Platform is running on.
|
||||
So we need to tell the Alfresco server that any request that comes in from this custom web client should be allowed access
|
||||
to the Content Repository. This is done by enabling CORS.
|
||||
|
||||
If you are experiencing this kind of problem, use **one of the following approaches**,
|
||||
depending on your setup:
|
||||
If you are experiencing this kind of problem, see **one of the following**:
|
||||
|
||||
1. [Configure Webpack Proxy](#configure-webpack-proxy)
|
||||
2. [Configure angular-cli Proxy](#configure-angular-cli-proxy)
|
||||
3. [Configure nginx proxy](#configure-nginx-proxy)
|
||||
4. [Enable CORS in CS and PS](#configure-webpack-proxy)
|
||||
|
||||
## Configure Webpack Proxy
|
||||
|
||||
If you are using a project created with the [Yeoman Generator](https://github.com/Alfresco/generator-ng2-alfresco-app) or the demo shell (>=1.6.0), you already have
|
||||
a suitable configuration out of the box in your `config/webpack.common.js` file.
|
||||
# Configure Webpack Proxy
|
||||
|
||||
If you are using a project created with the [Yeoman Generator](https://github.com/Alfresco/generator-ng2-alfresco-app) or the demo shell >=1.6.0, you have already out of the box in your `config/webpack.common.js` the following configuration.
|
||||
Say we have an app running on http://localhost:3000/ and we want to redirect all calls with the following strategy:
|
||||
|
||||
* Content Service http://localhost:8080/ redirect to -> http://localhost:3000/ecm/
|
||||
* Process Service http://localhost:9999/ redirect to -> http://localhost:3000/bpm/
|
||||
|
||||
Open the `config/webpack.common.js` file, find the `devServer` section and add the content:
|
||||
Open the `config/webpack.common.js` file, find the `devServer` section and add the content:
|
||||
|
||||
```javascript
|
||||
devServer: {
|
||||
@@ -60,21 +55,18 @@ devServer: {
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
||||
- With a different configuration of webpack, the `devServer` properties could be in other webpack files. Search your configuration files to find the correct location.
|
||||
- With different configuration of webpack the `devServer` properties could be in other webpack files. Search in your configuration files
|
||||
|
||||
- If you are running the App, Content Service or Process Service on different ports change the ports accordingly in your local configuration.
|
||||
|
||||
For further details about how to configure a webpack proxy please refer to the [official documentation](https://webpack.js.org/configuration/dev-server/#devserver-proxy).
|
||||
|
||||
## Configure angular-cli Proxy
|
||||
|
||||
# Configure angular-cli Proxy
|
||||
Say we have an app running on http://localhost:3000/ and we want to redirect all the calls with the following strategy:
|
||||
|
||||
* Content Service http://localhost:8080/ redirect to -> http://localhost:3000/ecm/
|
||||
* Process Service http://localhost:9999/ redirect to -> http://localhost:3000/bpm/
|
||||
|
||||
Create a file next to the project's `package.json`, call it `proxy.conf.json` and add the following content:
|
||||
Create a file next to project's `package.json`, call it `proxy.conf.json` and add the following content:
|
||||
|
||||
```javascript
|
||||
{
|
||||
@@ -101,35 +93,36 @@ Create a file next to the project's `package.json`, call it `proxy.conf.json` an
|
||||
}
|
||||
```
|
||||
|
||||
Note that if you are running the App, Content Service or Process Service on different ports, you should change the ports accordingly in your local configuration.
|
||||
Note if you are running the App, Content Service or Process Service on different ports change the ports accordingly in your local configuration.
|
||||
For further details about how to configure a webpack proxy please refer to the [official documentation](https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/proxy.md).
|
||||
|
||||
|
||||
## Configure nginx proxy
|
||||
# Configure nginx proxy
|
||||
|
||||
### Installing nginx
|
||||
## Installing nginx
|
||||
|
||||
Most Linux distributions will come with nginx available to install via your
|
||||
package manager and on Mac OS you can use [Homebrew](http://brew.sh/).
|
||||
|
||||
If you want to install manually, you can follow the instructions on the
|
||||
If you want to install manually however, you can follow the instructions on the
|
||||
[download page](http://nginx.org/en/download.html). See also the specific information for
|
||||
[Windows users](http://nginx.org/en/docs/windows.html).
|
||||
[windows users](http://nginx.org/en/docs/windows.html).
|
||||
|
||||
#### Start nginx
|
||||
### Start nginx
|
||||
|
||||
Start nginx using the supplied configuration in [nginx.conf](nginx.conf)
|
||||
|
||||
nginx -c nginx.conf
|
||||
|
||||
#### Review nginx configuration
|
||||
### Review nginx configuration
|
||||
|
||||
To correctly configure nginx, use the [nginx.conf](nginx.conf) file in the project root folder.
|
||||
To correctly configure nginx use the following file [nginx.conf](/nginx.conf).
|
||||
This will host Activiti, Alfresco and the app dev framework under the same origin.
|
||||
|
||||
* ECM : http://localhost:8888/alfresco/
|
||||
* BPM : http://localhost:8888/activiti/
|
||||
|
||||
To make everything work, you should change the address of ECM and BPM. In the demo app you can do that by clicking on the top right settings menu and changing the bottom left options: *ECM host* and *BPM host*.
|
||||
To make everything work, you should change the address of the ECM and BPM. In the demo app you can do that by clicking on the top right settings menu and change the bottom left options: *ECM host* and *BPM host*.
|
||||
|
||||
This configuration assumes a few things:
|
||||
|
||||
@@ -139,31 +132,30 @@ This configuration assumes a few things:
|
||||
* Alfresco: localhost:8080
|
||||
* Activiti: localhost:9999
|
||||
|
||||
You can modify all these values at their respective `location` directive in the
|
||||
[nginx.conf](/nginx.conf) file.
|
||||
All those values can be modified at their respective `location` directive on the [nginx.conf](/nginx.conf) file.
|
||||
|
||||
See the [Alfresco community page](https://community.alfresco.com/community/application-development-framework/blog/2016/09/28/adf-development-set-up-with-nginx-proxy) about using nginx with ADF for further information.
|
||||
If you want to know more on how to install and configure nginx to work with the Application Development Framework, information can be found [here](https://community.alfresco.com/community/application-development-framework/blog/2016/09/28/adf-development-set-up-with-nginx-proxy)
|
||||
|
||||
## Enable CORS in CS and PS
|
||||
|
||||
If you want to completely enable CORS calls in your Content Services and Process Services,
|
||||
please refer to the following Alfresco documents:
|
||||
# Enable CORS in CS and PS
|
||||
|
||||
* [Enable Cross Origin Resource Sharing (CORS) in Alfresco Process Services](https://support.hyland.com/r/Alfresco/Alfresco-Process-Services/24.4/Alfresco-Process-Services/Configure/Overview/CORS)
|
||||
If you want to completely enable CORS calls on your Content Service and Process Service, please refer to the following Alfresco documents:
|
||||
|
||||
* [Enable Cross Origin Resource Sharing (CORS) in Alfresco Process Services](http://docs.alfresco.com/process-services1.6/topics/enabling-cors.html)
|
||||
|
||||
* Enable Cross Origin Resource Sharing (CORS) in Alfresco Content Services
|
||||
|
||||
The easiest approach is to add the [enablecors](https://artifacts.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/enablecors/1.0/enablecors-1.0.jar)
|
||||
platform module JAR to the `$ALF_INSTALL_DIR/modules/platform` directory and restart the server.
|
||||
This is the easiest way, add the [enablecors](https://artifacts.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/enablecors/1.0/enablecors-1.0.jar)
|
||||
platform module JAR to the *$ALF_INSTALL_DIR/modules/platform* directory and restart the server.
|
||||
|
||||
Note that, by default, the CORS filter that is enabled will allow any origin.
|
||||
Note. by default, the CORS filter that is enabled will allow any origin.
|
||||
|
||||
Or - Manually update the web.xml file
|
||||
|
||||
Alternatively, you can update the `web.xml` file manually.
|
||||
Modify *$ALF_INSTALL_DIR/tomcat/webapps/alfresco/WEB-INF/web.xml* and uncomment the following section and update
|
||||
`cors.allowOrigin` to `http://localhost:3000` :
|
||||
|
||||
Modify `$ALF_INSTALL_DIR/tomcat/webapps/alfresco/WEB-INF/web.xml` and uncomment the following section and update
|
||||
`cors.allowOrigin` to `http://localhost:3000`:
|
||||
|
||||
```xml
|
||||
```
|
||||
<filter>
|
||||
<filter-name>CORS</filter-name>
|
||||
<filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
|
||||
@@ -197,11 +189,11 @@ Modify `$ALF_INSTALL_DIR/tomcat/webapps/alfresco/WEB-INF/web.xml` and uncomment
|
||||
</init-param>
|
||||
</filter>
|
||||
```
|
||||
When specifying the `cors.allowOrigin` URL, make sure that you use the URL that will be used by the web client.
|
||||
When specifying the `cors.allowOrigin` URL make sure to use the URL that will be used by the web client.
|
||||
|
||||
Then uncomment the filter mappings:
|
||||
Then uncomment filter mappings:
|
||||
|
||||
```xml
|
||||
```
|
||||
<filter-mapping>
|
||||
<filter-name>CORS</filter-name>
|
||||
<url-pattern>/api/*</url-pattern>
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
# Browser Support
|
||||
Browser support and polyfills guide.
|
||||
|
||||
Browser compatibility and support depends on targeted browsers and 3rd party libraries. ADF is based on the following libraries and components:
|
||||
|
||||
- Angular 2 (all ADF components)
|
||||
- Material Design Lite (all ADF components)
|
||||
- Moment.js (many ADF components)
|
||||
- PDF.js (`ng2-alfresco-viewer` component)
|
||||
- Raphael.js (`ng2-alfresco-diagrams`, `ng2-alfresco-analytics`)
|
||||
- Chart.js (`ng2-alfresco-analytics`)
|
||||
- Material Design - Date and Time Picker (`ng2-activiti-form`, `ng2-alfresco-analytics`)
|
||||
|
||||
## Browser polyfills
|
||||
|
||||
### Angular 2
|
||||
Please refer to the [official guide](https://angular.io/docs/ts/latest/guide/browser-support.html) for Angular 2 browser support.
|
||||
|
||||
ADF (demo shell) imports by default the following set of recommended polyfills:
|
||||
|
||||
- [core-js](https://www.npmjs.com/package/core-js) (ES6 standard support)
|
||||
|
||||
### 3rd party libraries
|
||||
Please refer to the following list of [popular polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills) for HTML5 cross-browser compatibility.
|
||||
|
||||
ADF (demo shell) imports by default the following set of recommended polyfills:
|
||||
|
||||
- [intl](https://www.npmjs.com/package/intl), Polyfill the ECMA-402 Intl API (except collation), **IE**/**Safari**
|
||||
- [dom4](https://github.com/WebReflection/dom4), A fully tested and covered polyfill for new DOM Level 4 entries, **IE**
|
||||
- [element.scrollintoviewifneeded-polyfill](https://www.npmjs.com/package/element.scrollintoviewifneeded-polyfill), simple JavaScript implementation of the non-standard WebKit method scrollIntoViewIfNeeded that can be called on DOM elements, **IE**/**Firefox**/**Safari**, required only to support **Material Design - Date and Time Picker** component
|
||||
- [pdfjs compatibility](https://www.npmjs.com/package/pdfjs-dist), Portable Document Format (PDF) library that is built with HTML5, **IE**
|
||||
- (dialog-polyfill)[https://www.npmjs.com/package/dialog-polyfill], Polyfill for the dialog element, **IE**/**Safari**/**Firefox**
|
||||
|
||||
## Example
|
||||
|
||||
```html
|
||||
|
||||
<!-- Polyfill(s) for Safari (pre-10.x) -->
|
||||
<script src="node_modules/intl/dist/Intl.min.js"></script>
|
||||
<script src="node_modules/intl/locale-data/jsonp/en.js"></script>
|
||||
|
||||
<!-- Polyfill(s) for older browsers -->
|
||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/dom4/1.8.3/dom4.js"></script>
|
||||
<script src="node_modules/element.scrollintoviewifneeded-polyfill/index.js"></script>
|
||||
|
||||
<!-- Polyfill(s) for pdf support -->
|
||||
<script src="node_modules/pdfjs-dist/web/compatibility.js"></script>
|
||||
|
||||
<!-- Polyfill(s) for dialogs -->
|
||||
<script src="node_modules/dialog-polyfill/dialog-polyfill.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="node_modules/dialog-polyfill/dialog-polyfill.css" />
|
||||
```
|
||||
|
||||
For a complete code please refer to [demo shell](demo-shell-ng2/index.html) example.
|
||||
@@ -1,23 +0,0 @@
|
||||
# Contributor Code of Conduct
|
||||
|
||||
We want to make everyone feel welcome to contribute to ADF.
|
||||
We promise to respect everyone who posts issues, updates documentation,
|
||||
submits pull requests, provides feedback in comments, or makes any other contribution to the project.
|
||||
|
||||
We expect all discussion about the project (on GitHub, social media and other channels) to be positive and constructive.
|
||||
We do not accept personal attacks, trolling, public or private harassment, insults,
|
||||
or other unprofessional conduct towards anyone.
|
||||
|
||||
We promise to show respect to all contributors regardless of their gender, gender identity,
|
||||
sexual orientation, disability, age, race, ethnicity, religion, or level of experience.
|
||||
|
||||
We expect all contributors to understand and follow these standards
|
||||
If any member of the community does not follow the code of conduct,
|
||||
the maintainers will do whatever they consider appropriate to stop the unacceptable behavior.
|
||||
This may include removing issues, comments, and PRs or blocking accounts.
|
||||
Any bans may be temporary or permanent, at the maintainers’ discretion.
|
||||
|
||||
Contact us if you see any behavior that breaks the code of conduct, whether it is directed at you or at anyone else.
|
||||
We take responsibility for making sure the code of conduct is clear and understandable,
|
||||
so you should also contact us if you think there is anything that needs to be explained better.
|
||||
Our contact email address is: [conduct@alfresco.com](mailto:conduct@alfresco.com)
|
||||
+23
-23
@@ -6,21 +6,21 @@
|
||||
|
||||
## Submitting a Pull Request (PR)
|
||||
|
||||
Before you submit a pull request please follow the steps below:
|
||||
Before you submit please follow the steps below:
|
||||
|
||||
* Search in [GitHub PR](https://github.com/Alfresco/alfresco-ng2-components/pulls) for an open or closed PR
|
||||
that could solve or already solves your issue.
|
||||
* Search in the [GitHub release history](https://github.com/Alfresco/alfresco-ng2-components/releases) to see if your
|
||||
* Search in the [GitHub release history](https://github.com/Alfresco/alfresco-ng2-components/releases) if your
|
||||
issue has already been solved in a new version of ADF.
|
||||
* Fork our repository (if you don't know how to do this, read [this GitHub document](https://help.github.com/articles/creating-a-pull-request-from-a-fork/)).
|
||||
* Make your changes in a new git branch starting from develop and following our [naming convention](https://github.com/Alfresco/alfresco-ng2-components/wiki/Branching-Strategy)
|
||||
* Fork our repository - [if you don't know how to do it read this GitHub document](https://help.github.com/articles/creating-a-pull-request-from-a-fork/)
|
||||
* Make your changes in a new git branch starting from development and following the [naming convention](https://github.com/Alfresco/alfresco-ng2-components/wiki/Branching-Strategy)
|
||||
|
||||
```shell
|
||||
git checkout -b dev-{developerName}-{GitIssuedId/JiraIssueId} develop
|
||||
git checkout -b dev-{developerName}-{GitIssuedId/JiraIssueId} development
|
||||
```
|
||||
|
||||
* Create your PR **including appropriate test cases** following the [code contribution acceptance criteria](https://github.com/Alfresco/alfresco-ng2-components/wiki/Code-contribution-acceptance-criteria)
|
||||
* Run the tests and make sure they are green. Please don't comment out or exclude the tests that are already in place.
|
||||
* Run the tests and make sure they are green. Please don't comment out or exclude the already existing tests
|
||||
* Commit your change using the [commit format message good practice](https://github.com/Alfresco/alfresco-ng2-components/wiki/Commit-format)
|
||||
* Push your branch to GitHub:
|
||||
|
||||
@@ -28,32 +28,32 @@ Before you submit a pull request please follow the steps below:
|
||||
git push origin dev-{developerName}-{GitIssuedId/JiraIssueId}
|
||||
```
|
||||
|
||||
* In GitHub, send a pull request to `develop`.
|
||||
* In GitHub, send a pull request to `development`.
|
||||
* If we suggest changes then:
|
||||
* Make the required updates.
|
||||
* Re-run the tests.
|
||||
* Rebase your branch and force push to your GitHub repository (this will update your Pull Request):
|
||||
|
||||
```shell
|
||||
git fetch develop
|
||||
git fetch development
|
||||
git checkout dev-my-branch
|
||||
git rebase develop -i
|
||||
git rebase development -i
|
||||
git push -f
|
||||
```
|
||||
Note: If you need more information about how to sync your fork, see [this page](https://help.github.com/articles/syncing-a-fork/).
|
||||
Note: If you need more information about how to sync your fork, see [here](https://help.github.com/articles/syncing-a-fork/)
|
||||
|
||||
## Code style
|
||||
|
||||
The code style for ADF follows the [Angular style guide](https://angular.io/guide/styleguide) plus some internal rules.
|
||||
|
||||
The codebase is also checked with:
|
||||
|
||||
- ESLint tool
|
||||
- Stylelint tool
|
||||
The code style in the ADF code follows the [Angular style guide](https://angular.io/guide/styleguide) plus some internal rules.
|
||||
You don’t have to worry too much about those rules because they are automatically checked by tslint/codelyzer/adf-rules.
|
||||
If your code is not compliant to one of these rules you will receive an error when you build the project with some help on how to fix it.
|
||||
The ADF-Rules :
|
||||
* File name component/directive cannot start with Alfresco/Activiti/adf - this rule is to help developers find files easily
|
||||
* Class names cannot start with Alfresco/Activiti/adf for the same reason as above
|
||||
* scss is mandatory. All the classes need to have the adf- prefix
|
||||
|
||||
## Test guide
|
||||
|
||||
In ADF, we encourage the use of behavior-driven development (BDD).
|
||||
In ADF we are encouraging the use of behavior-driven development (BDD)
|
||||
|
||||
### General guidelines
|
||||
|
||||
@@ -63,16 +63,16 @@ In ADF, we encourage the use of behavior-driven development (BDD).
|
||||
|
||||
### File name
|
||||
|
||||
* The file name specification must be the same as the component/service/pipe it tests plus the .spec. suffix.
|
||||
* The specification file must be in the same folder as the component/service/pipe it tests.
|
||||
* The file name specification as to be the same of the component/service/pipe it test plus the .spec. suffix
|
||||
* The specification file has to be in the same folder of the component/service/pipe it test
|
||||
|
||||
### Describer Name
|
||||
|
||||
* The Main describer of the test should be the name of the class under test
|
||||
* The sub describe is used for grouping related behavior test. Do not overuse it.
|
||||
* The sub describe is used for grouping related behavior test. Do not over use it
|
||||
|
||||
### Test Name
|
||||
|
||||
Any test should follow the naming convention:
|
||||
Any test should follow the naming convetion:
|
||||
|
||||
[Should] [ ***Expected Behavior*** ] [when/after/before] [ ***State Under Test*** ].
|
||||
[Should] [ ***Expected Behavior** ] [when/after/before] [ ***State Under Test*** ].
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
# Introduction to the Alfresco Application Development Framework
|
||||
|
||||
The Alfresco application development framework is based on the [Angular 2 JavaScript library](https://angular.io/).
|
||||
The framework is provided by Alfresco to make it easy to build custom web applications that
|
||||
should manage and view content in the [Alfresco Platform Repository](http://docs.alfresco.com/5.1/concepts/content-repo-about.html) in a custom way.
|
||||
|
||||
As you probably know, there is a general user interface called [Alfresco Share](http://docs.alfresco.com/5.1/concepts/gs-intro.html) available out-of-the-box.
|
||||
Share is usually used as a quick way of getting started with content management with Alfresco. It gives you access to pretty much all
|
||||
the features provided by the Alfresco ECM system. And a lot of customers customize it for their specific domain.
|
||||
|
||||
However, there are use-cases that Share does not fit very well, such as:
|
||||
|
||||
- Feature-based clients, exposing functionality to perform a specific task(s)
|
||||
- Role-based clients, exposing functionality based on role
|
||||
- Clients where the UI layout and style differs significantly from the Share layout and styling
|
||||
- [Mashup clients](http://whatis.techtarget.com/definition/mash-up)
|
||||
|
||||
This is where this application development framework comes into play, it can be used to create exactly the user interface
|
||||
(i.e. web client) that the requirements demand.
|
||||
|
||||
The framework consists of several components that can be combined to form a customized content management application.
|
||||
Here is a list of some of the available web components:
|
||||
|
||||
- [Core library](ng2-components/ng2-alfresco-core/README.md)
|
||||
- [DataTable](ng2-components/ng2-alfresco-datatable/README.md)
|
||||
- [DocumentList](ng2-components/ng2-alfresco-documentlist/README.md)
|
||||
- [Viewer](ng2-components/ng2-alfresco-viewer/README.md)
|
||||
- [Login](ng2-components/ng2-alfresco-login/README.md)
|
||||
- [Upload](ng2-components/ng2-alfresco-upload/README.md)
|
||||
|
||||
You can browse all the components at this [page](http://devproducts.alfresco.com/).
|
||||
|
||||
An architecture overview looks like this:
|
||||
|
||||
<p align="center">
|
||||
<img title="alfresco-ng2-components-architecture" alt='alfresco' src='assets/alfresco-app-dev-framework-architecture.png'></img>
|
||||
</p>
|
||||
|
||||
Here we can also see that there is an Alfresco JavaScript framework in use that wraps the Alfresco REST API, to make things easier for the client developer.
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# Prerequisites for building and running apps with the Alfresco Application Development Framework
|
||||
|
||||
The [Angular 2](https://angular.io/) based application development framework requires the following:
|
||||
|
||||
- An Alfresco Platform Repository (version [201609 Early Access](https://community.alfresco.com/docs/DOC-6372-alfresco-community-edition-file-list-201609-ea) or newer)
|
||||
- [Download and install the process service](https://www.alfresco.com/products/bpm/alfresco-activiti/trial)
|
||||
- [Node.js](https://nodejs.org/en/) JavaScript runtime.
|
||||
- [npm](https://www.npmjs.com/) package manager for JavaScript.
|
||||
- (If you use CS and PS together) Make sure your user has the same username and password in both system
|
||||
- [If you are experiencing CORS problem read this guide](/ALFRESCOCORS.md)
|
||||
|
||||
*Note: Default username for activiti is "admin@app.activiti.com" and "admin" for Alfresco, and also the default password are different. Change them to be equal.*
|
||||
|
||||
**Verify that you are running at least node `v5.x.x` and npm `3.x.x`**
|
||||
by running `node -v` and `npm -v` in a terminal/console window.
|
||||
Older versions produce errors.
|
||||
|
||||
## Installing Node.js
|
||||
|
||||
If you don't have Node.js installed then access this [page](https://nodejs.org/en/download/) and use the appropriate installer for your OS.
|
||||
|
||||
Make sure the Node.js version is > 5:
|
||||
|
||||
```
|
||||
$ node -v
|
||||
v5.12.0
|
||||
```
|
||||
@@ -1,49 +1,90 @@
|
||||
# Alfresco Application Development Framework (ADF)
|
||||
# ALFRESCO ANGULAR COMPONENTS
|
||||
|
||||
[](https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
<p>
|
||||
<a title='Build Status Travis' href="https://travis-ci.org/Alfresco/alfresco-ng2-components">
|
||||
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
|
||||
Status' />
|
||||
</a>
|
||||
<a title='Build Status AppVeyor' href="https://ci.appveyor.com/project/alfresco/alfresco-ng2-components">
|
||||
<img src='https://ci.appveyor.com/api/projects/status/github/Alfresco/alfresco-ng2-components' alt='travis
|
||||
Status' />
|
||||
</a>
|
||||
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
|
||||
<img src='http://img.shields.io/codecov/c/github/Alfresco/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
|
||||
</a>
|
||||
<a href='https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE'>
|
||||
<img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
## Introduction
|
||||
|
||||
See the [introduction page](docs/user-guide/adf-introduction.md) in our
|
||||
[documentation](docs/README.md) for an overview of ADF along with links
|
||||
to useful starting points.
|
||||
See the following [page](INTRODUCTION.md) for an introduction to the Alfresco Application Development Framework.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
```text
|
||||
Node: 18.x
|
||||
NPM: 9.x
|
||||
```
|
||||
|
||||
Also, check out the tutorial: [Creating your first ADF Application](docs/tutorials/creating-your-first-adf-application.md)
|
||||
for full details on what you may need to install before using ADF.
|
||||
|
||||
### See also
|
||||
|
||||
- [Node Version Manager](docs/tutorials/nvm.md)
|
||||
- [CORS guide](ALFRESCOCORS.md)
|
||||
Before you start using this development framework, make sure you have installed all required software and done all the
|
||||
necessary configuration, see this [page](PREREQUISITES.md).
|
||||
|
||||
## Components
|
||||
|
||||
You can find the sources for all ADF components in the [`lib`](/lib) folder.
|
||||
To view the complete list of all the components that you can use to build your custom Alfresco (ECM,BPM) client follow this link:
|
||||
[Components](/ng2-components).
|
||||
|
||||
## Libraries
|
||||
You can browse all the components at the following [page](http://devproducts.alfresco.com/).
|
||||
|
||||
ADF Libraries list:
|
||||
## Demo Application
|
||||
|
||||
- [Content services](https://github.com/Alfresco/alfresco-ng2-components/tree/develop/lib/content-services)
|
||||
- [Core](https://github.com/Alfresco/alfresco-ng2-components/tree/develop/lib/core)
|
||||
- [Extensions](https://github.com/Alfresco/alfresco-ng2-components/tree/develop/lib/extensions)
|
||||
- [Insights](https://github.com/Alfresco/alfresco-ng2-components/tree/develop/lib/insights)
|
||||
- [Process Service Cloud](https://github.com/Alfresco/alfresco-ng2-components/tree/develop/lib/process-services-cloud)
|
||||
- [Process service](https://github.com/Alfresco/alfresco-ng2-components/tree/develop/lib/process-services)
|
||||
- [Stories](https://github.com/Alfresco/alfresco-ng2-components/tree/develop/lib/stories)
|
||||
A separate application showcasing integration of components can be found [here](https://github.com/Alfresco/alfresco-ng2-components/tree/master/demo-shell-ng2).
|
||||
|
||||
You will find examples of basic interaction for both BPM and ECM sets of widgets.
|
||||
|
||||
## Yeoman generators
|
||||
|
||||
To speed up the development of your Alfresco Angular 2 application, or Alfresco Angular 2 component, use one of the Yeoman generators.
|
||||
|
||||
These generators will create a full working project with all the right libraries and tools.
|
||||
|
||||
<p align="center">
|
||||
<img title="yeoman generator" src='https://github.com/yeoman/media/blob/master/optimized/yeoman-150x150-opaque.png' alt='yeoman logo' />
|
||||
</p>
|
||||
|
||||
### Generate an Alfresco web component starter project
|
||||
|
||||
To generate your Alfresco Angular 2 component you can use the following Yeoman generator:
|
||||
|
||||
- [Yeoman Generator Angular 2 Alfresco component](https://github.com/Alfresco/generator-ng2-alfresco-component)
|
||||
|
||||
|
||||
### Generate an Alfresco web application starter project
|
||||
|
||||
To generate your Alfresco Angular 2 application you can use the following Yeoman generator:
|
||||
|
||||
- [Yeoman Generator Angular 2 Alfresco application](https://github.com/Alfresco/generator-ng2-alfresco-app)
|
||||
|
||||
## Amazon AWS Elastic Beanstalk fast deploy
|
||||
|
||||
<p align="center">
|
||||
<img alt="AmazonWebservices Logo.svg" src="https://upload.wikimedia.org/wikipedia/commons/1/1d/AmazonWebservices_Logo.svg" width="250" height="94">
|
||||
</p>
|
||||
|
||||
To deploy directly on your AWS instance our demo shell click the button below:
|
||||
|
||||
<a title="Deploy to AWS" href="https://console.aws.amazon.com/elasticbeanstalk/home?region=us-west-2#/newApplication?applicationName=Alfresco&solutionStackName=Node.js&tierName=WebServer&sourceBundleUrl=https://s3-us-west-2.amazonaws.com/elasticbeanstalk-us-west-2-677901592050/ADF_1.0.zip" target="_blank"><img src="http://d0.awsstatic.com/product-marketing/Elastic%20Beanstalk/deploy-to-aws.png" height="40"></a>
|
||||
|
||||
## Browser Support
|
||||
|
||||
All components are supported in the following browsers:
|
||||
|
||||
| **Browser** | **Version** |
|
||||
|-------------|-------------|
|
||||
| Chrome | Latest |
|
||||
| Safari | Latest |
|
||||
| Firefox | Latest |
|
||||
| Edge | Latest |
|
||||
|**Browser** |**Version** |
|
||||
|--- |--- |
|
||||
|Chrome |Latest |
|
||||
|Safari (OS X) |9.x |
|
||||
|Firefox* |Latest |
|
||||
|Edge |13, 14 |
|
||||
|Internet Explorer |11 |
|
||||
|
||||
* Due to a [Firefox known issue](https://bugzilla.mozilla.org/show_bug.cgi?id=1188880), the Alfresco Upload Component does not currently support folder upload functionality on Firefox.
|
||||
|
||||
Please refer to the [Browser Support](BROWSER-SUPPORT.md) article for more details.
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const Lint = require("tslint");
|
||||
const sprintf_js_1 = require("sprintf-js");
|
||||
const walkerFactory_1 = require("codelyzer/walkerFactory/walkerFactory");
|
||||
const walkerFn_1 = require("codelyzer/walkerFactory/walkerFn");
|
||||
const function_1 = require("codelyzer/util/function");
|
||||
class Rule extends Lint.Rules.AbstractRule {
|
||||
static invalidName(className) {
|
||||
var whiteList = ['ActivitiContentComponent', 'ActivitiForm'];
|
||||
var classNameReg = /^(alfresco|activiti|adf|activity)/ig;
|
||||
var classNameMatch = classNameReg.exec(className);
|
||||
var isWhiteListName = whiteList.find((currentWhiteListName) => {
|
||||
return currentWhiteListName === className;
|
||||
});
|
||||
if (classNameMatch && !isWhiteListName) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
apply(sourceFile) {
|
||||
return this.applyWithWalker(Rule.walkerBuilder(sourceFile, this.getOptions()));
|
||||
}
|
||||
}
|
||||
Rule.metadata = {
|
||||
ruleName: 'adf-class-name',
|
||||
type: 'maintainability',
|
||||
description: `Enforce consistent name avoid prefix`,
|
||||
descriptionDetails: `See more at https://angular.io/styleguide#style-05-13.`,
|
||||
rationale: `Consistent conventions make it easy to quickly identify class when you search with autocomplete.`,
|
||||
options: null,
|
||||
optionsDescription: "Not configurable.",
|
||||
typescriptOnly: true,
|
||||
};
|
||||
Rule.FAILURE_STRING = 'The name of the class should not start with ADF Alfresco or Activiti prefix ';
|
||||
Rule.walkerBuilder = walkerFn_1.all(walkerFn_1.validateComponent((meta, suffixList) => function_1.Maybe.lift(meta.controller)
|
||||
.fmap(controller => controller.name)
|
||||
.fmap(name => {
|
||||
const className = name.text;
|
||||
if (Rule.invalidName(className)) {
|
||||
return [new walkerFactory_1.Failure(name, sprintf_js_1.sprintf(Rule.FAILURE_STRING + className, className, suffixList))];
|
||||
}
|
||||
})));
|
||||
exports.Rule = Rule;
|
||||
@@ -0,0 +1,61 @@
|
||||
import * as Lint from 'tslint';
|
||||
import * as ts from 'typescript';
|
||||
import {sprintf} from 'sprintf-js';
|
||||
import {ComponentMetadata} from 'codelyzer/angular/metadata';
|
||||
import {Failure} from 'codelyzer/walkerFactory/walkerFactory';
|
||||
import {all, validateComponent} from 'codelyzer/walkerFactory/walkerFn';
|
||||
import {Maybe, F2} from 'codelyzer/util/function';
|
||||
import {IOptions} from 'tslint';
|
||||
import {NgWalker} from 'codelyzer/angular/ngWalker';
|
||||
|
||||
export class Rule extends Lint.Rules.AbstractRule {
|
||||
|
||||
public static metadata: Lint.IRuleMetadata = {
|
||||
ruleName: 'adf-class-name',
|
||||
type: 'maintainability',
|
||||
description: `Enforce consistent name avoid prefix`,
|
||||
descriptionDetails: `See more at https://angular.io/styleguide#style-05-13.`,
|
||||
rationale: `Consistent conventions make it easy to quickly identify class when you search with autocomplete.`,
|
||||
options: null,
|
||||
optionsDescription: "Not configurable.",
|
||||
typescriptOnly: true,
|
||||
};
|
||||
|
||||
public static FAILURE_STRING = 'The name of the class should not start with ADF Alfresco or Activiti prefix ';
|
||||
|
||||
static walkerBuilder: F2<ts.SourceFile, IOptions, NgWalker> =
|
||||
all(
|
||||
validateComponent((meta: ComponentMetadata, suffixList?: string[]) =>
|
||||
Maybe.lift(meta.controller)
|
||||
.fmap(controller => controller.name)
|
||||
.fmap(name => {
|
||||
const className = name.text;
|
||||
if (Rule.invalidName(className)) {
|
||||
return [new Failure(name, sprintf(Rule.FAILURE_STRING + className , className, suffixList))];
|
||||
}
|
||||
})
|
||||
));
|
||||
|
||||
static invalidName(className: string): boolean {
|
||||
var whiteList = ['ActivitiContentComponent', 'ActivitiForm'];
|
||||
|
||||
var classNameReg = /^(alfresco|activiti|adf|activity)/ig;
|
||||
var classNameMatch = classNameReg.exec(className);
|
||||
|
||||
var isWhiteListName = whiteList.find((currentWhiteListName)=>{
|
||||
return currentWhiteListName === className;
|
||||
});
|
||||
|
||||
if (classNameMatch && !isWhiteListName) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
|
||||
return this.applyWithWalker(
|
||||
Rule.walkerBuilder(sourceFile, this.getOptions())
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const Lint = require("tslint");
|
||||
class Rule extends Lint.Rules.AbstractRule {
|
||||
apply(sourceFile) {
|
||||
return this.applyWithWalker(new AdfFileName(sourceFile, this.getOptions()));
|
||||
}
|
||||
}
|
||||
Rule.metadata = {
|
||||
ruleName: 'adf-file-name',
|
||||
type: 'maintainability',
|
||||
description: `Enforce consistent name avoid prefix`,
|
||||
descriptionDetails: `See more at https://angular.io/styleguide#style-05-13.`,
|
||||
rationale: `Consistent conventions make it easy to quickly identify files when you search with autocomplete.`,
|
||||
options: null,
|
||||
optionsDescription: "Not configurable.",
|
||||
typescriptOnly: true,
|
||||
};
|
||||
Rule.FAILURE_STRING = 'The name of the File should not start with ADF Alfresco or Activiti prefix ';
|
||||
exports.Rule = Rule;
|
||||
class AdfFileName extends Lint.RuleWalker {
|
||||
visitSourceFile(node) {
|
||||
var whiteList = ['activiti-content.component.ts', 'activiti-alfresco.service.ts', 'activiti-content-service.ts',
|
||||
'alfresco-api.service.ts', 'alfresco-settings.service.ts', 'alfresco-content.service.ts',
|
||||
'activiti-content.component.spec.ts', 'activiti-alfresco.service.spec.ts', 'activiti-content-service.spec.ts',
|
||||
'alfresco-api.service.spec.ts', 'alfresco-settings.service.spec.ts', 'alfresco-content.service.spec.ts',
|
||||
'activiti-content.service.spec.ts', 'activiti-content.service.ts'];
|
||||
var fileName = this.getFilename();
|
||||
var fileNameReg = /^(alfresco|activiti|adf|activity)/ig;
|
||||
var filenameMatch = fileNameReg.exec(fileName);
|
||||
var isWhiteListName = whiteList.find((currentWhiteListName) => {
|
||||
return currentWhiteListName === fileName;
|
||||
});
|
||||
if (filenameMatch && !isWhiteListName) {
|
||||
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING + fileName));
|
||||
super.visitSourceFile(node);
|
||||
}
|
||||
}
|
||||
getFilename() {
|
||||
const filename = this.getSourceFile().fileName;
|
||||
const lastSlash = filename.lastIndexOf('/');
|
||||
if (lastSlash > -1) {
|
||||
return filename.substring(lastSlash + 1);
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
import * as ts from "typescript";
|
||||
import * as Lint from "tslint";
|
||||
|
||||
|
||||
export class Rule extends Lint.Rules.AbstractRule {
|
||||
public static metadata: Lint.IRuleMetadata = {
|
||||
ruleName: 'adf-file-name',
|
||||
type: 'maintainability',
|
||||
description: `Enforce consistent name avoid prefix`,
|
||||
descriptionDetails: `See more at https://angular.io/styleguide#style-05-13.`,
|
||||
rationale: `Consistent conventions make it easy to quickly identify files when you search with autocomplete.`,
|
||||
options: null,
|
||||
optionsDescription: "Not configurable.",
|
||||
typescriptOnly: true,
|
||||
};
|
||||
|
||||
public static FAILURE_STRING = 'The name of the File should not start with ADF Alfresco or Activiti prefix ';
|
||||
|
||||
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
|
||||
return this.applyWithWalker(new AdfFileName(sourceFile, this.getOptions()));
|
||||
}
|
||||
}
|
||||
|
||||
// The walker takes care of all the work.
|
||||
class AdfFileName extends Lint.RuleWalker {
|
||||
public visitSourceFile(node: ts.SourceFile) {
|
||||
var whiteList = ['activiti-content.component.ts', 'activiti-alfresco.service.ts', 'activiti-content-service.ts',
|
||||
'alfresco-api.service.ts', 'alfresco-settings.service.ts', 'alfresco-content.service.ts',
|
||||
'activiti-content.component.spec.ts', 'activiti-alfresco.service.spec.ts', 'activiti-content-service.spec.ts',
|
||||
'alfresco-api.service.spec.ts', 'alfresco-settings.service.spec.ts', 'alfresco-content.service.spec.ts',
|
||||
'activiti-content.service.spec.ts', 'activiti-content.service.ts'];
|
||||
|
||||
var fileName = this.getFilename();
|
||||
|
||||
var fileNameReg = /^(alfresco|activiti|adf|activity)/ig;
|
||||
var filenameMatch = fileNameReg.exec(fileName);
|
||||
|
||||
var isWhiteListName = whiteList.find((currentWhiteListName)=>{
|
||||
return currentWhiteListName === fileName;
|
||||
});
|
||||
|
||||
if (filenameMatch && !isWhiteListName) {
|
||||
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING + fileName));
|
||||
super.visitSourceFile(node);
|
||||
}
|
||||
}
|
||||
|
||||
private getFilename(): string {
|
||||
const filename = this.getSourceFile().fileName;
|
||||
const lastSlash = filename.lastIndexOf('/');
|
||||
if (lastSlash > -1) {
|
||||
return filename.substring(lastSlash + 1);
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var adfClassNameRule_1 = require("./adfClassNameRule");
|
||||
exports.ADFClassNameRule = adfClassNameRule_1.Rule;
|
||||
var adfFileNameRule_1 = require("./adfFileNameRule");
|
||||
exports.ComponentSelectorRule = adfFileNameRule_1.Rule;
|
||||
@@ -0,0 +1,2 @@
|
||||
export { Rule as ADFClassNameRule } from './adfClassNameRule';
|
||||
export { Rule as ComponentSelectorRule } from './adfFileNameRule';
|
||||
Generated
+2141
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "adf-tslint-rules",
|
||||
"description": "Custom Rules for the ADF project",
|
||||
"version": "0.0.3",
|
||||
"author": "Alfresco Software, Ltd.",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"tscv": "tsc --version",
|
||||
"tsc": "tsc",
|
||||
"tsc:watch": "tsc --w"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Eugenio Romano",
|
||||
"email": "eugenio.romano@alfresco.com"
|
||||
}
|
||||
],
|
||||
"devDependencies": {
|
||||
"@angular/compiler": "^4.2.3",
|
||||
"@angular/core": "^4.2.3",
|
||||
"@types/chai": "^3.4.33",
|
||||
"@types/less": "0.0.31",
|
||||
"@types/mocha": "^2.2.32",
|
||||
"@types/node": "^6.0.41",
|
||||
"@types/node-sass": "^3.10.31",
|
||||
"@types/source-map": "^0.5.0",
|
||||
"@types/sprintf-js": "0.0.27",
|
||||
"chai": "^3.5.0",
|
||||
"chai-spies": "^0.7.1",
|
||||
"minimalist": "1.0.0",
|
||||
"mocha": "3.0.2",
|
||||
"node-sass": "^3.13.0",
|
||||
"rimraf": "^2.5.2",
|
||||
"rxjs": "5.4.1",
|
||||
"ts-node": "1.2.2",
|
||||
"tslint": "^5.0.0",
|
||||
"typescript": "2.4.0",
|
||||
"zone.js": "^0.8.4",
|
||||
"js-yaml": "^3.8.4",
|
||||
"json-stringify-pretty-compact": "^1.0.4",
|
||||
"@types/js-yaml": "^3.5.31"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslint": "^5.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"app-root-path": "^2.0.1",
|
||||
"css-selector-tokenizer": "^0.7.0",
|
||||
"cssauron": "^1.4.0",
|
||||
"semver-dsl": "^1.0.1",
|
||||
"source-map": "^0.5.6",
|
||||
"sprintf-js": "^1.0.3",
|
||||
"codelyzer": "3.1.2"
|
||||
},
|
||||
"license": "Apache-2.0"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"declaration": false,
|
||||
"noImplicitAny": false,
|
||||
"removeComments": true,
|
||||
"lib": ["es6", "es2015", "dom"],
|
||||
"noLib": false,
|
||||
"typeRoots": [
|
||||
"./node_modules/@types",
|
||||
"./node_modules"
|
||||
],
|
||||
"types": [
|
||||
"mocha",
|
||||
"chai",
|
||||
"node",
|
||||
"sprintf-js"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rules": {
|
||||
"adf-file-naming": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
# Test against this version of Node.js
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- development
|
||||
- dev-build-test
|
||||
|
||||
environment:
|
||||
nodejs_version: "8"
|
||||
|
||||
matrix:
|
||||
- COMPONENT_NAME: ng2-components-activiti
|
||||
- COMPONENT_NAME: ng2-components-alfresco
|
||||
# - COMPONENT_NAME: ng2-demo-shell
|
||||
|
||||
# Install scripts. (runs after repo cloning)
|
||||
install:
|
||||
# Get the latest stable version of Node.js or io.js
|
||||
- ps: Install-Product node $env:nodejs_version
|
||||
# install module
|
||||
- if %COMPONENT_NAME% EQU ng2-components-activiti (
|
||||
if %APPVEYOR_REPO_BRANCH EQU master
|
||||
(cd scripts && sh npm-build-all.sh -t "ng2-activiti*" || exit 1)
|
||||
else
|
||||
(cd scripts && sh npm-build-all.sh -t "ng2-activiti*" -vjsapi alpha|| exit 1)
|
||||
)
|
||||
- if %COMPONENT_NAME% EQU ng2-components-alfresco (
|
||||
if %APPVEYOR_REPO_BRANCH EQU master
|
||||
(cd scripts && sh npm-build-all.sh -t "ng2-alfresco*" || exit 1)
|
||||
else
|
||||
(cd scripts && sh npm-build-all.sh -t "ng2-alfresco*" -vjsapi alpha|| exit 1)
|
||||
)
|
||||
# - if %COMPONENT_NAME% EQU ng2-demo-shell (
|
||||
# if %APPVEYOR_REPO_BRANCH EQU master
|
||||
# (cd scripts && sh start.sh -t -ss || exit 1)
|
||||
# else
|
||||
# (cd scripts && sh start.sh -dev -t -ss -vjsapi alpha || exit 1)
|
||||
# )
|
||||
|
||||
# Don't actually build.
|
||||
build: off
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
-13
@@ -1,13 +0,0 @@
|
||||
"project_id": "11"
|
||||
"api_token_env": "CROWDIN_TOKEN"
|
||||
"base_path": "."
|
||||
"base_url": "https://hyland.api.crowdin.com"
|
||||
"preserve_hierarchy": true
|
||||
"files": [
|
||||
{
|
||||
"source": "/**/**/i18n/en.json",
|
||||
"translation": "/%original_path%/%two_letters_code%.%file_extension%",
|
||||
"export_only_approved": "true",
|
||||
"update_option": "update_without_changes"
|
||||
}
|
||||
]
|
||||
-166
@@ -1,166 +0,0 @@
|
||||
{
|
||||
"version": "0.2",
|
||||
"language": "en",
|
||||
"words": [
|
||||
"activiti",
|
||||
"adhoc",
|
||||
"afts",
|
||||
"appkey",
|
||||
"Arial",
|
||||
"arrowdown",
|
||||
"arrowup",
|
||||
"auditable",
|
||||
"AUTHTYPE",
|
||||
"backend",
|
||||
"baseitem",
|
||||
"BASESHAREURL",
|
||||
"berseria",
|
||||
"booleanvisibility",
|
||||
"booleanvisibilityprocess",
|
||||
"boolitem",
|
||||
"BPMECM",
|
||||
"BPMHOST",
|
||||
"cardview",
|
||||
"checkboxes",
|
||||
"classlist",
|
||||
"Collapsable",
|
||||
"CONTEXTROOTBPM",
|
||||
"CONTEXTROOTECM",
|
||||
"cryptodoc",
|
||||
"CSRF",
|
||||
"datacolumn",
|
||||
"datarow",
|
||||
"Datasource",
|
||||
"datatable",
|
||||
"dateitem",
|
||||
"datepicker",
|
||||
"datetimeitem",
|
||||
"Datetimepicker",
|
||||
"dbpci",
|
||||
"DDTHH",
|
||||
"devops",
|
||||
"devtools",
|
||||
"dialpad",
|
||||
"DISABLECSRF",
|
||||
"doclib",
|
||||
"docx",
|
||||
"dropdownrestprocess",
|
||||
"Droppable",
|
||||
"dryrun",
|
||||
"ECMBPM",
|
||||
"ECMHOST",
|
||||
"edjs",
|
||||
"Examinate",
|
||||
"exif",
|
||||
"filedata",
|
||||
"filelink",
|
||||
"filesize",
|
||||
"firstname",
|
||||
"floatitem",
|
||||
"folderlink",
|
||||
"formtotestvalidations",
|
||||
"fullname",
|
||||
"fullscreen",
|
||||
"gitter",
|
||||
"glyphicon",
|
||||
"gridster",
|
||||
"hardend",
|
||||
"highlightable",
|
||||
"hotfix",
|
||||
"Hyland",
|
||||
"imgpreview",
|
||||
"Inplace",
|
||||
"intitem",
|
||||
"jira",
|
||||
"jsons",
|
||||
"jwks",
|
||||
"keycodes",
|
||||
"keyvaluepairs",
|
||||
"keyvaluepairsitem",
|
||||
"lastname",
|
||||
"listgrid",
|
||||
"mapitem",
|
||||
"mimetype",
|
||||
"mincount",
|
||||
"minlength",
|
||||
"minmax",
|
||||
"MLTEXT",
|
||||
"mousedrag",
|
||||
"mouseenter",
|
||||
"multiselect",
|
||||
"mysites",
|
||||
"numbervisibilityprocess",
|
||||
"OAUTHCONFIG",
|
||||
"oidc",
|
||||
"overridable",
|
||||
"pdfjs",
|
||||
"penta",
|
||||
"printf",
|
||||
"processparent",
|
||||
"processstring",
|
||||
"processwithstarteventform",
|
||||
"processwithvariables",
|
||||
"Promise",
|
||||
"promisify",
|
||||
"qshare",
|
||||
"quicktime",
|
||||
"repo",
|
||||
"requirednumbervisibility",
|
||||
"rowspan",
|
||||
"selectitem",
|
||||
"sharedlinks",
|
||||
"sidenav",
|
||||
"snackbar",
|
||||
"SOLR",
|
||||
"starteventform",
|
||||
"subfolders",
|
||||
"swimlanes",
|
||||
"swsdp",
|
||||
"tabindex",
|
||||
"taggable",
|
||||
"tasklist",
|
||||
"textitem",
|
||||
"Theming",
|
||||
"transcluded",
|
||||
"transclusion",
|
||||
"triggerable",
|
||||
"truthy",
|
||||
"typeahead",
|
||||
"typeahed",
|
||||
"uncheck",
|
||||
"Unclaim",
|
||||
"Undeployed",
|
||||
"unfavorite",
|
||||
"unlisten",
|
||||
"unshare",
|
||||
"UPDATEPERMISSIONS",
|
||||
"uploader",
|
||||
"uploadfileform",
|
||||
"userinfo",
|
||||
"validatable",
|
||||
"validators",
|
||||
"waypoint",
|
||||
"waypoints",
|
||||
"webm",
|
||||
"Whitespaces",
|
||||
"xdescribe",
|
||||
"xsrf",
|
||||
"zestiria",
|
||||
"webscript"
|
||||
],
|
||||
"dictionaries": [
|
||||
"html",
|
||||
"en-gb",
|
||||
"en_US",
|
||||
"softwareTerms",
|
||||
"node"
|
||||
],
|
||||
"ignorePaths": [
|
||||
"lib/{content-services,core,extensions,insights,process-services}/**/*.spec.ts",
|
||||
"lib/{content-services,core,extensions,insights,process-services}/**/*.mock.ts",
|
||||
"**/*.stories.ts"
|
||||
],
|
||||
"ignoreRegExpList": [
|
||||
"(\"|'|`)((?:\\\\1|(?:(?!\\1).))*)\\1"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
files:
|
||||
"/opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh" :
|
||||
mode: "000775"
|
||||
owner: root
|
||||
group: root
|
||||
content: |
|
||||
#!/bin/bash
|
||||
function error_exit
|
||||
{
|
||||
eventHelper.py --msg "$1" --severity ERROR
|
||||
exit $2
|
||||
}
|
||||
|
||||
export HOME=/home/ec2-user
|
||||
echo "export home"
|
||||
|
||||
sudo curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -
|
||||
sudo yum install -y nodejs
|
||||
@@ -0,0 +1,19 @@
|
||||
# http://editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[package.json]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.md]
|
||||
insert_final_newline = false
|
||||
trim_trailing_whitespace = false
|
||||
@@ -0,0 +1,17 @@
|
||||
typings/
|
||||
node_modules/
|
||||
bower_components/
|
||||
ng2-components/
|
||||
app/**/*.js
|
||||
app/**/*.js.map
|
||||
app/**/*.d.ts
|
||||
|
||||
!app/js/Polyline.js
|
||||
.idea
|
||||
versions.json
|
||||
dist/
|
||||
coverage/
|
||||
|
||||
# docker files
|
||||
docker-compose.yml
|
||||
Dockerfile
|
||||
@@ -0,0 +1,101 @@
|
||||
|
||||
# ADF Demo Application
|
||||
|
||||
Please note that this application is not an official product, but a testing and demo application to showcase complex interactions of ADF components.
|
||||
|
||||
## Installing
|
||||
|
||||
To correctly use this demo check that on your machine you have [Node](https://nodejs.org/en/) version 5.x.x or higher.
|
||||
|
||||
```sh
|
||||
git clone https://github.com/Alfresco/alfresco-ng2-components.git
|
||||
cd alfresco-ng2-components/demo-shell-ng2/
|
||||
npm install
|
||||
```
|
||||
|
||||
## Proxy settings and CORS
|
||||
|
||||
To simplify development and reduce the time to get the application started, we have the following Proxy settings:
|
||||
|
||||
- **http://localhost:3000/ecm** is mapped to **http://localhost:8080**
|
||||
- **http://localhost:3000/bpm** is mapped to **http://localhost:9999**
|
||||
|
||||
The settings above address most common scenarios for running ACS on port 8080 and APS on port 9999 and allow you to skip the CORS configuration.
|
||||
|
||||
If you would like to change default proxy settings, please edit the `config/webpack.common.js` file.
|
||||
|
||||
## Application settings (server-side)
|
||||
|
||||
All server-side application settings are stored in the `app.config-dev.json` and `app.config-prod.json` files.
|
||||
By default the configuration files have the content similar to the following one:
|
||||
|
||||
```json
|
||||
{
|
||||
"ecmHost": "http://localhost:3000/ecm",
|
||||
"bpmHost": "http://localhost:3000/bpm",
|
||||
"application": {
|
||||
"name": "Alfresco"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can add any additional settings to the application configuration file if needed.
|
||||
|
||||
Configuration files are picked based on environment settings (see `app.module.ts` for more details).
|
||||
|
||||
```ts
|
||||
let appConfigFile = 'app.config-dev.json';
|
||||
if (process.env.ENV === 'production') {
|
||||
appConfigFile = 'app.config-prod.json';
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
...
|
||||
CoreModule.forRoot({
|
||||
appConfigFile: appConfigFile
|
||||
}),
|
||||
...
|
||||
]
|
||||
})
|
||||
```
|
||||
|
||||
## Development build
|
||||
|
||||
```sh
|
||||
npm start
|
||||
```
|
||||
|
||||
This command compiles and starts the project in watch mode.
|
||||
Browser will automatically reload upon changes.
|
||||
Upon start you can navigate to `http://localhost:3000` with your preferred browser.
|
||||
|
||||
### Important notes
|
||||
|
||||
This script is recommended for development environment and not suited for headless servers and network access.
|
||||
|
||||
## Production build
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
npm run start:dist
|
||||
```
|
||||
|
||||
This command builds project in `production` mode.
|
||||
All output is placed to `dist` folder and can be served to your preferred web server.
|
||||
You should need no additional files outside the `dist` folder.
|
||||
|
||||
### Important notes
|
||||
|
||||
By default demo application is configured to use [wsrv](https://www.npmjs.com/package/wsrv) tool (lightweight web server)
|
||||
to serve production build output. It will be running at `0.0.0.0` address with port `3000` and allow you to access your application
|
||||
via network. However, you can use any web server of your choice in production.
|
||||
|
||||
## Development branch build
|
||||
|
||||
If you want to run the demo shell with the latest changes from the development branch, use the following command from the /script folder:
|
||||
|
||||
```sh
|
||||
./npm-clean.sh
|
||||
./start-linked.sh -install
|
||||
```
|
||||
@@ -0,0 +1,255 @@
|
||||
{
|
||||
"ecmHost": "http://{hostname}:{port}/ecm",
|
||||
"bpmHost": "http://{hostname}:{port}/bpm",
|
||||
"application": {
|
||||
"name": "Alfresco ADF Appplication"
|
||||
},
|
||||
"pagination": {
|
||||
"size": 25
|
||||
},
|
||||
"files": {
|
||||
"excluded": [".DS_Store", "desktop.ini", ".git"]
|
||||
},
|
||||
"activiti": {
|
||||
"rest": {
|
||||
"fields": [
|
||||
{
|
||||
"processId": "0",
|
||||
"taskId": "7501",
|
||||
"fieldId": "label10",
|
||||
"values": [
|
||||
{ "id": "f1", "name": "Field 1" },
|
||||
{ "id": "f2", "name": "Field 2" },
|
||||
{ "id": "f3", "name": "Field 3" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"document-list": {
|
||||
"supportedPageSizes": [5, 10, 15, 20],
|
||||
"presets": {
|
||||
"-trashcan-": [
|
||||
{
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
|
||||
"sortable": false
|
||||
},
|
||||
{
|
||||
"key": "name",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
|
||||
"cssClass": "full-width ellipsis-cell",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "path",
|
||||
"type": "location",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION",
|
||||
"format": "/files",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "content.sizeInBytes",
|
||||
"type": "fileSize",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "archivedAt",
|
||||
"type": "date",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.DELETED_ON",
|
||||
"format": "timeAgo",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "archivedByUser.displayName",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.DELETED_BY",
|
||||
"sortable": true
|
||||
}
|
||||
],
|
||||
"-sites-": [
|
||||
{
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
|
||||
"sortable": false
|
||||
},
|
||||
{
|
||||
"key": "title",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
|
||||
"cssClass": "full-width ellipsis-cell",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "visibility",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.STATUS",
|
||||
"sortable": true
|
||||
}
|
||||
],
|
||||
"-favorites-": [
|
||||
{
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
|
||||
"sortable": false
|
||||
},
|
||||
{
|
||||
"key": "name",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
|
||||
"cssClass": "full-width ellipsis-cell",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "path",
|
||||
"type": "location",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION",
|
||||
"format": "/files",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "content.sizeInBytes",
|
||||
"type": "fileSize",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "modifiedAt",
|
||||
"type": "date",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON",
|
||||
"format": "timeAgo",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "modifiedByUser.displayName",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY",
|
||||
"sortable": true
|
||||
}
|
||||
],
|
||||
"-recent-": [
|
||||
{
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
|
||||
"sortable": false
|
||||
},
|
||||
{
|
||||
"key": "name",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
|
||||
"cssClass": "full-width ellipsis-cell",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "path",
|
||||
"type": "location",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION",
|
||||
"cssClass": "ellipsis-cell",
|
||||
"format": "/files",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "content.sizeInBytes",
|
||||
"type": "fileSize",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "modifiedAt",
|
||||
"type": "date",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON",
|
||||
"format": "timeAgo",
|
||||
"sortable": true
|
||||
}
|
||||
],
|
||||
"-sharedlinks-": [
|
||||
{
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
|
||||
"sortable": false
|
||||
},
|
||||
{
|
||||
"key": "name",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
|
||||
"cssClass": "full-width ellipsis-cell",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "path",
|
||||
"type": "location",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION",
|
||||
"cssClass": "ellipsis-cell",
|
||||
"format": "/files",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "content.sizeInBytes",
|
||||
"type": "fileSize",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "modifiedAt",
|
||||
"type": "date",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON",
|
||||
"format": "timeAgo",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "modifiedByUser.displayName",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "sharedByUser.displayName",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.SHARED_BY",
|
||||
"sortable": true
|
||||
}
|
||||
],
|
||||
"default": [
|
||||
{
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
|
||||
"sortable": false
|
||||
},
|
||||
{
|
||||
"key": "name",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
|
||||
"cssClass": "full-width ellipsis-cell",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "content.sizeInBytes",
|
||||
"type": "fileSize",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "modifiedAt",
|
||||
"type": "date",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON",
|
||||
"format": "timeAgo",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "modifiedByUser.displayName",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY",
|
||||
"sortable": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
{
|
||||
"ecmHost": "http://{hostname}",
|
||||
"bpmHost": "http://{hostname}",
|
||||
"application": {
|
||||
"name": "Alfresco ADF Appplication"
|
||||
},
|
||||
"pagination": {
|
||||
"size": 25
|
||||
},
|
||||
"files": {
|
||||
"excluded": [".DS_Store", "desktop.ini", ".git"]
|
||||
},
|
||||
"activiti": {
|
||||
"rest": {
|
||||
"fields": [
|
||||
{
|
||||
"processId": "0",
|
||||
"taskId": "7501",
|
||||
"fieldId": "label10",
|
||||
"values": [
|
||||
{ "id": "f1", "name": "Field 1" },
|
||||
{ "id": "f2", "name": "Field 2" },
|
||||
{ "id": "f3", "name": "Field 3" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"document-list": {
|
||||
"supportedPageSizes": [5, 10, 15, 20],
|
||||
"presets": {
|
||||
"-trashcan-": [
|
||||
{
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
|
||||
"sortable": false
|
||||
},
|
||||
{
|
||||
"key": "name",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
|
||||
"cssClass": "full-width ellipsis-cell",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "path",
|
||||
"type": "location",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION",
|
||||
"format": "/files",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "content.sizeInBytes",
|
||||
"type": "fileSize",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "archivedAt",
|
||||
"type": "date",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.DELETED_ON",
|
||||
"format": "timeAgo",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "archivedByUser.displayName",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.DELETED_BY",
|
||||
"sortable": true
|
||||
}
|
||||
],
|
||||
"-sites-": [
|
||||
{
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
|
||||
"sortable": false
|
||||
},
|
||||
{
|
||||
"key": "title",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
|
||||
"cssClass": "full-width ellipsis-cell",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "visibility",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.STATUS",
|
||||
"sortable": true
|
||||
}
|
||||
],
|
||||
"-favorites-": [
|
||||
{
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
|
||||
"sortable": false
|
||||
},
|
||||
{
|
||||
"key": "name",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
|
||||
"cssClass": "full-width ellipsis-cell",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "path",
|
||||
"type": "location",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION",
|
||||
"format": "/files",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "content.sizeInBytes",
|
||||
"type": "fileSize",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "modifiedAt",
|
||||
"type": "date",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON",
|
||||
"format": "timeAgo",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "modifiedByUser.displayName",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY",
|
||||
"sortable": true
|
||||
}
|
||||
],
|
||||
"-recent-": [
|
||||
{
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
|
||||
"sortable": false
|
||||
},
|
||||
{
|
||||
"key": "name",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
|
||||
"cssClass": "full-width ellipsis-cell",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "path",
|
||||
"type": "location",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION",
|
||||
"cssClass": "ellipsis-cell",
|
||||
"format": "/files",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "content.sizeInBytes",
|
||||
"type": "fileSize",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "modifiedAt",
|
||||
"type": "date",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON",
|
||||
"format": "timeAgo",
|
||||
"sortable": true
|
||||
}
|
||||
],
|
||||
"-sharedlinks-": [
|
||||
{
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
|
||||
"sortable": false
|
||||
},
|
||||
{
|
||||
"key": "name",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
|
||||
"cssClass": "full-width ellipsis-cell",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "path",
|
||||
"type": "location",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION",
|
||||
"cssClass": "ellipsis-cell",
|
||||
"format": "/files",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "content.sizeInBytes",
|
||||
"type": "fileSize",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "modifiedAt",
|
||||
"type": "date",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON",
|
||||
"format": "timeAgo",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "modifiedByUser.displayName",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "sharedByUser.displayName",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.SHARED_BY",
|
||||
"sortable": true
|
||||
}
|
||||
],
|
||||
"default": [
|
||||
{
|
||||
"key": "$thumbnail",
|
||||
"type": "image",
|
||||
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
|
||||
"sortable": false
|
||||
},
|
||||
{
|
||||
"key": "name",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
|
||||
"cssClass": "full-width ellipsis-cell",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "content.sizeInBytes",
|
||||
"type": "fileSize",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "modifiedAt",
|
||||
"type": "date",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON",
|
||||
"format": "timeAgo",
|
||||
"sortable": true
|
||||
},
|
||||
{
|
||||
"key": "modifiedByUser.displayName",
|
||||
"type": "text",
|
||||
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY",
|
||||
"sortable": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
var port = process.env.PORT || 3000,
|
||||
http = require('http'),
|
||||
fs = require('fs'),
|
||||
url = require('url'),
|
||||
mime = require('mime'),
|
||||
html = fs.readFileSync('index.html');
|
||||
|
||||
var log = function(entry) {
|
||||
fs.appendFileSync('/tmp/sample-app.log', new Date().toISOString() + ' - ' + entry + '\n');
|
||||
};
|
||||
|
||||
var server = http.createServer(function (req, res) {
|
||||
|
||||
// Parse the request containing file name
|
||||
var pathname = url.parse(req.url).pathname;
|
||||
|
||||
// Print the name of the file for which request is made.
|
||||
console.log("Request for " + pathname + " received.");
|
||||
|
||||
if (req.method === 'POST') {
|
||||
var body = '';
|
||||
|
||||
req.on('data', function(chunk) {
|
||||
body += chunk;
|
||||
});
|
||||
|
||||
req.on('end', function() {
|
||||
if (req.url === '/') {
|
||||
log('Received message: ' + body);
|
||||
} else if (req.url = '/scheduled') {
|
||||
log('Received task ' + req.headers['x-aws-sqsd-taskname'] + ' scheduled at ' + req.headers['x-aws-sqsd-scheduled-at']);
|
||||
}
|
||||
|
||||
res.writeHead(200, 'OK', {'Content-Type': 'text/plain'});
|
||||
res.end();
|
||||
});
|
||||
} else {
|
||||
var filename = pathname.substr(1);
|
||||
if(filename === '' || filename.indexOf('.') === -1){
|
||||
filename = 'index.html';
|
||||
}
|
||||
// Read the requested file content from file system
|
||||
fs.readFile(filename, function (err, data) {
|
||||
if (err) {
|
||||
console.log(err, filename);
|
||||
// HTTP Status: 404 : NOT FOUND
|
||||
// Content Type: text/plain
|
||||
res.writeHead(404, {'Content-Type': 'text/html'});
|
||||
}else{
|
||||
//Page found
|
||||
// HTTP Status: 200 : OK
|
||||
// Content Type: text/plain
|
||||
var type = mime.lookup(filename);
|
||||
console.log('type',type);
|
||||
if (!res.getHeader('content-type')) {
|
||||
var charset = mime.charsets.lookup(type);
|
||||
res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : ''));
|
||||
}
|
||||
if(type.indexOf('image') > -1 || type.indexOf('font') > -1){
|
||||
var img = fs.readFileSync(pathname.substr(1));
|
||||
res.end(img, 'binary');
|
||||
}else{
|
||||
res.write(data.toString());
|
||||
}
|
||||
// Write the content of the file to response body
|
||||
}
|
||||
// Send the response body
|
||||
res.end();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Listen on port 3000, IP defaults to 127.0.0.1
|
||||
server.listen(port);
|
||||
|
||||
// Put a friendly message on the terminal
|
||||
console.log('Server running at http://127.0.0.1:' + port + '/');
|
||||
@@ -0,0 +1 @@
|
||||
<router-outlet></router-outlet>
|
||||
@@ -0,0 +1,45 @@
|
||||
/*!
|
||||
* @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, ViewEncapsulation } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { AlfrescoSettingsService, PageTitleService, StorageService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./theme.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class AppComponent {
|
||||
searchTerm: string = '';
|
||||
|
||||
constructor(private settingsService: AlfrescoSettingsService,
|
||||
private storage: StorageService,
|
||||
pageTitleService: PageTitleService,
|
||||
route: ActivatedRoute,
|
||||
router: Router) {
|
||||
this.setProvider();
|
||||
pageTitleService.setTitle();
|
||||
}
|
||||
|
||||
private setProvider() {
|
||||
if (this.storage.hasItem(`providers`)) {
|
||||
this.settingsService.setProviders(this.storage.getItem(`providers`));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
/*!
|
||||
* @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 { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
|
||||
import { AnalyticsModule } from 'ng2-activiti-analytics';
|
||||
import { DiagramsModule } from 'ng2-activiti-diagrams';
|
||||
import { ActivitiFormModule } from 'ng2-activiti-form';
|
||||
import { ActivitiProcessListModule } from 'ng2-activiti-processlist';
|
||||
import { ActivitiTaskListModule } from 'ng2-activiti-tasklist';
|
||||
import { AppConfigService, CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
|
||||
import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
import { DocumentListModule } from 'ng2-alfresco-documentlist';
|
||||
import { LoginModule } from 'ng2-alfresco-login';
|
||||
import { SearchModule } from 'ng2-alfresco-search';
|
||||
import { SocialModule } from 'ng2-alfresco-social';
|
||||
import { TagModule } from 'ng2-alfresco-tag';
|
||||
import { UploadModule } from 'ng2-alfresco-upload';
|
||||
import { UserInfoModule } from 'ng2-alfresco-userinfo';
|
||||
import { ViewerModule } from 'ng2-alfresco-viewer';
|
||||
import { WebScriptModule } from 'ng2-alfresco-webscript';
|
||||
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { Editor3DModule } from 'ng2-3d-editor';
|
||||
import { ChartsModule } from 'ng2-charts';
|
||||
import { AppComponent } from './app.component';
|
||||
import { routing } from './app.routes';
|
||||
import { CustomEditorsModule } from './components/activiti/custom-editor/custom-editor.component';
|
||||
import { AppLayoutComponent } from './components/app-layout/app-layout.component';
|
||||
import { FileViewComponent } from './components/file-view/file-view.component';
|
||||
import { FormListDemoComponent } from './components/form/form-list-demo.component';
|
||||
import { ThemePickerModule } from './components/theme-picker/theme-picker';
|
||||
import { MaterialModule } from './material.module';
|
||||
import { DebugAppConfigService } from './services/debug-app-config.service';
|
||||
|
||||
import { CustomSourcesComponent } from './components/files/custom-sources.component';
|
||||
|
||||
import {
|
||||
AboutComponent,
|
||||
ActivitiAppsViewComponent,
|
||||
ActivitiDemoComponent,
|
||||
ActivitiProcessAttachmentsComponent,
|
||||
ActivitiShowDiagramComponent,
|
||||
ActivitiTaskAttachmentsComponent,
|
||||
DataTableDemoComponent,
|
||||
FilesComponent,
|
||||
FormDemoComponent,
|
||||
FormNodeViewerComponent,
|
||||
FormViewerComponent,
|
||||
HomeComponent,
|
||||
LoginDemoComponent,
|
||||
SearchBarComponent,
|
||||
SearchComponent,
|
||||
SettingsComponent,
|
||||
SocialComponent,
|
||||
TagComponent,
|
||||
WebscriptComponent
|
||||
} from './components/index';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
BrowserModule,
|
||||
routing,
|
||||
CoreModule,
|
||||
MaterialModule,
|
||||
LoginModule,
|
||||
SearchModule,
|
||||
DataTableModule,
|
||||
DocumentListModule,
|
||||
UploadModule,
|
||||
TagModule,
|
||||
SocialModule,
|
||||
WebScriptModule,
|
||||
ViewerModule,
|
||||
ActivitiFormModule,
|
||||
ActivitiTaskListModule,
|
||||
ActivitiProcessListModule,
|
||||
UserInfoModule,
|
||||
AnalyticsModule,
|
||||
DiagramsModule,
|
||||
CustomEditorsModule,
|
||||
Editor3DModule,
|
||||
ChartsModule,
|
||||
ThemePickerModule,
|
||||
FlexLayoutModule
|
||||
],
|
||||
declarations: [
|
||||
AppComponent,
|
||||
HomeComponent,
|
||||
DataTableDemoComponent,
|
||||
SearchComponent,
|
||||
SearchBarComponent,
|
||||
LoginDemoComponent,
|
||||
ActivitiDemoComponent,
|
||||
ActivitiTaskAttachmentsComponent,
|
||||
ActivitiProcessAttachmentsComponent,
|
||||
ActivitiShowDiagramComponent,
|
||||
ActivitiAppsViewComponent,
|
||||
FormViewerComponent,
|
||||
WebscriptComponent,
|
||||
TagComponent,
|
||||
SocialComponent,
|
||||
AboutComponent,
|
||||
FilesComponent,
|
||||
FormNodeViewerComponent,
|
||||
SettingsComponent,
|
||||
FormDemoComponent,
|
||||
FormListDemoComponent,
|
||||
CustomSourcesComponent,
|
||||
FileViewComponent,
|
||||
AppLayoutComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AppConfigService, useClass: DebugAppConfigService },
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'app',
|
||||
source: 'resources'
|
||||
}
|
||||
}
|
||||
],
|
||||
bootstrap: [ AppComponent ]
|
||||
})
|
||||
export class AppModule { }
|
||||
@@ -0,0 +1,158 @@
|
||||
/*!
|
||||
* @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 { ModuleWithProviders } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { AuthGuard, AuthGuardBpm, AuthGuardEcm } from 'ng2-alfresco-core';
|
||||
import { AppLayoutComponent } from './components/app-layout/app-layout.component';
|
||||
|
||||
import {
|
||||
AboutComponent,
|
||||
ActivitiAppsViewComponent,
|
||||
ActivitiDemoComponent,
|
||||
ActivitiShowDiagramComponent,
|
||||
DataTableDemoComponent,
|
||||
FilesComponent,
|
||||
FormDemoComponent,
|
||||
FormNodeViewerComponent,
|
||||
FormViewerComponent,
|
||||
HomeComponent,
|
||||
LoginDemoComponent,
|
||||
SearchComponent,
|
||||
SettingsComponent,
|
||||
SocialComponent,
|
||||
TagComponent,
|
||||
WebscriptComponent
|
||||
} from './components/index';
|
||||
|
||||
import { UploadButtonComponent } from 'ng2-alfresco-upload';
|
||||
import { FileViewComponent } from './components/file-view/file-view.component';
|
||||
import { CustomSourcesComponent } from './components/files/custom-sources.component';
|
||||
import { FormListDemoComponent } from './components/form/form-list-demo.component';
|
||||
|
||||
export const appRoutes: Routes = [
|
||||
{ path: 'login', component: LoginDemoComponent },
|
||||
{ path: 'settings', component: SettingsComponent },
|
||||
{ path: 'files/:nodeId/view', component: FileViewComponent, canActivate: [ AuthGuardEcm ] },
|
||||
{
|
||||
path: '',
|
||||
component: AppLayoutComponent,
|
||||
canActivate: [AuthGuard],
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: HomeComponent
|
||||
},
|
||||
{
|
||||
path: 'home',
|
||||
component: HomeComponent
|
||||
},
|
||||
{
|
||||
path: 'files',
|
||||
component: FilesComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{
|
||||
path: 'files/:id',
|
||||
component: FilesComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{
|
||||
path: 'dl-custom-sources',
|
||||
component: CustomSourcesComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{
|
||||
path: 'datatable',
|
||||
component: DataTableDemoComponent
|
||||
},
|
||||
{
|
||||
path: 'uploader',
|
||||
component: UploadButtonComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{
|
||||
path: 'search',
|
||||
component: SearchComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{
|
||||
path: 'activiti',
|
||||
component: ActivitiAppsViewComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'activiti/apps',
|
||||
component: ActivitiAppsViewComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'activiti/apps/:appId/tasks',
|
||||
component: ActivitiDemoComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'activiti/apps/:appId/processes',
|
||||
component: ActivitiDemoComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'activiti/apps/:appId/diagram/:processDefinitionId',
|
||||
component: ActivitiShowDiagramComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
// TODO: check if neeeded
|
||||
{
|
||||
path: 'activiti/appId/:appId',
|
||||
component: ActivitiDemoComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
// TODO: check if needed
|
||||
{
|
||||
path: 'activiti/tasks/:id',
|
||||
component: FormViewerComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
// TODO: check if needed
|
||||
{
|
||||
path: 'activiti/tasksnode/:id',
|
||||
component: FormNodeViewerComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'webscript',
|
||||
component: WebscriptComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{
|
||||
path: 'tag',
|
||||
component: TagComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{
|
||||
path: 'social',
|
||||
component: SocialComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{ path: 'about', component: AboutComponent },
|
||||
{ path: 'form', component: FormDemoComponent },
|
||||
{ path: 'form-list', component: FormListDemoComponent }
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);
|
||||
@@ -0,0 +1,10 @@
|
||||
.about-container {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.adf-table-version {
|
||||
width: 60%;
|
||||
border: 0;
|
||||
border-spacing: 0;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<div class="about-container">
|
||||
<h3>Server settings</h3>
|
||||
<md-list>
|
||||
<small>The values below are taken from the AppConfigService and loaded from the '{{ configFile }}' file.</small>
|
||||
<md-list-item>
|
||||
<h4 md-line> Alfresco Process Services URL: {{ bpmHost }}</h4>
|
||||
</md-list-item>
|
||||
<md-divider></md-divider>
|
||||
<md-list-item>
|
||||
<h4 md-line>Alfresco Content Services URL: {{ ecmHost }}</h4>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
|
||||
<h3>Product Versions</h3>
|
||||
<div *ngIf="bpmVersion">
|
||||
<h3>BPM</h3>
|
||||
<label> Edition </label> {{ bpmVersion.edition }}
|
||||
<p></p>
|
||||
<label> Version </label> {{ bpmVersion.majorVersion }}.{{ bpmVersion.minorVersion }}.{{ bpmVersion.revisionVersion }}
|
||||
</div>
|
||||
<div *ngIf="ecmVersion">
|
||||
<h3>ECM</h3>
|
||||
<label> Edition </label> {{ ecmVersion.edition }}
|
||||
<p></p>
|
||||
<label> Version </label> {{ ecmVersion.version.display }}
|
||||
<p></p>
|
||||
<h4>License</h4>
|
||||
<adf-datatable [data]="license"></adf-datatable>
|
||||
|
||||
<h4> Status</h4>
|
||||
<adf-datatable [data]="status"></adf-datatable>
|
||||
|
||||
<h4>Modules</h4>
|
||||
|
||||
<adf-datatable [data]="modules"></adf-datatable>
|
||||
</div>
|
||||
|
||||
<div *ngIf="githubUrlCommitAlpha">
|
||||
<h3>Source code</h3>
|
||||
<small>You are running the project based on the following commit:</small>
|
||||
<div>
|
||||
<a [href]="githubUrlCommitAlpha">{{githubUrlCommitAlpha}}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>Packages</h3>
|
||||
<small>Current project is using the following ADF libraries:</small>
|
||||
<adf-datatable [data]="data"></adf-datatable>
|
||||
</div>
|
||||
@@ -0,0 +1,132 @@
|
||||
/*!
|
||||
* @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, OnInit } from '@angular/core';
|
||||
import { Http } from '@angular/http';
|
||||
import { AlfrescoAuthenticationService, AppConfigService, BpmProductVersionModel, DiscoveryApiService, EcmProductVersionModel } from 'ng2-alfresco-core';
|
||||
import { ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-about-page',
|
||||
templateUrl: './about.component.html',
|
||||
styleUrls: ['./about.component.css']
|
||||
})
|
||||
export class AboutComponent implements OnInit {
|
||||
|
||||
data: ObjectDataTableAdapter;
|
||||
status: ObjectDataTableAdapter;
|
||||
license: ObjectDataTableAdapter;
|
||||
modules: ObjectDataTableAdapter;
|
||||
githubUrlCommitAlpha: string = 'https://github.com/Alfresco/alfresco-ng2-components/commits/';
|
||||
|
||||
configFile: string = 'app.config.json';
|
||||
ecmHost: string = '';
|
||||
bpmHost: string = '';
|
||||
|
||||
ecmVersion: EcmProductVersionModel = null;
|
||||
bpmVersion: BpmProductVersionModel = null;
|
||||
|
||||
constructor(private http: Http,
|
||||
private appConfig: AppConfigService,
|
||||
private authService: AlfrescoAuthenticationService,
|
||||
private discovery: DiscoveryApiService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
if (this.authService.isEcmLoggedIn()) {
|
||||
this.discovery.getEcmProductInfo().subscribe((ecmVers) => {
|
||||
this.ecmVersion = ecmVers;
|
||||
|
||||
this.modules = new ObjectDataTableAdapter(this.ecmVersion.modules, [
|
||||
{type: 'text', key: 'id', title: 'ID', sortable: true},
|
||||
{type: 'text', key: 'title', title: 'Title', sortable: true},
|
||||
{type: 'text', key: 'version', title: 'Description', sortable: true},
|
||||
{type: 'text', key: 'installDate', title: 'Install Date', sortable: true},
|
||||
{type: 'text', key: 'installState', title: 'Install State', sortable: true},
|
||||
{type: 'text', key: 'versionMin', title: 'Version Minor', sortable: true},
|
||||
{type: 'text', key: 'versionMax', title: 'Version Max', sortable: true}
|
||||
]);
|
||||
|
||||
this.status = new ObjectDataTableAdapter([this.ecmVersion.status], [
|
||||
{type: 'text', key: 'isReadOnly', title: 'ReadOnly', sortable: true},
|
||||
{type: 'text', key: 'isAuditEnabled', title: 'Is Audit Enable', sortable: true},
|
||||
{type: 'text', key: 'isQuickShareEnabled', title: 'Is quick shared enable', sortable: true},
|
||||
{type: 'text', key: 'isThumbnailGenerationEnabled', title: 'Thumbnail Generation', sortable: true}
|
||||
]);
|
||||
|
||||
this.license = new ObjectDataTableAdapter([this.ecmVersion.license], [
|
||||
{type: 'text', key: 'issuedAt', title: 'Issued At', sortable: true},
|
||||
{type: 'text', key: 'expiresAt', title: 'Expires At', sortable: true},
|
||||
{type: 'text', key: 'remainingDays', title: 'Remaining Days', sortable: true},
|
||||
{type: 'text', key: 'holder', title: 'Holder', sortable: true},
|
||||
{type: 'text', key: 'mode', title: 'Is Cluster Enabled', sortable: true},
|
||||
{type: 'text', key: 'isClusterEnabled', title: 'Is Cluster Enabled', sortable: true},
|
||||
{type: 'text', key: 'isCryptodocEnabled', title: 'Is Cryptodoc Enable', sortable: true}
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
if (this.authService.isBpmLoggedIn()) {
|
||||
this.discovery.getBpmProductInfo().subscribe((bpmVers) => {
|
||||
this.bpmVersion = bpmVers;
|
||||
});
|
||||
}
|
||||
|
||||
this.http.get('/versions.json').subscribe(response => {
|
||||
let regexp = new RegExp('^(ng2-activiti|ng2-alfresco|alfresco-)');
|
||||
|
||||
let alfrescoPackages = Object.keys(response.json().dependencies).filter((val) => {
|
||||
return regexp.test(val);
|
||||
});
|
||||
|
||||
let alfrescoPackagesTableRepresentation = [];
|
||||
alfrescoPackages.forEach((val) => {
|
||||
alfrescoPackagesTableRepresentation.push({
|
||||
name: val,
|
||||
version: response.json().dependencies[val].version
|
||||
});
|
||||
});
|
||||
|
||||
this.gitHubLinkCreation(alfrescoPackagesTableRepresentation);
|
||||
|
||||
this.data = new ObjectDataTableAdapter(alfrescoPackagesTableRepresentation, [
|
||||
{type: 'text', key: 'name', title: 'Name', sortable: true},
|
||||
{type: 'text', key: 'version', title: 'Version', sortable: true}
|
||||
]);
|
||||
|
||||
});
|
||||
|
||||
this.ecmHost = this.appConfig.get<string>('ecmHost');
|
||||
this.bpmHost = this.appConfig.get<string>('bpmHost');
|
||||
}
|
||||
|
||||
private gitHubLinkCreation(alfrescoPackagesTableRepresentation): void {
|
||||
let corePackage = alfrescoPackagesTableRepresentation.find((packageUp) => {
|
||||
return packageUp.name === 'ng2-alfresco-core';
|
||||
});
|
||||
|
||||
if (corePackage) {
|
||||
let commitIsh = corePackage.version.split('-');
|
||||
if (commitIsh.length > 1) {
|
||||
this.githubUrlCommitAlpha = this.githubUrlCommitAlpha + commitIsh[1];
|
||||
} else {
|
||||
this.githubUrlCommitAlpha = this.githubUrlCommitAlpha + corePackage.version;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
<md-tab-group [(selectedIndex)]="activeTab">
|
||||
<md-tab id="tasks-header" href="#tasks" label="{{'PS-TAB.TASKS-TAB' | translate}}">
|
||||
<div class="page-content">
|
||||
<div class="activiti-demo-grid" fxLayout="row" fxLayout.lt-lg="column" fxLayoutAlign="stretch">
|
||||
<div class="activiti-demo-grid-item activiti-demo-tasks-menu" fxFlex.gt-md="225px">
|
||||
<div class="activiti-demo-list-buttons">
|
||||
<button color="primary" md-raised-button data-automation-id="btn-start-task" class="activiti-demo-list-buttons-start" (click)="navigateStartTask()">
|
||||
<md-icon>add</md-icon>
|
||||
<span>{{'PS-TAB.START-TASK' | translate}}</span>
|
||||
</button>
|
||||
</div>
|
||||
<adf-accordion>
|
||||
<adf-accordion-group [heading]="'Tasks'" [isSelected]="true" [isOpen]="true"
|
||||
[headingIcon]="'assignment'">
|
||||
<adf-filters
|
||||
[filterParam]="{name:'MY tasks'}"
|
||||
[appId]="appId"
|
||||
[hasIcon]="false"
|
||||
(filterClick)="onTaskFilterClick($event)"
|
||||
(onSuccess)="onSuccessTaskFilterList($event)"
|
||||
#activitifilter>
|
||||
</adf-filters>
|
||||
</adf-accordion-group>
|
||||
</adf-accordion>
|
||||
</div>
|
||||
<div class="activiti-demo-grid-item activiti-demo-tasks-list" fxFlex.gt-md="335px" [ngClass.gt-md]="{'small-pagination': true}"
|
||||
*ngIf="taskFilter && !isStartTaskMode()">
|
||||
<adf-tasklist
|
||||
[appId]="taskFilter?.appId"
|
||||
[page]="taskPage"
|
||||
[size]="taskPagination.maxItems"
|
||||
[processDefinitionKey]="taskFilter?.filter?.processDefinitionKey"
|
||||
[name]="taskFilter?.filter?.name"
|
||||
[assignment]="taskFilter?.filter?.assignment"
|
||||
[state]="taskFilter?.filter?.state"
|
||||
[sort]="taskFilter?.filter?.sort"
|
||||
[data]="dataTasks"
|
||||
[landingTaskId]="currentTaskId"
|
||||
(rowClick)="onTaskRowClick($event)"
|
||||
(onSuccess)="onSuccessTaskList($event)"
|
||||
(row-click)="onRowClick($event)"
|
||||
(row-dblclick)="onTaskRowDblClick($event)"
|
||||
#activititasklist>
|
||||
<!-- Custom column definition demo -->
|
||||
<!--
|
||||
<data-columns>
|
||||
<data-column key="name" title="NAME" class="full-width name-column"></data-column>
|
||||
<data-column key="created" title="Created" class="hidden"></data-column>
|
||||
</data-columns>
|
||||
-->
|
||||
</adf-tasklist>
|
||||
|
||||
<adf-pagination
|
||||
(changePageNumber)="onChangePageNumber($event)"
|
||||
(changePageSize)="onChangePageSize($event)"
|
||||
(nextPage)="onNextPage($event)"
|
||||
(prevPage)="onPrevPage($event)"
|
||||
[pagination]="taskPagination"
|
||||
[supportedPageSizes]="[2, 4, 6, 8, 10, 12]">
|
||||
</adf-pagination>
|
||||
</div>
|
||||
<div class="activiti-demo-grid-item activiti-demo-tasks-details" *ngIf="!isStartTaskMode()" fxFlex.gt-md="1 1 auto">
|
||||
<adf-task-details #activitidetails
|
||||
[debugMode]="true"
|
||||
[taskId]="currentTaskId"
|
||||
[fieldValidators]="fieldValidators"
|
||||
(formCompleted)="onFormCompleted($event)"
|
||||
(formContentClicked)="onFormContentClick($event)"
|
||||
(taskCreated)="onTaskCreated($event)"
|
||||
(assignTask)="onAssignTask()"
|
||||
(taskDeleted)="onTaskDeleted($event)">
|
||||
</adf-task-details>
|
||||
<hr>
|
||||
<div *ngIf="currentTaskId">
|
||||
{{'PS-TAB.AUDIT-LOG' | translate}}
|
||||
<button
|
||||
adf-task-audit
|
||||
[task-id]="currentTaskId"
|
||||
[download]="true"
|
||||
md-icon-button (clicked)="onAuditClick($event)" (error)="onAuditError($event)">
|
||||
<md-icon>assignment_ind</md-icon>
|
||||
</button>
|
||||
<hr>
|
||||
</div>
|
||||
<md-card>
|
||||
<md-card-content>
|
||||
<activiti-task-attachments
|
||||
[taskId]="currentTaskId">
|
||||
</activiti-task-attachments>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
</div>
|
||||
<div class="activiti-demo-grid-item activiti-demo-tasks-start" *ngIf="isStartTaskMode()" fxFlex.gt-md="1 1 auto">
|
||||
<adf-start-task
|
||||
[appId]="appId"
|
||||
(success)="onStartTaskSuccess($event)"
|
||||
(cancel)="onCancelStartTask()">
|
||||
</adf-start-task>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</md-tab>
|
||||
<md-tab id="processes-header" href="#processes"
|
||||
label="{{'PS-TAB.PROCESSES-TAB' | translate}}">
|
||||
<div class="page-content">
|
||||
<div class="activiti-demo-grid" fxLayout="row" fxLayout.lt-lg="column" fxLayoutAlign="stretch">
|
||||
<div class="activiti-demo-grid-item activiti-demo-processes-menu" fxFlex.gt-md="225px">
|
||||
<div class="activiti-demo-list-buttons">
|
||||
<button
|
||||
color="primary"
|
||||
md-raised-button
|
||||
class="activiti-demo-list-buttons-start"
|
||||
data-automation-id="btn-start-process"
|
||||
(click)="navigateStartProcess()">
|
||||
<md-icon>add</md-icon>
|
||||
<span>{{'PS-TAB.START-PROCESS' | translate}}</span>
|
||||
</button>
|
||||
</div>
|
||||
<adf-accordion>
|
||||
<adf-accordion-group [heading]="'Processes'" [isSelected]="true" [isOpen]="true"
|
||||
[headingIcon]="'assessment'">
|
||||
<adf-process-instance-filters
|
||||
[filterParam]="{index: 0}"
|
||||
[appId]="appId"
|
||||
(filterClick)="onProcessFilterClick($event)"
|
||||
(onSuccess)="onSuccessProcessFilterList($event)">
|
||||
</adf-process-instance-filters>
|
||||
</adf-accordion-group>
|
||||
</adf-accordion>
|
||||
</div>
|
||||
<div class="activiti-demo-grid-item activiti-demo-processes-list activiti-demo-list" fxFlex.gt-md="335px" [ngClass.gt-md]="{'small-pagination': true}"
|
||||
*ngIf="processFilter && !isStartProcessMode()">
|
||||
<adf-process-instance-list
|
||||
*ngIf="processFilter?.hasFilter()" [appId]="processFilter.appId"
|
||||
[processDefinitionKey]="processFilter.filter.processDefinitionKey"
|
||||
[name]="processFilter.filter.name"
|
||||
[state]="processFilter.filter.state"
|
||||
[sort]="processFilter.filter.sort"
|
||||
[data]="dataProcesses"
|
||||
(rowClick)="onProcessRowClick($event)"
|
||||
(row-dblclick)="onProcessRowDblClick($event)"
|
||||
(onSuccess)="onSuccessProcessList($event)">
|
||||
<!-- Custom column definition demo -->
|
||||
<!--
|
||||
<data-columns>
|
||||
<data-column key="name" title="NAME" class="full-width name-column"></data-column>
|
||||
<data-column key="created" title="Created" class="hidden"></data-column>
|
||||
</data-columns>
|
||||
-->
|
||||
</adf-process-instance-list>
|
||||
</div>
|
||||
<div class="activiti-demo-grid-item activiti-demo-processes-details" *ngIf="!isStartProcessMode()" fxFlex.gt-md="1 1 auto">
|
||||
<adf-process-instance-details
|
||||
[processInstanceId]="currentProcessInstanceId"
|
||||
(processCancelled)="processCancelled()"
|
||||
(showProcessDiagram)="onShowProcessDiagram($event)"
|
||||
(taskClick)="onProcessDetailsTaskClick($event)">
|
||||
</adf-process-instance-details>
|
||||
<hr>
|
||||
<div *ngIf="currentProcessInstanceId">
|
||||
{{'PS-TAB.AUDIT-LOG' | translate}}
|
||||
<button adf-process-audit
|
||||
[process-id]="currentProcessInstanceId"
|
||||
[download]="true" md-icon-button
|
||||
[format]="'pdf'"
|
||||
(clicked)="onAuditClick($event)"
|
||||
(error)="onAuditError($event)">
|
||||
<md-icon>assignment_ind</md-icon>
|
||||
</button>
|
||||
<hr>
|
||||
</div>
|
||||
<md-card>
|
||||
<md-card-content>
|
||||
<activiti-process-attachments
|
||||
[processId]="currentProcessInstanceId">
|
||||
</activiti-process-attachments>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
</div>
|
||||
<div class="activiti-demo-grid-item activiti-demo-processes-start" fxFlex.gt-md="1 1 auto"
|
||||
*ngIf="isStartProcessMode()">
|
||||
<adf-start-process
|
||||
[appId]="appId"
|
||||
(start)="onStartProcessInstance($event)"
|
||||
(cancel)="onCancelProcessInstance()">
|
||||
</adf-start-process>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</md-tab>
|
||||
<md-tab id="report-header" href="#report"
|
||||
label="{{'PS-TAB.REPORTS-TAB' | translate}}">
|
||||
<div class="activiti-demo-grid" fxLayout="row" fxLayout.lt-lg="column" fxLayoutAlign="stretch">
|
||||
<div class="activiti-demo-grid-item activiti-demo-reports-menu" fxFlex.gt-md="300px">
|
||||
<span><h5>Report List</h5></span>
|
||||
<hr>
|
||||
<analytics-report-list
|
||||
[appId]="appId"
|
||||
[selectFirst]="selectFirstReport"
|
||||
(reportClick)="onReportClick($event)"
|
||||
#analyticsreportlist>
|
||||
</analytics-report-list>
|
||||
</div>
|
||||
<div class="activiti-demo-grid-item activiti-demo-reports-details" fxFlex.gt-md="1 1 auto">
|
||||
<adf-analytics
|
||||
*ngIf="report"
|
||||
[appId]="appId"
|
||||
[reportId]="report.id"
|
||||
[hideParameters]="false"
|
||||
(editReport)="onEditReport($event)"
|
||||
(reportSaved)="onReportSaved($event)"
|
||||
(reportDeleted)="onReportDeleted()">
|
||||
</adf-analytics>
|
||||
<div *ngIf="!report">
|
||||
<span>{{'ANALYTICS_REPORT.NO_REPORT_MESSAGE' | translate}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</md-tab>
|
||||
</md-tab-group>
|
||||
|
||||
<div *ngIf="fileShowed">
|
||||
<alfresco-viewer
|
||||
[(showViewer)]="fileShowed"
|
||||
[blobFile]="content"
|
||||
[displayName]="contentName"
|
||||
[overlayMode]="true">
|
||||
</alfresco-viewer>
|
||||
</div>
|
||||
@@ -0,0 +1,106 @@
|
||||
|
||||
.adf-no-form-container {
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.activiti-demo-grid {
|
||||
|
||||
.activiti-demo-grid-item {
|
||||
margin: 4px;
|
||||
box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12);
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.activiti-demo-list-buttons {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.activiti-demo-list-buttons-start {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.activiti-demo-tasks-list.small-pagination,
|
||||
.activiti-demo-processes-list.small-pagination {
|
||||
.adf-pagination {
|
||||
|
||||
flex-wrap: wrap;
|
||||
padding-bottom: 24px;
|
||||
padding-top: 8px;
|
||||
|
||||
&__block {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
&__range-block.adf-pagination__block:first-child {
|
||||
order: 1;
|
||||
width: 60%;
|
||||
flex: 0 0 auto;
|
||||
box-sizing: border-box;
|
||||
padding-left: 2px;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
&__perpage-block {
|
||||
order: 3;
|
||||
width: 60%;
|
||||
box-sizing: border-box;
|
||||
padding-left: 2px;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
&__actualinfo-block {
|
||||
order: 2;
|
||||
width: 40%;
|
||||
box-sizing: border-box;
|
||||
padding-right: 2px;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
&__controls-block {
|
||||
order: 4;
|
||||
width: 40%;
|
||||
box-sizing: border-box;
|
||||
padding-right: 2px;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.activiti-demo-list {
|
||||
.adf-data-table {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.adf-data-table tr,
|
||||
.adf-data-table td {
|
||||
height: 36px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.adf-data-table td {
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.adf-data-table th {
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
height: 40px;
|
||||
vertical-align: middle;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1279px) {
|
||||
container-widget .grid-list {
|
||||
flex-direction: column;
|
||||
|
||||
.grid-list-item {
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,464 @@
|
||||
/*!
|
||||
* @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.
|
||||
*/
|
||||
|
||||
// tslint:disable-next-line:adf-file-name
|
||||
import { AfterViewInit, Component, ElementRef, Input, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Pagination } from 'alfresco-js-api';
|
||||
import { AnalyticsReportListComponent } from 'ng2-activiti-analytics';
|
||||
import {
|
||||
DynamicTableRow, FORM_FIELD_VALIDATORS, FormEvent, FormFieldEvent, FormRenderingService,
|
||||
FormService, ValidateDynamicTableRowEvent
|
||||
} from 'ng2-activiti-form';
|
||||
import {
|
||||
FilterProcessRepresentationModel,
|
||||
ProcessFiltersComponent,
|
||||
ProcessInstance,
|
||||
ProcessInstanceDetailsComponent,
|
||||
ProcessInstanceListComponent,
|
||||
StartProcessInstanceComponent
|
||||
} from 'ng2-activiti-processlist';
|
||||
import {
|
||||
AppsListComponent,
|
||||
FilterRepresentationModel,
|
||||
TaskDetailsComponent,
|
||||
TaskDetailsEvent,
|
||||
TaskFiltersComponent,
|
||||
TaskListComponent,
|
||||
TaskListService
|
||||
} from 'ng2-activiti-tasklist';
|
||||
import { AlfrescoApiService } from 'ng2-alfresco-core';
|
||||
import {
|
||||
DataSorting,
|
||||
ObjectDataRow,
|
||||
ObjectDataTableAdapter
|
||||
} from 'ng2-alfresco-datatable';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
import { /*CustomEditorComponent*/ CustomStencil01 } from './custom-editor/custom-editor.component';
|
||||
import { DemoFieldValidator } from './demo-field-validator';
|
||||
|
||||
const currentProcessIdNew = '__NEW__';
|
||||
const currentTaskIdNew = '__NEW__';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-activiti-demo',
|
||||
templateUrl: './activiti-demo.component.html',
|
||||
styleUrls: ['./activiti-demo.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit {
|
||||
|
||||
@ViewChild(TaskFiltersComponent)
|
||||
activitifilter: TaskFiltersComponent;
|
||||
|
||||
@ViewChild(TaskListComponent)
|
||||
taskList: TaskListComponent;
|
||||
|
||||
@ViewChild(ProcessFiltersComponent)
|
||||
activitiprocessfilter: ProcessFiltersComponent;
|
||||
|
||||
@ViewChild(ProcessInstanceListComponent)
|
||||
processList: ProcessInstanceListComponent;
|
||||
|
||||
@ViewChild(ProcessInstanceDetailsComponent)
|
||||
activitiprocessdetails: ProcessInstanceDetailsComponent;
|
||||
|
||||
@ViewChild(TaskDetailsComponent)
|
||||
activitidetails: TaskDetailsComponent;
|
||||
|
||||
@ViewChild(StartProcessInstanceComponent)
|
||||
activitiStartProcess: StartProcessInstanceComponent;
|
||||
|
||||
@ViewChild(AnalyticsReportListComponent)
|
||||
analyticsreportlist: AnalyticsReportListComponent;
|
||||
|
||||
@Input()
|
||||
appId: number = null;
|
||||
|
||||
fileShowed: boolean = false;
|
||||
selectFirstReport: boolean = false;
|
||||
|
||||
private tabs = { tasks: 0, processes: 1, reports: 2 };
|
||||
|
||||
content: Blob;
|
||||
contentName: string;
|
||||
|
||||
layoutType: string;
|
||||
currentTaskId: string;
|
||||
currentProcessInstanceId: string;
|
||||
|
||||
taskSchemaColumns: any[] = [];
|
||||
taskPagination: Pagination = {
|
||||
skipCount: 0,
|
||||
maxItems: 10,
|
||||
totalItems: 0
|
||||
};
|
||||
taskPage: number = 0;
|
||||
processSchemaColumns: any[] = [];
|
||||
|
||||
activeTab: number = this.tabs.tasks; // tasks|processes|reports
|
||||
|
||||
taskFilter: FilterRepresentationModel;
|
||||
report: any;
|
||||
processFilter: FilterProcessRepresentationModel;
|
||||
|
||||
sub: Subscription;
|
||||
blobFile: any;
|
||||
flag: boolean = true;
|
||||
|
||||
dataTasks: ObjectDataTableAdapter;
|
||||
dataProcesses: ObjectDataTableAdapter;
|
||||
|
||||
fieldValidators = [
|
||||
...FORM_FIELD_VALIDATORS,
|
||||
new DemoFieldValidator()
|
||||
];
|
||||
|
||||
constructor(private elementRef: ElementRef,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private taskListService: TaskListService,
|
||||
private apiService: AlfrescoApiService,
|
||||
formRenderingService: FormRenderingService,
|
||||
formService: FormService) {
|
||||
this.dataTasks = new ObjectDataTableAdapter();
|
||||
this.dataTasks.setSorting(new DataSorting('created', 'desc'));
|
||||
|
||||
this.dataProcesses = new ObjectDataTableAdapter(
|
||||
[],
|
||||
[
|
||||
{ type: 'text', key: 'name', title: 'Name', cssClass: 'full-width name-column', sortable: true },
|
||||
{ type: 'text', key: 'started', title: 'Started', cssClass: 'hidden', sortable: true }
|
||||
]
|
||||
);
|
||||
this.dataProcesses.setSorting(new DataSorting('started', 'desc'));
|
||||
|
||||
// Uncomment this line to replace all 'text' field editors with custom component
|
||||
// formRenderingService.setComponentTypeResolver('text', () => CustomEditorComponent, true);
|
||||
|
||||
// Uncomment this line to map 'custom_stencil_01' to local editor component
|
||||
formRenderingService.setComponentTypeResolver('custom_stencil_01', () => CustomStencil01, true);
|
||||
|
||||
formService.formLoaded.subscribe((e: FormEvent) => {
|
||||
console.log(`Form loaded: ${e.form.id}`);
|
||||
});
|
||||
|
||||
formService.formFieldValueChanged.subscribe((e: FormFieldEvent) => {
|
||||
console.log(`Field value changed. Form: ${e.form.id}, Field: ${e.field.id}, Value: ${e.field.value}`);
|
||||
});
|
||||
|
||||
formService.validateDynamicTableRow.subscribe(
|
||||
(e: ValidateDynamicTableRowEvent) => {
|
||||
const row: DynamicTableRow = e.row;
|
||||
if (row && row.value && row.value.name === 'admin') {
|
||||
e.summary.isValid = false;
|
||||
e.summary.text = 'Sorry, wrong value. You cannot use "admin".';
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// Uncomment this block to see form event handling in action
|
||||
/*
|
||||
formService.formEvents.subscribe((event: Event) => {
|
||||
console.log('Event fired:' + event.type);
|
||||
console.log('Event Target:' + event.target);
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
onPrevPage(pagination: Pagination): void {
|
||||
this.taskPagination.skipCount = pagination.skipCount;
|
||||
this.taskPage--;
|
||||
}
|
||||
|
||||
onNextPage(pagination: Pagination): void {
|
||||
this.taskPagination.skipCount = pagination.skipCount;
|
||||
this.taskPage++;
|
||||
}
|
||||
|
||||
onChangePageSize(pagination: Pagination): void {
|
||||
const { skipCount, maxItems } = pagination;
|
||||
this.taskPage = this.currentPage(skipCount, maxItems);
|
||||
this.taskPagination.maxItems = maxItems;
|
||||
this.taskPagination.skipCount = skipCount;
|
||||
}
|
||||
|
||||
onChangePageNumber(pagination: Pagination): void {
|
||||
const { maxItems, skipCount } = pagination;
|
||||
this.taskPage = this.currentPage(skipCount, maxItems);
|
||||
this.taskPagination.maxItems = maxItems;
|
||||
this.taskPagination.skipCount = skipCount;
|
||||
}
|
||||
|
||||
currentPage(skipCount: number, maxItems: number): number {
|
||||
return (skipCount && maxItems) ? Math.floor(skipCount / maxItems) : 0;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.taskListService.tasksList$.subscribe(
|
||||
(tasks) => {
|
||||
this.taskPagination = { count: tasks.data.length, maxItems: this.taskPagination.maxItems, skipCount: this.taskPagination.skipCount, totalItems: tasks.total };
|
||||
console.log({ count: tasks.data.length, maxItems: this.taskPagination.maxItems, skipCount: this.taskPagination.skipCount, totalItems: tasks.total });
|
||||
}, (err) => {
|
||||
console.log('err' + err);
|
||||
});
|
||||
|
||||
if (this.router.url.includes('processes')) {
|
||||
this.activeTab = this.tabs.processes;
|
||||
}
|
||||
this.sub = this.route.params.subscribe(params => {
|
||||
let applicationId = params['appId'];
|
||||
if (applicationId && applicationId !== '0') {
|
||||
this.appId = params['appId'];
|
||||
}
|
||||
|
||||
this.taskFilter = null;
|
||||
this.currentTaskId = null;
|
||||
this.processFilter = null;
|
||||
this.currentProcessInstanceId = null;
|
||||
});
|
||||
this.layoutType = AppsListComponent.LAYOUT_GRID;
|
||||
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.sub.unsubscribe();
|
||||
this.taskListService.tasksList$.subscribe();
|
||||
}
|
||||
|
||||
onTaskFilterClick(filter: FilterRepresentationModel): void {
|
||||
this.applyTaskFilter(filter);
|
||||
}
|
||||
|
||||
onReportClick(event: any): void {
|
||||
this.report = event;
|
||||
}
|
||||
|
||||
onSuccessTaskFilterList(event: any): void {
|
||||
this.applyTaskFilter(this.activitifilter.getCurrentFilter());
|
||||
}
|
||||
|
||||
applyTaskFilter(filter: FilterRepresentationModel) {
|
||||
this.taskFilter = filter;
|
||||
if (filter && this.taskList) {
|
||||
this.taskList.hasCustomDataSource = false;
|
||||
}
|
||||
}
|
||||
|
||||
onStartTaskSuccess(event: any): void {
|
||||
this.activitifilter.selectFilterWithTask(event.id);
|
||||
this.currentTaskId = event.id;
|
||||
}
|
||||
|
||||
onCancelStartTask() {
|
||||
this.currentTaskId = null;
|
||||
this.reloadTaskFilters();
|
||||
}
|
||||
|
||||
onSuccessTaskList(event: FilterRepresentationModel) {
|
||||
this.currentTaskId = this.taskList.getCurrentId();
|
||||
}
|
||||
|
||||
onProcessFilterClick(event: FilterProcessRepresentationModel): void {
|
||||
this.currentProcessInstanceId = null;
|
||||
this.processFilter = event;
|
||||
}
|
||||
|
||||
onSuccessProcessFilterList(): void {
|
||||
this.processFilter = this.activitiprocessfilter.getCurrentFilter();
|
||||
}
|
||||
|
||||
onSuccessProcessList(event: any): void {
|
||||
this.currentProcessInstanceId = this.processList.getCurrentId();
|
||||
}
|
||||
|
||||
onTaskRowClick(taskId): void {
|
||||
this.currentTaskId = taskId;
|
||||
}
|
||||
|
||||
onTaskRowDblClick(event: CustomEvent) {
|
||||
const taskId = event.detail.value.obj.id;
|
||||
this.currentTaskId = taskId;
|
||||
}
|
||||
|
||||
onProcessRowDblClick(event: CustomEvent) {
|
||||
const processInstanceId = event.detail.value.obj.id;
|
||||
this.currentProcessInstanceId = processInstanceId;
|
||||
}
|
||||
|
||||
onProcessRowClick(processInstanceId): void {
|
||||
this.currentProcessInstanceId = processInstanceId;
|
||||
}
|
||||
|
||||
onEditReport(name: string): void {
|
||||
this.analyticsreportlist.reload();
|
||||
}
|
||||
|
||||
onReportSaved(reportId): void {
|
||||
this.analyticsreportlist.reload(reportId);
|
||||
}
|
||||
|
||||
onReportDeleted(): void {
|
||||
this.analyticsreportlist.reload();
|
||||
this.analyticsreportlist.selectReport(null);
|
||||
}
|
||||
|
||||
navigateStartProcess(): void {
|
||||
this.resetProcessFilters();
|
||||
this.reloadProcessFilters();
|
||||
this.currentProcessInstanceId = currentProcessIdNew;
|
||||
}
|
||||
|
||||
navigateStartTask(): void {
|
||||
this.resetTaskFilters();
|
||||
this.reloadTaskFilters();
|
||||
this.currentTaskId = currentTaskIdNew;
|
||||
}
|
||||
|
||||
onStartProcessInstance(instance: ProcessInstance): void {
|
||||
this.currentProcessInstanceId = instance.id;
|
||||
this.activitiStartProcess.reset();
|
||||
this.activitiprocessfilter.selectRunningFilter();
|
||||
}
|
||||
|
||||
onCancelProcessInstance() {
|
||||
this.currentProcessInstanceId = null;
|
||||
this.reloadProcessFilters();
|
||||
}
|
||||
|
||||
isStartProcessMode(): boolean {
|
||||
return this.currentProcessInstanceId === currentProcessIdNew;
|
||||
}
|
||||
|
||||
isStartTaskMode(): boolean {
|
||||
return this.currentTaskId === currentTaskIdNew;
|
||||
}
|
||||
|
||||
processCancelled(data: any): void {
|
||||
this.currentProcessInstanceId = null;
|
||||
this.processList.reload();
|
||||
}
|
||||
|
||||
onSuccessNewProcess(data: any): void {
|
||||
this.processList.reload();
|
||||
}
|
||||
|
||||
onFormCompleted(form): void {
|
||||
this.currentTaskId = null;
|
||||
this.taskPagination.totalItems--;
|
||||
const { skipCount, maxItems, totalItems } = this.taskPagination;
|
||||
if (totalItems > 0 && (skipCount >= totalItems)) {
|
||||
this.taskPagination.skipCount -= maxItems;
|
||||
}
|
||||
this.taskPage = this.currentPage(this.taskPagination.skipCount, maxItems);
|
||||
this.taskList.reload();
|
||||
}
|
||||
|
||||
onFormContentClick(content: any): void {
|
||||
this.fileShowed = true;
|
||||
this.content = content.contentBlob;
|
||||
this.contentName = content.name;
|
||||
}
|
||||
|
||||
onAuditClick(event: any) {
|
||||
console.log(event);
|
||||
}
|
||||
|
||||
onAuditError(event: any): void {
|
||||
console.error('My custom error message' + event);
|
||||
}
|
||||
|
||||
onTaskCreated(data: any): void {
|
||||
this.currentTaskId = data.parentTaskId;
|
||||
this.taskList.reload();
|
||||
}
|
||||
|
||||
onTaskDeleted(data: any): void {
|
||||
this.taskList.reload();
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.loadStencilScriptsInPageFromActiviti();
|
||||
}
|
||||
|
||||
loadStencilScriptsInPageFromActiviti() {
|
||||
this.apiService.getInstance().activiti.scriptFileApi.getControllers().then(response => {
|
||||
if (response) {
|
||||
let s = document.createElement('script');
|
||||
s.type = 'text/javascript';
|
||||
s.text = response;
|
||||
this.elementRef.nativeElement.appendChild(s);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onShowProcessDiagram(event: any): void {
|
||||
this.router.navigate(['/activiti/apps/' + this.appId + '/diagram/' + event.value]);
|
||||
}
|
||||
|
||||
onProcessDetailsTaskClick(event: TaskDetailsEvent): void {
|
||||
event.preventDefault();
|
||||
this.activeTab = this.tabs.tasks;
|
||||
|
||||
const taskId = event.value.id;
|
||||
const processTaskDataRow = new ObjectDataRow({
|
||||
id: taskId,
|
||||
name: event.value.name || 'No name',
|
||||
created: event.value.created
|
||||
});
|
||||
this.activitifilter.selectFilter(null);
|
||||
if (this.taskList) {
|
||||
this.taskList.setCustomDataSource([processTaskDataRow]);
|
||||
this.taskList.selectTask(taskId);
|
||||
}
|
||||
this.currentTaskId = taskId;
|
||||
}
|
||||
|
||||
private resetProcessFilters(): void {
|
||||
this.processFilter = null;
|
||||
}
|
||||
|
||||
private resetTaskFilters(): void {
|
||||
this.taskFilter = null;
|
||||
}
|
||||
|
||||
private reloadProcessFilters(): void {
|
||||
this.activitiprocessfilter.selectFilter(this.activitiprocessfilter.getCurrentFilter());
|
||||
}
|
||||
|
||||
private reloadTaskFilters(): void {
|
||||
this.activitifilter.selectFilter(this.activitifilter.getCurrentFilter());
|
||||
}
|
||||
|
||||
onRowClick(event): void {
|
||||
console.log(event);
|
||||
}
|
||||
|
||||
onRowDblClick(event): void {
|
||||
console.log(event);
|
||||
}
|
||||
|
||||
isTaskCompleted(): boolean {
|
||||
return this.activitidetails.isCompletedTask();
|
||||
}
|
||||
|
||||
onAssignTask() {
|
||||
this.taskList.reload();
|
||||
this.currentTaskId = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
adf-create-process-attachment ::ng-deep button {
|
||||
float: right;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<div id="attachment-process-list" *ngIf="processId">
|
||||
<h5>Attachments</h5>
|
||||
<div class="adf-no-form-container">
|
||||
<adf-upload-drag-area
|
||||
[parentId]="processId"
|
||||
[disabled]="isCompletedProcess()"
|
||||
[showNotificationBar]="false">
|
||||
<adf-process-attachment-list #processAttachList
|
||||
*ngIf="processId"
|
||||
[disabled]="isCompletedProcess()"
|
||||
[processInstanceId]="processId"
|
||||
(attachmentClick)="onAttachmentClick($event)">
|
||||
</adf-process-attachment-list>
|
||||
</adf-upload-drag-area>
|
||||
|
||||
<adf-create-process-attachment
|
||||
*ngIf="!isCompletedProcess()"
|
||||
[processInstanceId]="processId"
|
||||
(success)="onFileUploadComplete($event)">
|
||||
</adf-create-process-attachment>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="fileShowed">
|
||||
<adf-viewer
|
||||
[(showViewer)]="fileShowed"
|
||||
[blobFile]="content"
|
||||
[displayName]="contentName"
|
||||
[overlayMode]="true">
|
||||
</adf-viewer>
|
||||
</div>
|
||||
@@ -0,0 +1,74 @@
|
||||
/*!
|
||||
* @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, Input, OnChanges, OnInit, ViewChild } from '@angular/core';
|
||||
import { ProcessAttachmentListComponent, ProcessUploadService } from 'ng2-activiti-processlist';
|
||||
import { ProcessInstance, ProcessService } from 'ng2-activiti-processlist';
|
||||
import { UploadService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'activiti-process-attachments',
|
||||
templateUrl: './activiti-process-attachments.component.html',
|
||||
styleUrls: ['./activiti-process-attachments.component.css'],
|
||||
providers: [
|
||||
{provide: UploadService, useClass: ProcessUploadService}
|
||||
]
|
||||
})
|
||||
|
||||
export class ActivitiProcessAttachmentsComponent implements OnInit, OnChanges {
|
||||
|
||||
@Input()
|
||||
processId: string;
|
||||
|
||||
@ViewChild(ProcessAttachmentListComponent)
|
||||
processAttachList: ProcessAttachmentListComponent;
|
||||
|
||||
fileShowed: boolean = false;
|
||||
content: Blob;
|
||||
contentName: string;
|
||||
processInstance: ProcessInstance;
|
||||
|
||||
constructor(private uploadService: UploadService, private processService: ProcessService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.uploadService.fileUploadComplete.subscribe(value => this.onFileUploadComplete(value.data));
|
||||
}
|
||||
|
||||
ngOnChanges() {
|
||||
if (this.processId) {
|
||||
this.processService.getProcess(this.processId).subscribe((processInstance: ProcessInstance) => {
|
||||
this.processInstance = processInstance;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
onFileUploadComplete(content: any) {
|
||||
this.processAttachList.add(content);
|
||||
}
|
||||
|
||||
onAttachmentClick(content: any): void {
|
||||
this.fileShowed = true;
|
||||
this.content = content.contentBlob;
|
||||
this.contentName = content.name;
|
||||
}
|
||||
|
||||
isCompletedProcess(): boolean {
|
||||
return this.processInstance && this.processInstance.ended !== undefined && this.processInstance.ended !== null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<div>
|
||||
<button md-mini-fab (click)="onClickBack()" ><md-icon>keyboard_backspace</md-icon></button>
|
||||
<adf-diagram [processInstanceId]="processDefinitionId"></adf-diagram>
|
||||
</div>
|
||||
@@ -0,0 +1,43 @@
|
||||
/*!
|
||||
* @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 { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'activiti-show-diagram',
|
||||
templateUrl: './activiti-show-diagram.component.html',
|
||||
styleUrls: ['./activiti-show-diagram.component.css']
|
||||
})
|
||||
export class ActivitiShowDiagramComponent {
|
||||
|
||||
processDefinitionId: string;
|
||||
appId: string;
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
this.route.params.subscribe(params => {
|
||||
this.processDefinitionId = params['processDefinitionId'];
|
||||
this.appId = params['appId'];
|
||||
});
|
||||
}
|
||||
|
||||
onClickBack() {
|
||||
this.router.navigate(['/activiti/apps/' + this.appId + '/processes']);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
adf-create-task-attachment ::ng-deep button {
|
||||
float: right;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<div id="attachment-task-list" *ngIf="taskId">
|
||||
<h5>Attachments</h5>
|
||||
<div class="adf-no-form-container">
|
||||
<adf-upload-drag-area
|
||||
[parentId]="taskId"
|
||||
[disabled]="isCompletedTask()"
|
||||
[showNotificationBar]="false">
|
||||
<adf-task-attachment-list #taskAttachList
|
||||
*ngIf="taskId"
|
||||
[taskId]="taskId"
|
||||
[disabled]="isCompletedTask()"
|
||||
(attachmentClick)="onAttachmentClick($event)">
|
||||
</adf-task-attachment-list>
|
||||
</adf-upload-drag-area>
|
||||
|
||||
<adf-create-task-attachment
|
||||
*ngIf="!isCompletedTask()"
|
||||
[taskId]="taskId"
|
||||
(success)="onFileUploadComplete($event)">
|
||||
</adf-create-task-attachment>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="fileShowed">
|
||||
<adf-viewer
|
||||
[(showViewer)]="fileShowed"
|
||||
[blobFile]="content"
|
||||
[displayName]="contentName"
|
||||
[overlayMode]="true">
|
||||
</adf-viewer>
|
||||
</div>
|
||||
@@ -0,0 +1,77 @@
|
||||
/*!
|
||||
* @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, Input, OnChanges, OnInit, ViewChild } from '@angular/core';
|
||||
import { ProcessUploadService, TaskAttachmentListComponent } from 'ng2-activiti-tasklist';
|
||||
import { ActivitiTaskListService } from 'ng2-activiti-tasklist';
|
||||
import { UploadService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'activiti-task-attachments',
|
||||
templateUrl: './activiti-task-attachments.component.html',
|
||||
styleUrls: ['./activiti-task-attachments.component.css'],
|
||||
providers: [
|
||||
{ provide: UploadService, useClass: ProcessUploadService }
|
||||
]
|
||||
})
|
||||
|
||||
export class ActivitiTaskAttachmentsComponent implements OnInit, OnChanges {
|
||||
|
||||
@Input()
|
||||
taskId: string;
|
||||
|
||||
@ViewChild(TaskAttachmentListComponent)
|
||||
taskAttachList: TaskAttachmentListComponent;
|
||||
|
||||
fileShowed: boolean = false;
|
||||
content: Blob;
|
||||
contentName: string;
|
||||
|
||||
taskDetails: any;
|
||||
|
||||
constructor(private uploadService: UploadService,
|
||||
private activitiTaskList: ActivitiTaskListService) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.uploadService.fileUploadComplete.subscribe(value => this.onFileUploadComplete(value.data));
|
||||
}
|
||||
|
||||
ngOnChanges() {
|
||||
if (this.taskId) {
|
||||
this.activitiTaskList.getTaskDetails(this.taskId).map((res) => res).subscribe(
|
||||
(res: any) => {
|
||||
this.taskDetails = res;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
onFileUploadComplete(content: any) {
|
||||
this.taskAttachList.add(content);
|
||||
}
|
||||
|
||||
onAttachmentClick(content: any): void {
|
||||
this.fileShowed = true;
|
||||
this.content = content.contentBlob;
|
||||
this.contentName = content.name;
|
||||
}
|
||||
|
||||
isCompletedTask(): boolean {
|
||||
return this.taskDetails && this.taskDetails.endDate !== undefined && this.taskDetails.endDate !== null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*!
|
||||
* @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 { Router } from '@angular/router';
|
||||
import { AppDefinitionRepresentationModel } from 'ng2-activiti-tasklist';
|
||||
|
||||
@Component({
|
||||
selector: 'activiti-apps-view',
|
||||
template: `
|
||||
<activiti-apps (appClick)="onAppClicked($event)"></activiti-apps>
|
||||
`
|
||||
})
|
||||
export class ActivitiAppsViewComponent {
|
||||
|
||||
constructor(private router: Router) {
|
||||
}
|
||||
|
||||
onAppClicked(app: AppDefinitionRepresentationModel) {
|
||||
this.router.navigate(['/activiti/apps', app.id || 0, 'tasks']);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*!
|
||||
* @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.
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { WidgetComponent } from 'ng2-activiti-form';
|
||||
|
||||
@Component({
|
||||
selector: 'custom-editor',
|
||||
template: `
|
||||
<div style="color: red">Look, I'm a custom editor!</div>
|
||||
`
|
||||
})
|
||||
export class CustomEditorComponent extends WidgetComponent {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'custom-stencil-01',
|
||||
template: `<div style="color: green">ADF version of custom Activiti stencil</div>`
|
||||
})
|
||||
export class CustomStencil01 extends WidgetComponent {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
declarations: [ CustomEditorComponent, CustomStencil01 ],
|
||||
exports: [ CustomEditorComponent, CustomStencil01 ],
|
||||
entryComponents: [ CustomEditorComponent, CustomStencil01 ]
|
||||
})
|
||||
export class CustomEditorsModule {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/*!
|
||||
* @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 { FormFieldModel, FormFieldTypes, FormFieldValidator } from 'ng2-activiti-form';
|
||||
|
||||
export class DemoFieldValidator implements FormFieldValidator {
|
||||
|
||||
isSupported(field: FormFieldModel): boolean {
|
||||
return field && field.type === FormFieldTypes.TEXT;
|
||||
}
|
||||
|
||||
validate(field: FormFieldModel): boolean {
|
||||
if (this.isSupported(field)) {
|
||||
if (field.value && field.value.toLowerCase() === 'admin') {
|
||||
field.validationSummary = 'Sorry, the value cannot be "admin".';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
.activiti-form-viewer {
|
||||
margin: 10px;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<div class="activiti-form-viewer" *ngIf="nodeId">
|
||||
<adf-form [nodeId]="nodeId"
|
||||
[saveMetadata]="true"
|
||||
[path]="'/Sites/swsdp/documentLibrary'">
|
||||
</adf-form>
|
||||
</div>
|
||||
@@ -0,0 +1,46 @@
|
||||
/*!
|
||||
* @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, OnDestroy, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
|
||||
@Component({
|
||||
selector: 'form-node-viewer',
|
||||
templateUrl: './form-node-viewer.component.html',
|
||||
styleUrls: ['./form-node-viewer.component.css']
|
||||
})
|
||||
export class FormNodeViewerComponent implements OnInit, OnDestroy {
|
||||
|
||||
nodeId: string;
|
||||
|
||||
private sub: Subscription;
|
||||
|
||||
constructor(private route: ActivatedRoute) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.sub = this.route.params.subscribe(params => {
|
||||
this.nodeId = params['id'];
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.sub.unsubscribe();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
.activiti-form-viewer {
|
||||
margin: 10px;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<div class="activiti-form-viewer" *ngIf="taskId">
|
||||
<adf-form [taskId]="taskId"></adf-form>
|
||||
<!--<adf-form [formName]="'activitiForms:patientFolder'"-->
|
||||
<!--[saveMetadata]="true"-->
|
||||
<!--[path]="'/Sites/swsdp/documentLibrary'"-->
|
||||
<!--[nameNode]="'test'"></adf-form>-->
|
||||
<!--<adf-form [nodeId]="'e280be3a-6584-45a1-8bb5-89bfe070262e'"-->
|
||||
<!--[saveMetadata]="true"-->
|
||||
<!--[path]="'/Sites/swsdp/documentLibrary'">-->
|
||||
<!--</adf-form>-->
|
||||
</div>
|
||||
@@ -0,0 +1,46 @@
|
||||
/*!
|
||||
* @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, OnDestroy, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
|
||||
@Component({
|
||||
selector: 'form-viewer',
|
||||
templateUrl: './form-viewer.component.html',
|
||||
styleUrls: ['./form-viewer.component.css']
|
||||
})
|
||||
export class FormViewerComponent implements OnInit, OnDestroy {
|
||||
|
||||
taskId: string;
|
||||
|
||||
private sub: Subscription;
|
||||
|
||||
constructor(private route: ActivatedRoute) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.sub = this.route.params.subscribe(params => {
|
||||
this.taskId = params['id'];
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.sub.unsubscribe();
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user