mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Increase timeout and modify login async (#4795)
* increase timeout and modify login async * run e2e if testing is changed * improve cdk fix * fix travis update projects * disable ghostMode lite server * lint fix * fix timeout * multiple try * Update content-services-e2e.sh * Update search-e2e.sh * Update process-services-e2e.sh * Update core-e2e.sh * Update protractor.conf.ts * fix unit * remove async * increqase notification time * 3 parallel * dix path issue in save * small refactor protractor ts * fix save * create license check first script adf cli * modify regex check * refactor notification history component * decrease notification * fix notification message problem * fix test * update packages wit high risk * revert cahnge login sso e2e * fix dep * fix documentation duplication and issue * fix after review * fix after review * try 6 parallel test * back to 3 parallel test no real time improve with 6
This commit is contained in:
24
lib/cli/README.md
Normal file
24
lib/cli/README.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Alfresco ADF Cli
|
||||
|
||||
|
||||
## The Goal of ADF CLI
|
||||
|
||||
The ADF CLI manages, builds , doc and test your ADF Application projects.
|
||||
|
||||
|
||||
## Installation
|
||||
To get started follow these instructions:
|
||||
|
||||
|
||||
|
||||
``sh
|
||||
npm install aadf-cli -g
|
||||
``
|
||||
|
||||
### License Check
|
||||
|
||||
Move in the folder where you have your pacakge.json and run the command:
|
||||
|
||||
```bash
|
||||
adf-license
|
||||
```
|
110
lib/cli/bin/doc/licenseList.js
Executable file
110
lib/cli/bin/doc/licenseList.js
Executable file
@@ -0,0 +1,110 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
|
||||
var checker = require('license-checker');
|
||||
var spdxCodes = require('spdx-license-list');
|
||||
var ejs = require('ejs');
|
||||
var program = require('commander');
|
||||
|
||||
var templatePath = path.resolve(__dirname, 'templates', 'licensePage.ejs');
|
||||
|
||||
const nonStandardLicenses = {
|
||||
"public domain": "PDDL-1.0",
|
||||
"apache": "Apache-2.0",
|
||||
"bsd": "BSD-2-Clause"
|
||||
};
|
||||
|
||||
const missingRepos = {
|
||||
"@alfresco/adf-testing": "https://github.com/Alfresco/alfresco-ng2-components",
|
||||
"@webassemblyjs/helper-api-error": "https://github.com/xtuc/webassemblyjs",
|
||||
"@webassemblyjs/helper-fsm": "https://github.com/xtuc/webassemblyjs",
|
||||
"@webassemblyjs/ieee754": "https://github.com/xtuc/webassemblyjs",
|
||||
"@webassemblyjs/leb128": "https://github.com/xtuc/webassemblyjs",
|
||||
"adf-tslint-rules": "https://github.com/Alfresco/alfresco-ng2-components",
|
||||
"adf-monaco-extension": "https://github.com/eromano/aca-monaco-extension",
|
||||
"indexof": "https://github.com/component/indexof",
|
||||
"rxjs-compat": "https://github.com/ReactiveX/rxjs/tree/master/compat",
|
||||
};
|
||||
|
||||
program
|
||||
.usage('<versionNumber>')
|
||||
.parse(process.argv);
|
||||
|
||||
var packageJson = JSON.parse(fs.readFileSync(path.resolve('./','package.json')), 'utf8');
|
||||
|
||||
if (!packageJson) {
|
||||
console.error('Move in the path where you have the package.json');
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(path.resolve('./','package.json'));
|
||||
|
||||
checker.init({
|
||||
start: './',
|
||||
production: true,
|
||||
failOn: 'GPL'
|
||||
}, function (err, packages) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
for (var packageName in packages) {
|
||||
var pack = packages[packageName];
|
||||
pack['licenseExp'] = pack['licenses']
|
||||
.replace(/\*/, '')
|
||||
.replace(/[a-zA-Z0-9\-\.]+/g, match => {
|
||||
var lowerMatch = match.toLowerCase();
|
||||
|
||||
if ((lowerMatch !== 'and') && (lowerMatch !== 'or') && (lowerMatch !== 'with')) {
|
||||
return licenseWithMDLinks(match);
|
||||
} else {
|
||||
return match;
|
||||
}
|
||||
});
|
||||
|
||||
if (!pack['repository']) {
|
||||
var lastAtSignPos = packageName.lastIndexOf('@');
|
||||
var mainName = packageName.substring(0, lastAtSignPos);
|
||||
|
||||
if (missingRepos[mainName]) {
|
||||
pack['repository'] = missingRepos[mainName];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ejs.renderFile(templatePath, {
|
||||
packages: packages,
|
||||
projVersion: packageJson.version,
|
||||
projName: packageJson.description
|
||||
}, {}, (err, mdText) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
fs.writeFileSync(`license-info-${packageJson.version}.md`, mdText);
|
||||
console.log(`Wrote license`);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function licenseWithMDLinks(licenseExp) {
|
||||
var licenseUrl = '';
|
||||
|
||||
if (spdxCodes[licenseExp] && spdxCodes[licenseExp]['url']) {
|
||||
licenseUrl = spdxCodes[licenseExp]['url'];
|
||||
} else {
|
||||
var substituteLicString = nonStandardLicenses[licenseExp.toLowerCase()];
|
||||
|
||||
if (spdxCodes[substituteLicString] && spdxCodes[substituteLicString]['url']) {
|
||||
licenseUrl = spdxCodes[substituteLicString]['url'];
|
||||
}
|
||||
}
|
||||
|
||||
if (licenseUrl) {
|
||||
return `[${licenseExp}](${licenseUrl})`;
|
||||
} else {
|
||||
return licenseExp;
|
||||
}
|
||||
}
|
28
lib/cli/bin/doc/templates/licensePage.ejs
vendored
Normal file
28
lib/cli/bin/doc/templates/licensePage.ejs
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
Title: License info, <%= projName %> <%= projVersion %>
|
||||
---
|
||||
|
||||
# License information for <%= projName %> <%= projVersion %>
|
||||
|
||||
This page lists all third party libraries that ADF <%= projVersion %> depends on.
|
||||
|
||||
## Libraries
|
||||
|
||||
| Name | Version | License |
|
||||
| --- | --- | --- |
|
||||
<% for (var packageName in packages) {
|
||||
var lastAtSignPos = packageName.lastIndexOf('@');
|
||||
|
||||
var name = packageName.substring(0, lastAtSignPos);
|
||||
var version = packageName.substring(lastAtSignPos + 1);
|
||||
var pack = packages[packageName];
|
||||
var licenses = pack['licenseExp'] || 'N/A';
|
||||
var repo = pack['repository'];
|
||||
var linkedName = name;
|
||||
|
||||
if (repo) {
|
||||
linkedName = `[${name}](${repo})`
|
||||
}
|
||||
-%>
|
||||
| <%= linkedName %> | <%= version %> | <%= licenses %> |
|
||||
<% } %>
|
402
lib/cli/package-lock.json
generated
Normal file
402
lib/cli/package-lock.json
generated
Normal file
@@ -0,0 +1,402 @@
|
||||
{
|
||||
"name": "@alfresco/adf-cli",
|
||||
"version": "3.2.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"abbrev": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
|
||||
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
|
||||
},
|
||||
"ansi-styles": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||
"requires": {
|
||||
"color-convert": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"array-find-index": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz",
|
||||
"integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E="
|
||||
},
|
||||
"asap": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
|
||||
"integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY="
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"chalk": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
||||
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
|
||||
"requires": {
|
||||
"ansi-styles": "^3.2.1",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
"supports-color": "^5.3.0"
|
||||
}
|
||||
},
|
||||
"color-convert": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
||||
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
|
||||
"requires": {
|
||||
"color-name": "1.1.3"
|
||||
}
|
||||
},
|
||||
"color-name": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||
},
|
||||
"debug": {
|
||||
"version": "3.2.6",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
|
||||
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
|
||||
"requires": {
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"debuglog": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz",
|
||||
"integrity": "sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI="
|
||||
},
|
||||
"dezalgo": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz",
|
||||
"integrity": "sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=",
|
||||
"requires": {
|
||||
"asap": "^2.0.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"escape-string-regexp": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
||||
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.4",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz",
|
||||
"integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.1.15",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz",
|
||||
"integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA=="
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
||||
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
|
||||
},
|
||||
"hosted-git-info": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz",
|
||||
"integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w=="
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"requires": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
|
||||
},
|
||||
"json-parse-better-errors": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
|
||||
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw=="
|
||||
},
|
||||
"license-checker": {
|
||||
"version": "25.0.1",
|
||||
"resolved": "https://registry.npmjs.org/license-checker/-/license-checker-25.0.1.tgz",
|
||||
"integrity": "sha512-mET5AIwl7MR2IAKYYoVBBpV0OnkKQ1xGj2IMMeEFIs42QAkEVjRtFZGWmQ28WeU7MP779iAgOaOy93Mn44mn6g==",
|
||||
"requires": {
|
||||
"chalk": "^2.4.1",
|
||||
"debug": "^3.1.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
"nopt": "^4.0.1",
|
||||
"read-installed": "~4.0.3",
|
||||
"semver": "^5.5.0",
|
||||
"spdx-correct": "^3.0.0",
|
||||
"spdx-expression-parse": "^3.0.0",
|
||||
"spdx-satisfies": "^4.0.0",
|
||||
"treeify": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
|
||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
|
||||
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
|
||||
},
|
||||
"nopt": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz",
|
||||
"integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=",
|
||||
"requires": {
|
||||
"abbrev": "1",
|
||||
"osenv": "^0.1.4"
|
||||
}
|
||||
},
|
||||
"normalize-package-data": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
|
||||
"integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
|
||||
"requires": {
|
||||
"hosted-git-info": "^2.1.4",
|
||||
"resolve": "^1.10.0",
|
||||
"semver": "2 || 3 || 4 || 5",
|
||||
"validate-npm-package-license": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"os-homedir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
|
||||
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M="
|
||||
},
|
||||
"os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
|
||||
},
|
||||
"osenv": {
|
||||
"version": "0.1.5",
|
||||
"resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
|
||||
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
|
||||
"requires": {
|
||||
"os-homedir": "^1.0.0",
|
||||
"os-tmpdir": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
||||
},
|
||||
"path-parse": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
|
||||
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw=="
|
||||
},
|
||||
"read-installed": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/read-installed/-/read-installed-4.0.3.tgz",
|
||||
"integrity": "sha1-/5uLZ/GH0eTCm5/rMfayI6zRkGc=",
|
||||
"requires": {
|
||||
"debuglog": "^1.0.1",
|
||||
"graceful-fs": "^4.1.2",
|
||||
"read-package-json": "^2.0.0",
|
||||
"readdir-scoped-modules": "^1.0.0",
|
||||
"semver": "2 || 3 || 4 || 5",
|
||||
"slide": "~1.1.3",
|
||||
"util-extend": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"read-package-json": {
|
||||
"version": "2.0.13",
|
||||
"resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.0.13.tgz",
|
||||
"integrity": "sha512-/1dZ7TRZvGrYqE0UAfN6qQb5GYBsNcqS1C0tNK601CFOJmtHI7NIGXwetEPU/OtoFHZL3hDxm4rolFFVE9Bnmg==",
|
||||
"requires": {
|
||||
"glob": "^7.1.1",
|
||||
"graceful-fs": "^4.1.2",
|
||||
"json-parse-better-errors": "^1.0.1",
|
||||
"normalize-package-data": "^2.0.0",
|
||||
"slash": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"readdir-scoped-modules": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz",
|
||||
"integrity": "sha1-n6+jfShr5dksuuve4DDcm19AZ0c=",
|
||||
"requires": {
|
||||
"debuglog": "^1.0.1",
|
||||
"dezalgo": "^1.0.0",
|
||||
"graceful-fs": "^4.1.2",
|
||||
"once": "^1.3.0"
|
||||
}
|
||||
},
|
||||
"resolve": {
|
||||
"version": "1.11.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz",
|
||||
"integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==",
|
||||
"requires": {
|
||||
"path-parse": "^1.0.6"
|
||||
}
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.7.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
|
||||
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA=="
|
||||
},
|
||||
"slash": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz",
|
||||
"integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU="
|
||||
},
|
||||
"slide": {
|
||||
"version": "1.1.6",
|
||||
"resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz",
|
||||
"integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc="
|
||||
},
|
||||
"spdx-compare": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/spdx-compare/-/spdx-compare-1.0.0.tgz",
|
||||
"integrity": "sha512-C1mDZOX0hnu0ep9dfmuoi03+eOdDoz2yvK79RxbcrVEG1NO1Ph35yW102DHWKN4pk80nwCgeMmSY5L25VE4D9A==",
|
||||
"requires": {
|
||||
"array-find-index": "^1.0.2",
|
||||
"spdx-expression-parse": "^3.0.0",
|
||||
"spdx-ranges": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"spdx-correct": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz",
|
||||
"integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==",
|
||||
"requires": {
|
||||
"spdx-expression-parse": "^3.0.0",
|
||||
"spdx-license-ids": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"spdx-exceptions": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz",
|
||||
"integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA=="
|
||||
},
|
||||
"spdx-expression-parse": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz",
|
||||
"integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==",
|
||||
"requires": {
|
||||
"spdx-exceptions": "^2.1.0",
|
||||
"spdx-license-ids": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"spdx-license-ids": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz",
|
||||
"integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA=="
|
||||
},
|
||||
"spdx-license-list": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/spdx-license-list/-/spdx-license-list-5.0.0.tgz",
|
||||
"integrity": "sha512-N5u9tEFRBUzQDjMKRRt8SHxC/UaqYApPmdF4MMFnICQg3z52onNbnneuro/sWw2rd+eGu9agQOzUbD671Xia7Q=="
|
||||
},
|
||||
"spdx-ranges": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/spdx-ranges/-/spdx-ranges-2.1.0.tgz",
|
||||
"integrity": "sha512-OOWghvosfmECc9edy/A9j7GabERmn8bJWHc0J1knVytQtO5Rw7VfxK6CDqmivJhfMJqWhWWUfffNNMPYvyvyQA=="
|
||||
},
|
||||
"spdx-satisfies": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/spdx-satisfies/-/spdx-satisfies-4.0.1.tgz",
|
||||
"integrity": "sha512-WVzZ/cXAzoNmjCWiEluEA3BjHp5tiUmmhn9MK+X0tBbR9sOqtC6UQwmgCNrAIZvNlMuBUYAaHYfb2oqlF9SwKA==",
|
||||
"requires": {
|
||||
"spdx-compare": "^1.0.0",
|
||||
"spdx-expression-parse": "^3.0.0",
|
||||
"spdx-ranges": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
|
||||
"requires": {
|
||||
"has-flag": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"treeify": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/treeify/-/treeify-1.1.0.tgz",
|
||||
"integrity": "sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A=="
|
||||
},
|
||||
"util-extend": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.3.tgz",
|
||||
"integrity": "sha1-p8IW0mdUUWljeztu3GypEZ4v+T8="
|
||||
},
|
||||
"validate-npm-package-license": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
|
||||
"integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
|
||||
"requires": {
|
||||
"spdx-correct": "^3.0.0",
|
||||
"spdx-expression-parse": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
}
|
||||
}
|
||||
}
|
25
lib/cli/package.json
Normal file
25
lib/cli/package.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "@alfresco/adf-cli",
|
||||
"description": "Alfresco ADF cli and utils",
|
||||
"version": "3.2.1",
|
||||
"author": "Alfresco Software, Ltd.",
|
||||
"bin": {
|
||||
"adf-license": "./bin/doc/licenseList.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Alfresco/alfresco-ng2-components.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"spdx-license-list": "^5.0.0",
|
||||
"license-checker": "^25.0.1",
|
||||
"commander": "^2.15.1"
|
||||
},
|
||||
"keywords": [
|
||||
"alfresco-component"
|
||||
],
|
||||
"license": "Apache-2.0"
|
||||
}
|
@@ -41,6 +41,7 @@ import { CommentsModule } from './comments/comments.module';
|
||||
import { ButtonsMenuModule } from './buttons-menu/buttons-menu.module';
|
||||
import { TemplateModule } from './templates/template.module';
|
||||
import { ClipboardModule } from './clipboard/clipboard.module';
|
||||
import { NotificationHistoryModule } from './notification-history/notification-history.module';
|
||||
|
||||
import { DirectiveModule } from './directives/directive.module';
|
||||
import { DialogModule } from './dialogs/dialog.module';
|
||||
@@ -87,7 +88,8 @@ import { DirectionalityConfigService } from './services/directionality-config.se
|
||||
ButtonsMenuModule,
|
||||
TemplateModule,
|
||||
IconModule,
|
||||
SortingPickerModule
|
||||
SortingPickerModule,
|
||||
NotificationHistoryModule
|
||||
],
|
||||
exports: [
|
||||
AboutModule,
|
||||
@@ -119,7 +121,8 @@ import { DirectionalityConfigService } from './services/directionality-config.se
|
||||
ButtonsMenuModule,
|
||||
TemplateModule,
|
||||
SortingPickerModule,
|
||||
IconModule
|
||||
IconModule,
|
||||
NotificationHistoryModule
|
||||
]
|
||||
})
|
||||
export class CoreModule {
|
||||
|
@@ -5,6 +5,11 @@
|
||||
"CLAIM": "CLAIM",
|
||||
"UNCLAIM": "RELEASE",
|
||||
"START PROCESS": "START PROCESS",
|
||||
"NOTIFICATION_HISTORY":{
|
||||
"NO_MESSAGE" : "No messages",
|
||||
"NOTIFICATIONS": "Notifications",
|
||||
"MARK_AS_READ": "Mark all as read"
|
||||
},
|
||||
"FORM": {
|
||||
"START_FORM": {
|
||||
"TITLE": "Start Form"
|
||||
|
@@ -41,6 +41,7 @@ export * from './directives/index';
|
||||
export * from './clipboard/index';
|
||||
export * from './dialogs/index';
|
||||
export * from './icon/index';
|
||||
export * from './notification-history/index';
|
||||
|
||||
export * from './utils/index';
|
||||
export * from './interface/index';
|
||||
|
@@ -22,7 +22,7 @@ import { MatTabChangeEvent } from '@angular/material';
|
||||
template: '<ng-template><ng-content></ng-content></ng-template>'
|
||||
})
|
||||
export class InfoDrawerTabComponent {
|
||||
/** The title of the tab. */
|
||||
/** The title of the tab (string or translation key). */
|
||||
@Input()
|
||||
label: string = '';
|
||||
|
||||
@@ -42,7 +42,7 @@ export class InfoDrawerTabComponent {
|
||||
host: { 'class': 'adf-info-drawer' }
|
||||
})
|
||||
export class InfoDrawerComponent {
|
||||
/** The title of the info drawer. */
|
||||
/** The title of the info drawer (string or translation key). */
|
||||
@Input()
|
||||
title: string|null = null;
|
||||
|
||||
|
21
lib/core/models/notification.model.ts
Normal file
21
lib/core/models/notification.model.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 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.
|
||||
*/
|
||||
|
||||
export interface NotificationModel {
|
||||
dateTime: Date;
|
||||
message: string;
|
||||
}
|
@@ -26,3 +26,4 @@ export * from './redirection.model';
|
||||
export * from './pagination.model';
|
||||
export * from './oauth-config.model';
|
||||
export * from './request-pagination.model';
|
||||
export * from './notification.model';
|
||||
|
18
lib/core/notification-history/index.ts
Normal file
18
lib/core/notification-history/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 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.
|
||||
*/
|
||||
|
||||
export * from './public-api';
|
@@ -0,0 +1,33 @@
|
||||
<div (keyup)="onKeyPress($event)">
|
||||
<button mat-button [matMenuTriggerFor]="menu" class="adf-notification-history-menu_button"
|
||||
id="adf-notification-history-open-button">
|
||||
<mat-icon>mail_outline</mat-icon>
|
||||
</button>
|
||||
<mat-menu #menu="matMenu" [xPosition]="menuPositionX" [yPosition]="menuPositionY"
|
||||
[overlapTrigger]="false" id="adf-notification-history-menu" class="adf-notification-history-menu">
|
||||
|
||||
<div id="adf-notification-history-list">
|
||||
<mat-list>
|
||||
<mat-list-item>
|
||||
<h6 mat-line>{{ 'NOTIFICATION_HISTORY.NOTIFICATIONS' | translate }}</h6>
|
||||
</mat-list-item>
|
||||
</mat-list>
|
||||
<mat-divider></mat-divider>
|
||||
|
||||
<mat-list>
|
||||
<mat-list-item *ngFor="let notification of notifications">
|
||||
<mat-icon mat-list-icon>{{notification.info? notification.info: 'info'}}</mat-icon>
|
||||
<h4 mat-line>{{notification.message}}</h4>
|
||||
<p mat-line> {{notification.dateTime | date}} </p>
|
||||
</mat-list-item>
|
||||
<mat-list-item *ngIf="isEmptyNotification()" id="adf-notification-history-component-no-message">
|
||||
<h4 mat-line>{{ 'NOTIFICATION_HISTORY.NO_MESSAGE' | translate }}</h4>
|
||||
</mat-list-item>
|
||||
<mat-action-list *ngIf="!isEmptyNotification()" id="adf-notification-history-mark-as-read">
|
||||
<button mat-list-item (click)="markAsRead()">{{ 'NOTIFICATION_HISTORY.MARK_AS_READ' | translate }}
|
||||
</button>
|
||||
</mat-action-list>
|
||||
</mat-list>
|
||||
</div>
|
||||
</mat-menu>
|
||||
</div>
|
@@ -0,0 +1,23 @@
|
||||
.adf {
|
||||
|
||||
&-notification-history-menu_button.mat-button {
|
||||
margin-right: 0;
|
||||
border-radius: 90%;
|
||||
padding: 0;
|
||||
min-width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-device-width: 480px) {
|
||||
.mat-menu-panel.adf-notification-history-menu {
|
||||
max-height: 450px;
|
||||
min-width: 450px;
|
||||
overflow: auto;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.mat-menu-panel.adf-notification-history-menu .mat-menu-content {
|
||||
padding: 0;
|
||||
}
|
@@ -0,0 +1,80 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 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 { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
|
||||
import { NotificationService } from '../services';
|
||||
import { setupTestBed } from '../testing/setupTestBed';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { NotificationHistoryComponent } from './notification-history.component';
|
||||
import { OverlayContainer } from '@angular/cdk/overlay';
|
||||
|
||||
describe('Notification History Component', () => {
|
||||
|
||||
let fixture: ComponentFixture<NotificationHistoryComponent>;
|
||||
let element: HTMLElement;
|
||||
let notificationService: NotificationService;
|
||||
let overlayContainerElement: HTMLElement;
|
||||
|
||||
function openNotification() {
|
||||
fixture.detectChanges();
|
||||
const button: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#adf-notification-history-open-button');
|
||||
button.click();
|
||||
fixture.detectChanges();
|
||||
}
|
||||
|
||||
setupTestBed({
|
||||
imports: [CoreTestingModule]
|
||||
});
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(NotificationHistoryComponent);
|
||||
element = fixture.nativeElement;
|
||||
|
||||
notificationService = TestBed.get(NotificationService);
|
||||
}));
|
||||
|
||||
beforeEach(inject([OverlayContainer], (oc: OverlayContainer) => {
|
||||
overlayContainerElement = oc.getContainerElement();
|
||||
}));
|
||||
|
||||
afterEach(() => {
|
||||
fixture.destroy();
|
||||
});
|
||||
|
||||
describe('ui ', () => {
|
||||
|
||||
it('should empty message be present when there are no notifications in the history', (done) => {
|
||||
openNotification();
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(overlayContainerElement.querySelector('#adf-notification-history-component-no-message')).toBeDefined();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should message be present and empty message not be present when there are notifications in the history', (done) => {
|
||||
notificationService.showInfo('Example Message');
|
||||
openNotification();
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(overlayContainerElement.querySelector('#adf-notification-history-component-no-message')).toBeNull();
|
||||
expect(overlayContainerElement.querySelector('#adf-notification-history-list').innerHTML).toContain('Example Message');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@@ -0,0 +1,78 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 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, ViewChild, OnDestroy } from '@angular/core';
|
||||
import { NotificationService } from '../services/notification.service';
|
||||
import { NotificationModel } from '../models/notification.model';
|
||||
import { MatMenuTrigger } from '@angular/material';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-notification-history',
|
||||
styleUrls: ['notification-history.component.scss'],
|
||||
templateUrl: 'notification-history.component.html'
|
||||
})
|
||||
export class NotificationHistoryComponent implements OnDestroy {
|
||||
|
||||
onDestroy$ = new Subject<boolean>();
|
||||
|
||||
notifications: NotificationModel[] = [];
|
||||
|
||||
@ViewChild(MatMenuTrigger)
|
||||
trigger: MatMenuTrigger;
|
||||
|
||||
/** Custom choice for opening the menu at the bottom. Can be `before` or `after`. */
|
||||
@Input()
|
||||
menuPositionX: string = 'after';
|
||||
|
||||
/** Custom choice for opening the menu at the bottom. Can be `above` or `below`. */
|
||||
@Input()
|
||||
menuPositionY: string = 'below';
|
||||
|
||||
constructor(
|
||||
private notificationService: NotificationService) {
|
||||
this.notificationService.messages
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe((message) => {
|
||||
this.notifications.push(message);
|
||||
});
|
||||
}
|
||||
|
||||
isEmptyNotification(): boolean {
|
||||
return (!this.notifications || this.notifications.length === 0);
|
||||
}
|
||||
|
||||
onKeyPress(event: KeyboardEvent) {
|
||||
this.closeUserModal(event);
|
||||
}
|
||||
|
||||
markAsRead() {
|
||||
this.notifications = [];
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.onDestroy$.next(true);
|
||||
this.onDestroy$.complete();
|
||||
}
|
||||
|
||||
private closeUserModal($event: KeyboardEvent) {
|
||||
if ($event.keyCode === 27) {
|
||||
this.trigger.closeMenu();
|
||||
}
|
||||
}
|
||||
}
|
38
lib/core/notification-history/notification-history.module.ts
Normal file
38
lib/core/notification-history/notification-history.module.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 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 { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { MaterialModule } from '../material.module';
|
||||
|
||||
import { NotificationHistoryComponent } from './notification-history.component';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
MaterialModule,
|
||||
TranslateModule.forChild()
|
||||
],
|
||||
declarations: [
|
||||
NotificationHistoryComponent
|
||||
],
|
||||
exports: [
|
||||
NotificationHistoryComponent
|
||||
]
|
||||
})
|
||||
export class NotificationHistoryModule {}
|
19
lib/core/notification-history/public-api.ts
Normal file
19
lib/core/notification-history/public-api.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 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.
|
||||
*/
|
||||
|
||||
export * from './notification-history.component';
|
||||
export * from './notification-history.module';
|
@@ -19,6 +19,8 @@ import { Injectable } from '@angular/core';
|
||||
import { MatSnackBar, MatSnackBarRef, MatSnackBarConfig } from '@angular/material';
|
||||
import { TranslationService } from './translation.service';
|
||||
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
|
||||
import { Subject } from 'rxjs';
|
||||
import { NotificationModel } from '../models/notification.model';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -27,6 +29,8 @@ export class NotificationService {
|
||||
|
||||
DEFAULT_DURATION_MESSAGE: number = 5000;
|
||||
|
||||
messages: Subject<NotificationModel> = new Subject();
|
||||
|
||||
constructor(private snackBar: MatSnackBar,
|
||||
private translationService: TranslationService,
|
||||
private appConfigService: AppConfigService) {
|
||||
@@ -53,6 +57,8 @@ export class NotificationService {
|
||||
};
|
||||
}
|
||||
|
||||
this.messages.next({ message: translatedMessage, dateTime: new Date });
|
||||
|
||||
return this.snackBar.open(translatedMessage, null, config);
|
||||
}
|
||||
|
||||
@@ -76,6 +82,8 @@ export class NotificationService {
|
||||
};
|
||||
}
|
||||
|
||||
this.messages.next({ message: translatedMessage, dateTime: new Date });
|
||||
|
||||
return this.snackBar.open(translatedMessage, action, config);
|
||||
}
|
||||
|
||||
@@ -89,6 +97,8 @@ export class NotificationService {
|
||||
protected showMessage(message: string, panelClass: string, action?: string): MatSnackBarRef<any> {
|
||||
message = this.translationService.instant(message);
|
||||
|
||||
this.messages.next({ message: message, dateTime: new Date });
|
||||
|
||||
return this.snackBar.open(message, action, {
|
||||
duration: this.DEFAULT_DURATION_MESSAGE,
|
||||
panelClass
|
||||
|
@@ -183,7 +183,6 @@
|
||||
@media only screen and (min-device-width: 480px) {
|
||||
.mat-menu-panel.adf-userinfo-menu {
|
||||
max-height: 450px;
|
||||
min-width: 4500px;
|
||||
min-width: 450px;
|
||||
overflow: auto;
|
||||
padding: 0;
|
||||
|
@@ -83,10 +83,12 @@ export class PeopleComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
involveUser(user: UserProcessModel) {
|
||||
this.peopleProcessService.involveUserWithTask(this.taskId, user.id.toString())
|
||||
.subscribe(() => {
|
||||
this.people = [...this.people, user];
|
||||
}, (error) => this.logService.error('Impossible to involve user with task'));
|
||||
if (user && user.id) {
|
||||
this.peopleProcessService.involveUserWithTask(this.taskId, user.id.toString())
|
||||
.subscribe(() => {
|
||||
this.people = [...this.people, user];
|
||||
}, (error) => this.logService.error('Impossible to involve user with task'));
|
||||
}
|
||||
}
|
||||
|
||||
removeInvolvedUser(user: UserProcessModel) {
|
||||
|
@@ -339,13 +339,7 @@ export class DataTableComponentPage {
|
||||
}
|
||||
|
||||
clickColumn(columnName, columnValue) {
|
||||
const column = this.getCellElementByValue(columnName, columnValue);
|
||||
this.clickElement(column);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickElement(elem) {
|
||||
BrowserActions.click(elem);
|
||||
BrowserActions.clickExecuteScript(`div[title="${columnName}"] div[data-automation-id="text_${columnValue}"] span`);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@@ -75,17 +75,15 @@ export class LoginPage {
|
||||
)
|
||||
);
|
||||
|
||||
async goToLoginPage() {
|
||||
goToLoginPage() {
|
||||
browser.waitForAngularEnabled(true);
|
||||
browser.driver.get(this.loginURL);
|
||||
this.waitForElements();
|
||||
return this;
|
||||
return this.waitForElements();
|
||||
}
|
||||
|
||||
waitForElements() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.txtUsername);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.txtPassword);
|
||||
return this;
|
||||
return BrowserVisibility.waitUntilElementIsVisible(this.txtPassword);
|
||||
}
|
||||
|
||||
enterUsername(username) {
|
||||
@@ -165,7 +163,7 @@ export class LoginPage {
|
||||
}
|
||||
|
||||
async loginToAllUsingUserModel(userModel) {
|
||||
this.goToLoginPage();
|
||||
await this.goToLoginPage();
|
||||
await LocalStorageUtil.clearStorage();
|
||||
await LocalStorageUtil.setStorageItem('providers', 'ALL');
|
||||
await LocalStorageUtil.apiReset();
|
||||
@@ -173,7 +171,7 @@ export class LoginPage {
|
||||
}
|
||||
|
||||
async loginToProcessServicesUsingUserModel(userModel) {
|
||||
this.goToLoginPage();
|
||||
await this.goToLoginPage();
|
||||
await LocalStorageUtil.clearStorage();
|
||||
await LocalStorageUtil.setStorageItem('providers', 'BPM');
|
||||
await LocalStorageUtil.apiReset();
|
||||
|
52
lib/testing/src/lib/core/pages/notification-history.page.ts
Normal file
52
lib/testing/src/lib/core/pages/notification-history.page.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 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 { by, element } from 'protractor';
|
||||
import { BrowserActions } from '../utils/browser-actions';
|
||||
|
||||
export class NotificationHistoryPage {
|
||||
|
||||
notificationList = element(by.css('#adf-notification-history-list'));
|
||||
|
||||
clickNotificationButton() {
|
||||
BrowserActions.clickExecuteScript('#adf-notification-history-open-button');
|
||||
}
|
||||
|
||||
clickMarkAsRead() {
|
||||
BrowserActions.click(element(by.css('#adf-notification-history-mark-as-read')));
|
||||
}
|
||||
|
||||
checkNotificationIsPresent(text: string) {
|
||||
expect(BrowserActions.getText(this.notificationList)).toContain(text);
|
||||
}
|
||||
|
||||
checkNotificationIsNotPresent(text: string) {
|
||||
expect(BrowserActions.getText(this.notificationList)).not.toContain(text);
|
||||
}
|
||||
|
||||
checkNotifyContains(text: string) {
|
||||
this.clickNotificationButton();
|
||||
this.checkNotificationIsPresent(text);
|
||||
this.clickMarkAsRead();
|
||||
}
|
||||
|
||||
checkNotifyNotContains(text: string) {
|
||||
this.clickNotificationButton();
|
||||
this.checkNotificationIsNotPresent(text);
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
}
|
||||
}
|
@@ -25,5 +25,5 @@ export * from './data-table-component.page';
|
||||
export * from './pagination.page';
|
||||
export * from './error.page';
|
||||
export * from './login.page';
|
||||
|
||||
export * from './notification-history.page';
|
||||
export * from './form/public-api';
|
||||
|
59
lib/tsconfig.doc.json
Normal file
59
lib/tsconfig.doc.json
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"sourceMap": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"skipLibCheck": false,
|
||||
"noLib": false,
|
||||
"allowUnreachableCode": false,
|
||||
"allowUnusedLabels": false,
|
||||
"noImplicitAny": false,
|
||||
"noImplicitReturns": false,
|
||||
"noImplicitUseStrict": false,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"removeComments": true,
|
||||
"declaration": true,
|
||||
"outDir": "./dist",
|
||||
"baseUrl" : "./",
|
||||
"types": ["jasmine"],
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"paths": {
|
||||
"@alfresco/adf-process-services-cloud": ["./process-services-cloud/"],
|
||||
"@alfresco/adf-testing": ["./testing/"],
|
||||
"@alfresco/adf-process-services": ["./process-services/"],
|
||||
"@alfresco/adf-content-services": ["./content-services/"],
|
||||
"@alfresco/adf-extensions": ["./extensions/"],
|
||||
"@alfresco/adf-core": ["./core/"],
|
||||
"@alfresco/adf-insights": ["./analytics"]
|
||||
},
|
||||
"lib": [
|
||||
"es2016",
|
||||
"dom"
|
||||
],
|
||||
"suppressImplicitAnyIndexErrors": true,
|
||||
"noUnusedLocals": true
|
||||
},
|
||||
"exclude": [
|
||||
"testing",
|
||||
"*/node_modules",
|
||||
"*/demo",
|
||||
"config",
|
||||
"*/coverage",
|
||||
"node_modules",
|
||||
"*/dist",
|
||||
"dist"
|
||||
],
|
||||
"angularCompilerOptions": {
|
||||
"strictMetadataEmit": false,
|
||||
"skipTemplateCodegen": true,
|
||||
"preserveWhitespaces": false
|
||||
},
|
||||
"typedocOptions": {
|
||||
"json": "docs/docs.json",
|
||||
"exclude": ["**/*.spec.ts", "node_modules"],
|
||||
"ignoreCompilerErrors": true
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user