@zohodesk/testinglibrary 0.1.8-eslint-6 → 0.1.8-eslint-7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/eslint-ci/{pipelineLintStage.js → eslintLintStage.js} +55 -9
- package/build/eslint-ci/reportServerConfig.js +39 -0
- package/build/eslint-ci/{eslint_serverReport.js → startSever-sonarQube.js} +11 -12
- package/build/lib/cli.js +4 -5
- package/lintjson.json +103 -99
- package/main.js +14 -5
- package/package.json +1 -1
- /package/build/eslint-ci/{sonar-scanner-cli-4.8.0.2856.jar → java-jar/sonar-scanner-cli-4.8.0.2856.jar} +0 -0
- /package/build/eslint-ci/{startAnalysis.py → java-jar/startAnalysis.py} +0 -0
|
@@ -11,6 +11,7 @@ var _child_process = require("child_process");
|
|
|
11
11
|
var _path = _interopRequireDefault(require("path"));
|
|
12
12
|
var _logger = require("../utils/logger");
|
|
13
13
|
var _cliArgsToObject = require("../utils/cliArgsToObject");
|
|
14
|
+
var _fs = require("fs");
|
|
14
15
|
// function gitDiffFiles() {
|
|
15
16
|
// const childProcess = spawnSync('git', [
|
|
16
17
|
// 'diff',
|
|
@@ -42,34 +43,79 @@ function runEslintForDiff(cliParams, options = {}) {
|
|
|
42
43
|
} = (0, _cliArgsToObject.cliArgsToObject)(cliParams);
|
|
43
44
|
const format = 'json';
|
|
44
45
|
const reportPath = _path.default.resolve(process.cwd(), 'uat', 'eslint-report', 'lintReport.json');
|
|
45
|
-
const diffJSON = require(diffPath);
|
|
46
|
+
const diffJSON = require(_path.default.resolve(diffPath));
|
|
47
|
+
const filteredDiffFiles = getDiffFiles(diffJSON);
|
|
48
|
+
const lintFiles = filteredDiffFiles.length === 0 ? [_path.default.resolve(process.cwd(), 'uat', 'modules')] : filteredDiffFiles;
|
|
46
49
|
return new Promise(resolve => {
|
|
47
|
-
(0, _child_process.exec)(`npx eslint ${
|
|
50
|
+
(0, _child_process.exec)(`npx eslint ${lintFiles.join(' ')} --format=${format} -o ${reportPath}`, (stdout, stderr) => {
|
|
48
51
|
_logger.Logger.log(_logger.Logger.FAILURE_TYPE, stderr);
|
|
49
52
|
resolve(stdout);
|
|
50
53
|
});
|
|
54
|
+
}).then(response => {
|
|
55
|
+
(0, _fs.writeFileSync)(reportPath, filterReport_JSON(require(reportPath), diffJSON));
|
|
51
56
|
});
|
|
52
57
|
}
|
|
58
|
+
function filterReport_JSON(resultJson, diffJson) {
|
|
59
|
+
const impactLineArray = filterDiffJson(diffJson);
|
|
60
|
+
resultJson = resultJson.filter(result => {
|
|
61
|
+
var _impactLineArray$get;
|
|
62
|
+
if (((_impactLineArray$get = impactLineArray.get(getPathFromTestDir(result.filePath))) === null || _impactLineArray$get === void 0 ? void 0 : _impactLineArray$get.length) !== 0) {
|
|
63
|
+
result.messages = result.messages.filter(errorMsg => {
|
|
64
|
+
if (impactLineArray.get(getPathFromTestDir(result.filePath)).includes(errorMsg.line)) {
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
return false;
|
|
68
|
+
});
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
});
|
|
73
|
+
return JSON.stringify(resultJson);
|
|
74
|
+
}
|
|
53
75
|
function getImpactsLine() {
|
|
54
76
|
const diffJson = _path.default.resolve(process.cwd(), 'diffContents.json');
|
|
55
77
|
return filterDiffJson(diffJson);
|
|
56
78
|
}
|
|
57
79
|
function filterDiffJson(diffJson) {
|
|
58
80
|
var _diffJson$diffs;
|
|
59
|
-
|
|
81
|
+
const diffFilesMap = new Map();
|
|
60
82
|
diffJson === null || diffJson === void 0 || (_diffJson$diffs = diffJson.diffs) === null || _diffJson$diffs === void 0 || _diffJson$diffs.forEach(diff => {
|
|
61
83
|
const diffMatch = [];
|
|
62
84
|
const regex = /@@(.*?)@@/g;
|
|
63
85
|
let match;
|
|
64
86
|
while ((match = regex.exec(diff.diff)) !== null) {
|
|
65
|
-
diffMatch.push(match[1]);
|
|
87
|
+
diffMatch.push(...splitFilterNumber(match[1]));
|
|
66
88
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
89
|
+
const diffPathKey = getPathFromTestDir(diff.new_path);
|
|
90
|
+
if (diffPathKey) {
|
|
91
|
+
diffFilesMap.set(diffPathKey, diffMatch);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return diffFilesMap;
|
|
95
|
+
}
|
|
96
|
+
function getPathFromTestDir(diffPath) {
|
|
97
|
+
if (!(diffPath !== null && diffPath !== void 0 && diffPath.contains('uat'))) {
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
const indexOfDiff = diffPath.split('/').indexOf('uat');
|
|
101
|
+
const diffActualPath = diffPath.slice(indexOfDiff).join('/');
|
|
102
|
+
return diffActualPath;
|
|
103
|
+
}
|
|
104
|
+
function splitFilterNumber(numberString) {
|
|
105
|
+
var resultedNum = [];
|
|
106
|
+
numberString.split(' ').join(',').split(',').filter(element => {
|
|
107
|
+
if (element.startsWith('-')) {
|
|
108
|
+
resultedNum.push(element.replace('-', ' ').trim());
|
|
109
|
+
// return element.replace('-', ' ').trim();
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
if (element.startsWith('+')) {
|
|
113
|
+
resultedNum.push(element.replace('+', ' ').trim());
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
return false;
|
|
71
117
|
});
|
|
72
|
-
return
|
|
118
|
+
return resultedNum;
|
|
73
119
|
}
|
|
74
120
|
function getDiffFiles(diffJson) {
|
|
75
121
|
return diffJson === null || diffJson === void 0 ? void 0 : diffJson.diffs.map(diff => {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getDefaultServerProperties = getDefaultServerProperties;
|
|
8
|
+
exports.getProperties = getProperties;
|
|
9
|
+
var _path = _interopRequireDefault(require("path"));
|
|
10
|
+
var _cliArgsToObject = require("../utils/cliArgsToObject");
|
|
11
|
+
function getDefaultServerProperties() {
|
|
12
|
+
return {
|
|
13
|
+
'sonar.projectName': 'UAT_Testing',
|
|
14
|
+
'sonar..login': "developer",
|
|
15
|
+
'sonar.password': "developer",
|
|
16
|
+
'sonar.sources': '',
|
|
17
|
+
'sonar.tests': `${_path.default.resolve(process.cwd(), 'uat', 'modules')}`,
|
|
18
|
+
'sonar.language': 'js',
|
|
19
|
+
'sonar.eslint.reportPaths': `${_path.default.resolve(process.cwd(), 'uat', 'eslint-report', 'lintReport.json')}`,
|
|
20
|
+
'sonar.working.directory': `${_path.default.resolve(process.cwd(), 'uat', 'modules', '.scannerwork')}`
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function getProperties(cliParams, login, password, sources, testDir, language, eslintReportPath, serverArtifactsDir) {
|
|
24
|
+
const {
|
|
25
|
+
repo,
|
|
26
|
+
branch,
|
|
27
|
+
username
|
|
28
|
+
} = (0, _cliArgsToObject.cliArgsToObject)(cliParams);
|
|
29
|
+
return {
|
|
30
|
+
'sonar.projectName': `${repo}_${branch}_${username}`,
|
|
31
|
+
'sonar.login': login,
|
|
32
|
+
'sonar.password': password,
|
|
33
|
+
'sonar.sources': sources,
|
|
34
|
+
'sonar.tests': testDir,
|
|
35
|
+
'sonar.language': language,
|
|
36
|
+
'sonar.eslint.reportPaths': eslintReportPath,
|
|
37
|
+
'sonar.working.directory': serverArtifactsDir
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -8,22 +8,21 @@ exports.sonarQubeIntegrateAnalysis = sonarQubeIntegrateAnalysis;
|
|
|
8
8
|
var _sonarqubeScanner = _interopRequireDefault(require("sonarqube-scanner"));
|
|
9
9
|
var _readConfigFile = require("../core/playwright/readConfigFile");
|
|
10
10
|
var _path = _interopRequireDefault(require("path"));
|
|
11
|
-
var
|
|
11
|
+
var _reportServerConfig = require("./reportServerConfig");
|
|
12
12
|
// Js script to start sonar Server
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* cli cmd :
|
|
16
|
+
* npx ZDTestingFramework lint -- --lintEnv=ci --diffPath="" --repo="deskClientApp" --branch="" --username=""
|
|
17
|
+
*/
|
|
18
|
+
|
|
14
19
|
const postCallBack = () => process.exit();
|
|
15
20
|
const serverHostUrl = 'https://serverlinter-np.zohodesk.csez.zohocorpin.com';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
'
|
|
20
|
-
|
|
21
|
-
'sonar.tests': `${_path.default.resolve(process.cwd(), 'uat', 'modules')}`,
|
|
22
|
-
'sonar.language': 'js',
|
|
23
|
-
'sonar.eslint.reportPaths': `${_path.default.resolve(process.cwd(), 'uat', 'eslint-report', 'lintReport.json')}`,
|
|
24
|
-
'sonar.working.directory': `${_path.default.resolve(process.cwd(), 'uat', 'modules', '.scannerwork')}`
|
|
25
|
-
};
|
|
26
|
-
function sonarQubeIntegrateAnalysis() {
|
|
21
|
+
function sonarQubeIntegrateAnalysis(cliParams, option) {
|
|
22
|
+
const testDir = _path.default.resolve(process.cwd(), 'uat', 'modules');
|
|
23
|
+
const eslintResult = _path.default.resolve(process.cwd(), 'uat', 'eslint-report', 'lintReport.json');
|
|
24
|
+
const artifactsPath = _path.default.resolve(process.cwd(), 'uat', '.scannerwork');
|
|
25
|
+
const options = (0, _reportServerConfig.getProperties)(cliParams, "developer", "developer", "", testDir, 'js', eslintResult, artifactsPath);
|
|
27
26
|
(0, _sonarqubeScanner.default)({
|
|
28
27
|
serverUrl: serverHostUrl,
|
|
29
28
|
options: options
|
package/build/lib/cli.js
CHANGED
|
@@ -9,11 +9,10 @@ var _setupProject = _interopRequireDefault(require("../setup-folder-structure/se
|
|
|
9
9
|
var _parser = require("../parser/parser");
|
|
10
10
|
var _clearCaches = _interopRequireDefault(require("../core/playwright/clear-caches"));
|
|
11
11
|
var _helper = _interopRequireDefault(require("../setup-folder-structure/helper"));
|
|
12
|
-
var
|
|
13
|
-
var
|
|
12
|
+
var _eslintLintStage = require("../eslint-ci/eslintLintStage");
|
|
13
|
+
var _startSeverSonarQube = require("../eslint-ci/startSever-sonarQube");
|
|
14
14
|
// import createJestRunner from '../core/jest/runner/jest-runner';
|
|
15
15
|
|
|
16
|
-
_pipelineLintStage.runEslintForDiff;
|
|
17
16
|
const [,, option, ...otherOptions] = process.argv;
|
|
18
17
|
// const args = process.argv.slice(3);
|
|
19
18
|
// const appPath = process.cwd();
|
|
@@ -60,8 +59,8 @@ switch (option) {
|
|
|
60
59
|
case 'lint-ci':
|
|
61
60
|
{
|
|
62
61
|
_logger.Logger.log(_logger.Logger.SUCCESS_TYPE, 'Linting Started ...');
|
|
63
|
-
(0,
|
|
64
|
-
(0,
|
|
62
|
+
(0, _eslintLintStage.runEslintForDiff)(otherOptions).then(result => {
|
|
63
|
+
(0, _startSeverSonarQube.sonarQubeIntegrateAnalysis)(otherOptions);
|
|
65
64
|
});
|
|
66
65
|
break;
|
|
67
66
|
}
|
package/lintjson.json
CHANGED
|
@@ -1,101 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"filePath": "/Users/raja-17710/deskApp/desk_client_app/jsapps/supportapp/uat/modules/Setup/page-object-model/SetupHomePage.js",
|
|
4
|
+
"messages": [
|
|
5
|
+
{
|
|
6
|
+
"ruleId": "playwright/no-raw-locators",
|
|
7
|
+
"severity": 1,
|
|
8
|
+
"message": "Usage of raw locator detected. Use methods like .getByRole() or .getByText() instead of raw locators.",
|
|
9
|
+
"line": 18,
|
|
10
|
+
"column": 21,
|
|
11
|
+
"nodeType": "CallExpression",
|
|
12
|
+
"messageId": "noRawLocator",
|
|
13
|
+
"endLine": 18,
|
|
14
|
+
"endColumn": 76
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"ruleId": "playwright/no-raw-locators",
|
|
18
|
+
"severity": 1,
|
|
19
|
+
"message": "Usage of raw locator detected. Use methods like .getByRole() or .getByText() instead of raw locators.",
|
|
20
|
+
"line": 31,
|
|
21
|
+
"column": 18,
|
|
22
|
+
"nodeType": "CallExpression",
|
|
23
|
+
"messageId": "noRawLocator",
|
|
24
|
+
"endLine": 31,
|
|
25
|
+
"endColumn": 52
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"ruleId": "playwright/no-raw-locators",
|
|
29
|
+
"severity": 1,
|
|
30
|
+
"message": "Usage of raw locator detected. Use methods like .getByRole() or .getByText() instead of raw locators.",
|
|
31
|
+
"line": 35,
|
|
32
|
+
"column": 12,
|
|
33
|
+
"nodeType": "CallExpression",
|
|
34
|
+
"messageId": "noRawLocator",
|
|
35
|
+
"endLine": 35,
|
|
36
|
+
"endColumn": 65
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"ruleId": "playwright/no-raw-locators",
|
|
40
|
+
"severity": 1,
|
|
41
|
+
"message": "Usage of raw locator detected. Use methods like .getByRole() or .getByText() instead of raw locators.",
|
|
42
|
+
"line": 52,
|
|
43
|
+
"column": 11,
|
|
44
|
+
"nodeType": "CallExpression",
|
|
45
|
+
"messageId": "noRawLocator",
|
|
46
|
+
"endLine": 52,
|
|
47
|
+
"endColumn": 40
|
|
48
|
+
}
|
|
9
49
|
],
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
50
|
+
"errorCount": 0,
|
|
51
|
+
"fatalErrorCount": 0,
|
|
52
|
+
"warningCount": 4,
|
|
53
|
+
"fixableErrorCount": 0,
|
|
54
|
+
"fixableWarningCount": 0,
|
|
55
|
+
"source": "import { expect } from '@zohodesk/testinglibrary';\nimport {\n SETUP_HOME_PAGE_SELECTORS,\n SETUP_MENUPANEL_SELECTORS,\n getSetupModuleSelector,\n hiddenModuleName\n} from '../dom-selectors/SetupSelectors';\n\nconst moduleConst = {\n HELP_CENTER: 'HelpCenter',\n DEFALUT_LANDING_PAGE: 'Email'\n};\n\nclass SetupHomePage {\n constructor(page) {\n this.page = page;\n this.defaultMenu = moduleConst.DEFALUT_LANDING_PAGE;\n this.homePage = page.locator(SETUP_HOME_PAGE_SELECTORS.SETUP_HOME_PAGE);\n }\n\n getHomePageSearchInput() {\n return this.homePage.getByPlaceholder(\n SETUP_MENUPANEL_SELECTORS.MENU_PANEL_SEARCH_PLACE_HOLDER\n );\n }\n\n async visitSetupHomePage() {\n const { SETUP_ICON_LABEL, SETUP_HOME_PAGE } = SETUP_HOME_PAGE_SELECTORS;\n await this.page.goto(process.env.domain);\n await this.page.getByLabel(SETUP_ICON_LABEL).click();\n await expect(this.page.locator(SETUP_HOME_PAGE)).toBeVisible();\n }\n\n getModule(moduleName) {\n return this.page.locator(getSetupModuleSelector(moduleName));\n }\n\n async selectModule(moduleTobeSelected = this.defaultMenu) {\n await this.homePage.getByRole('link', { name: moduleTobeSelected }).click();\n }\n\n async searchHomePage(inputText) {\n await this.getHomePageSearchInput().fill(inputText);\n }\n\n async hoverModule(module) {\n await this.homePage.getByText(module).hover();\n }\n\n async getandAccessHiddenElement(module) {\n const moduleName = hiddenModuleName(module);\n await this.page.locator(moduleName).click();\n }\n\n async clickHighlightedMenu(menuName) {\n await this.page\n .getByRole('listitem')\n .filter({ hasText: menuName })\n .first()\n .click();\n }\n}\n\nexport default SetupHomePage;\n",
|
|
56
|
+
"usedDeprecatedRules": [
|
|
57
|
+
{
|
|
58
|
+
"ruleId": "lines-around-directive",
|
|
59
|
+
"replacedBy": ["padding-line-between-statements"]
|
|
60
|
+
},
|
|
61
|
+
{ "ruleId": "global-require", "replacedBy": [] },
|
|
62
|
+
{ "ruleId": "no-buffer-constructor", "replacedBy": [] },
|
|
63
|
+
{ "ruleId": "no-new-require", "replacedBy": [] },
|
|
64
|
+
{ "ruleId": "no-path-concat", "replacedBy": [] }
|
|
65
|
+
]
|
|
20
66
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"created_at": "2024-02-16T15:40:17.000+05:30",
|
|
61
|
-
"parent_ids": [
|
|
62
|
-
"2817165513e7f8dcfb0d99fc3fa38bc28e4da123",
|
|
63
|
-
"0f657a0901f57ead811f593125ba25b729cb0922"
|
|
64
|
-
],
|
|
65
|
-
"title": "Merge branch 'release' into 'AK_Integration_Bugfix_Branch'",
|
|
66
|
-
"message": "Merge branch 'release' into 'AK_Integration_Bugfix_Branch'\n\nBPM AutoMerge from release to AK_Integration_Bugfix_Branch\n\nSee merge request zohodesk/zohodesk!43723",
|
|
67
|
-
"author_name": "senthamil",
|
|
68
|
-
"author_email": "senthamil@zohocorp.com",
|
|
69
|
-
"authored_date": "2024-02-16T15:40:17.000+05:30",
|
|
70
|
-
"committer_name": "senthamil",
|
|
71
|
-
"committer_email": "senthamil@zohocorp.com",
|
|
72
|
-
"committed_date": "2024-02-16T15:40:17.000+05:30",
|
|
73
|
-
"trailers": {},
|
|
74
|
-
"web_url": "https://zgit.csez.zohocorpin.com/zohodesk/zohodesk/-/commit/d5aeaa7b1b52fad9ab1eb02a5a4dd0a5081e21c7"
|
|
75
|
-
}
|
|
76
|
-
],
|
|
77
|
-
"diffs": [
|
|
78
|
-
{
|
|
79
|
-
"old_path": "source/com/adventnet/support/bugs/util/BugIntegUtil.java",
|
|
80
|
-
"new_path": "source/com/adventnet/support/bugs/util/BugIntegUtil.java",
|
|
81
|
-
"a_mode": "100644",
|
|
82
|
-
"b_mode": "100644",
|
|
83
|
-
"new_file": false,
|
|
84
|
-
"renamed_file": false,
|
|
85
|
-
"deleted_file": false,
|
|
86
|
-
"diff": "@@ -78,6 +78,7 @@ import com.adventnet.support.integ.common.IntegConfigUtil;\n import com.adventnet.support.integ.common.IntegConfigUtil.IntegrationTypes;\n import com.adventnet.support.integ.common.IntegInfo;\n import com.adventnet.support.integ.common.IntegUtil;\n+import com.adventnet.support.integ.common.IntegrationModulePermissionsHandler;\n import com.adventnet.support.integ.common.IntegrationConstants.IntegType;\n import com.adventnet.support.integ.feed.util.AcsUtil;\n import com.adventnet.support.integ.feed.util.FeedConstants;\n@@ -408,6 +409,10 @@ public class BugIntegUtil\n \t\t\t{\n \t\t\t\treturn \"{\\\"error\\\":\\\"Insufficient Previlleges to perform this operation.\\\"}\";\n \t\t\t}\n+\t\t\tIntegrationModulePermissionsHandler permissionHandler = new IntegrationModulePermissionsHandler(userId, caseId);\n+\t\t\tif(!permissionHandler.getIsTicketUpdatable()) {\n+\t\t\t\tthrow new AuthorizationException(AuthorizedRequestAPIImpl.NOT_ALLOWED_MESSAGE);\n+\t\t\t}\n \t\t\tRequest request = Support.getRequestAPI().get(caseId);\n \t\t\tString caseNumber =request.requestNumber();\n \t\t\tHashMap<String,Object> params = new HashMap<String,Object>();\n@@ -750,6 +755,10 @@ public class BugIntegUtil\n \t\t\t{\n \t\t\t\treturn bugRespJson.put(\"message\",\"Insufficient Previlleges to perform this operation.\");\n \t\t\t}\n+\t\t\tIntegrationModulePermissionsHandler permissionHandler = new IntegrationModulePermissionsHandler(userId, caseId);\n+\t\t\tif(!permissionHandler.getIsTicketUpdatable()) {\n+\t\t\t\tthrow new AuthorizationException(AuthorizedRequestAPIImpl.NOT_ALLOWED_MESSAGE);\n+\t\t\t}\n \t\t\tLong currentUserZuid = ZohoCRMIAMUtil.getZUIDFromUserId(userId);\n \t\t\tLong bugId=getBugId(caseId);\n \t\t\tString updateMode=\"closebug\";\n@@ -1264,6 +1273,10 @@ public boolean editCommentInBugTracker(DataObject cmtDO,String commentAttachmen\n \t\t\t {\n \t\t\t\t return resultJson.put(\"message\", \"Kindly enable the Bug tracker Integration to Continue\");\n \t\t\t }\n+\t\t\t IntegrationModulePermissionsHandler permissionHandler = new IntegrationModulePermissionsHandler(userId, caseId);\n+\t\t\t if(!permissionHandler.getIsTicketReadable()) {\n+\t\t\t\t throw new AuthorizationException(AuthorizedRequestAPIImpl.NOT_ALLOWED_MESSAGE);\n+\t\t\t }\n \t\t\tRequest requestObj = Support.getAuthorizedRequestAPI(userId).get(caseId);\n \t\t\tif(requestObj==null) {\n \t\t\t\tresultJson.put(\"message\", \"No Content Available\");\n@@ -2051,6 +2064,10 @@ public boolean editCommentInBugTracker(DataObject cmtDO,String commentAttachmen\n \t\t\t{\n \t\t\t\treturn returnJson.put(\"message\",\"Insufficient Previlleges to perform this operation.\");\n \t\t\t}\n+\t\t\tIntegrationModulePermissionsHandler permissionHandler = new IntegrationModulePermissionsHandler(userId, caseId);\n+\t\t\tif(!permissionHandler.getIsTicketUpdatable()) {\n+\t\t\t\tthrow new AuthorizationException(AuthorizedRequestAPIImpl.NOT_ALLOWED_MESSAGE);\n+\t\t\t}\n \t\t\tLong zuid=ZohoCRMIAMUtil.getZUIDFromUserId(userId);\n \t\t\tLong zgId=SecurityUtil.getZGID();\n \t\t\tJSONObject resultJson= delinkBuginProjects(caseId,zuid);\n@@ -2280,6 +2297,10 @@ public boolean editCommentInBugTracker(DataObject cmtDO,String commentAttachmen\n \t\t\t{\n \t\t\t\treturn resultJson.put(\"message\",\"Insufficient Previlleges to perform this operation.\");\n \t\t\t}\n+\t\t\tIntegrationModulePermissionsHandler permissionHandler = new IntegrationModulePermissionsHandler(userId, caseId);\n+\t\t\tif(!permissionHandler.getIsTicketUpdatable()) {\n+\t\t\t\tthrow new AuthorizationException(AuthorizedRequestAPIImpl.NOT_ALLOWED_MESSAGE);\n+\t\t\t}\n \t\t\tLong bugId=getProjectsBugIdForCaseId(caseId);\n \t\t\tif(bugId!=null){\n \t\t\t\treturn resultJson.put(\"message\",\"Bug Already Filed\");\n"
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"old_path": "source/com/zoho/support/core/fields/miscellaneous/MiscellaneousField.java",
|
|
90
|
-
"new_path": "source/com/zoho/support/core/fields/miscellaneous/MiscellaneousField.java",
|
|
91
|
-
"a_mode": "100644",
|
|
92
|
-
"b_mode": "100644",
|
|
93
|
-
"new_file": false,
|
|
94
|
-
"renamed_file": false,
|
|
95
|
-
"deleted_file": false,
|
|
96
|
-
"diff": "@@ -22,7 +22,6 @@ import com.zoho.support.restapi.RestAPIConstants;\n @NeededFlag(name=\"autonumber\",fieldType=FieldType.AUTONUMBER)\n @NeededFlag(name=\"expression\",fieldType=FieldType.EXPRESSION)\n @NeededFlag(name=\"multiLookUp\",fieldType=FieldType.MULTI_LOOKUP)\n-@JsonFilter(\"MiscellaneousFieldFilter\")\n public class MiscellaneousField extends AbstractField {\n \t\n \tprivate AutonumberProps autonumber;\n"
|
|
97
|
-
}
|
|
98
|
-
],
|
|
99
|
-
"compare_timeout": false,
|
|
100
|
-
"compare_same_ref": false
|
|
101
|
-
}
|
|
67
|
+
{
|
|
68
|
+
"filePath": "/Users/raja-17710/deskApp/desk_client_app/jsapps/supportapp/uat/modules/Setup/steps/SearchClear.spec.js",
|
|
69
|
+
"messages": [],
|
|
70
|
+
"errorCount": 0,
|
|
71
|
+
"fatalErrorCount": 0,
|
|
72
|
+
"warningCount": 0,
|
|
73
|
+
"fixableErrorCount": 0,
|
|
74
|
+
"fixableWarningCount": 0,
|
|
75
|
+
"usedDeprecatedRules": [
|
|
76
|
+
{
|
|
77
|
+
"ruleId": "lines-around-directive",
|
|
78
|
+
"replacedBy": ["padding-line-between-statements"]
|
|
79
|
+
},
|
|
80
|
+
{ "ruleId": "global-require", "replacedBy": [] },
|
|
81
|
+
{ "ruleId": "no-buffer-constructor", "replacedBy": [] },
|
|
82
|
+
{ "ruleId": "no-new-require", "replacedBy": [] },
|
|
83
|
+
{ "ruleId": "no-path-concat", "replacedBy": [] }
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"filePath": "/Users/raja-17710/deskApp/desk_client_app/jsapps/supportapp/uat/modules/Setup/steps/SetupHomePageSearch.spec.js",
|
|
88
|
+
"messages": [],
|
|
89
|
+
"errorCount": 0,
|
|
90
|
+
"fatalErrorCount": 0,
|
|
91
|
+
"warningCount": 0,
|
|
92
|
+
"fixableErrorCount": 0,
|
|
93
|
+
"fixableWarningCount": 0,
|
|
94
|
+
"usedDeprecatedRules": [
|
|
95
|
+
{
|
|
96
|
+
"ruleId": "lines-around-directive",
|
|
97
|
+
"replacedBy": ["padding-line-between-statements"]
|
|
98
|
+
},
|
|
99
|
+
{ "ruleId": "global-require", "replacedBy": [] },
|
|
100
|
+
{ "ruleId": "no-buffer-constructor", "replacedBy": [] },
|
|
101
|
+
{ "ruleId": "no-new-require", "replacedBy": [] },
|
|
102
|
+
{ "ruleId": "no-path-concat", "replacedBy": [] }
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
]
|
package/main.js
CHANGED
|
@@ -45,8 +45,17 @@ function getDiffFiles(diffJson) {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
const checkAry = [18, 31];
|
|
49
|
+
|
|
50
|
+
function validateDiff() {
|
|
51
|
+
const diffJson = require(path.resolve(process.cwd(), 'lintjson.json'));
|
|
52
|
+
diffJson.map(diff => {
|
|
53
|
+
diff.messages = diff.messages.filter(msg => {
|
|
54
|
+
if (checkAry.includes(msg.line)) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
validateDiff();
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|