Skip to content

Commit

Permalink
Merge branch 'develop' into fix/bug-33571
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillovIlya committed Nov 29, 2024
2 parents 7f8cce0 + c231a78 commit b9a30dd
Show file tree
Hide file tree
Showing 300 changed files with 102,041 additions and 65,334 deletions.
143 changes: 86 additions & 57 deletions .github/workflows/common_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,91 +12,120 @@ jobs:
steps:
- name: check out repository
uses: actions/checkout@v3

- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: execute check styles
run: python tests/code-style/check.py
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 14
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libatk1.0-0 libcups2 libatk-bridge2.0-0 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libnss3 libgbm1 libasound2
- name: check out repository
uses: actions/checkout@v3

- name: Use Node.js 18
uses: actions/setup-node@v1
with:
node-version: 14
node-version: 18

- name: Run unit tests
run: |
npm install -g grunt-cli node-qunit-puppeteer
npm install grunt-cli node-qunit-puppeteer
npm install --prefix build
grunt --gruntfile build/Gruntfile.js develop
node-qunit-puppeteer tests/common/api/api.html
node-qunit-puppeteer tests/common/color-mods/color-mods.html
node-qunit-puppeteer tests/cell/shortcuts/shortcuts.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/FormulaTests.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/PivotTests.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/CopyPasteTests.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/SheetStructureTests.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/autoFilterTests.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/UserProtectedRangesTest.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/FormulaTrace.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/GoalSeekTests.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/NumFormatParse.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/DataValidationTests.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/conditionalFormattingTests.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/ExternalReference.html
node-qunit-puppeteer tests/cell/spreadsheet-calculation/SheetMemoryTest.html
node-qunit-puppeteer tests/word/unit-tests/paragraphContentPos.html
node-qunit-puppeteer tests/word/unit-tests/deleted-text-recovery.html
node-qunit-puppeteer tests/word/content-control/block-level/cursorAndSelection.html
node-qunit-puppeteer tests/word/content-control/inline-level/checkbox.html
node-qunit-puppeteer tests/word/content-control/inline-level/cursorAndSelection.html
node-qunit-puppeteer tests/word/content-control/inline-level/date-time.html
node-qunit-puppeteer tests/word/document-calculation/floating-position/drawing.html
node-qunit-puppeteer tests/word/document-calculation/paragraph.html
node-qunit-puppeteer tests/word/document-calculation/table/correctBadTable.html
node-qunit-puppeteer tests/word/document-calculation/table/flowTablePosition.html
node-qunit-puppeteer tests/word/document-calculation/table/pageBreak.html
node-qunit-puppeteer tests/word/document-calculation/table/table-header.html
node-qunit-puppeteer tests/word/document-calculation/textShaper/textShaper.html
node-qunit-puppeteer tests/word/document-calculation/text-hyphenator/text-hyphenator.html
node-qunit-puppeteer tests/word/forms/forms.html
node-qunit-puppeteer tests/word/forms/complexForm.html
node-qunit-puppeteer tests/word/numbering/numberingApplicator.html
node-qunit-puppeteer tests/word/numbering/numberingCalculation.html
node-qunit-puppeteer tests/word/numbering/numberingAutocorrect.html
node-qunit-puppeteer tests/word/api/api.html
node-qunit-puppeteer tests/word/api/cross-ref.html
node-qunit-puppeteer tests/word/api/textInput.html
node-qunit-puppeteer tests/word/styles/displayStyle.html
node-qunit-puppeteer tests/word/styles/paraPr.html
node-qunit-puppeteer tests/word/styles/styleApplicator.html
node-qunit-puppeteer tests/word/plugins/pluginsApi.html
node-qunit-puppeteer tests/word/revisions/paragraph.html
node-qunit-puppeteer tests/word/merge-documents/mergeDocuments.html
node-qunit-puppeteer tests/word/shortcuts/shortcuts.html
node-qunit-puppeteer tests/slide/shortcuts/shortcuts.html
node node_modules/grunt-cli/bin/grunt --gruntfile build/Gruntfile.js develop
node node_modules/node-qunit-puppeteer/cli.js tests/common/api/api.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/common/color-mods/color-mods.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/cell/shortcuts/shortcuts.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/cell/spreadsheet-calculation/FormulaTests.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/cell/spreadsheet-calculation/PivotTests.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/cell/spreadsheet-calculation/CopyPasteTests.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/cell/spreadsheet-calculation/SheetStructureTests.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/cell/spreadsheet-calculation/autoFilterTests.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/cell/spreadsheet-calculation/UserProtectedRangesTest.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/cell/spreadsheet-calculation/FormulaTrace.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/cell/spreadsheet-calculation/GoalSeekTests.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/cell/spreadsheet-calculation/NumFormatParse.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/cell/spreadsheet-calculation/DataValidationTests.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/cell/spreadsheet-calculation/conditionalFormattingTests.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/cell/spreadsheet-calculation/ExternalReference.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/cell/spreadsheet-calculation/SheetMemoryTest.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/unit-tests/paragraphContentPos.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/unit-tests/deleted-text-recovery.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/content-control/block-level/cursorAndSelection.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/content-control/inline-level/checkbox.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/content-control/inline-level/cursorAndSelection.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/content-control/inline-level/date-time.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/document-calculation/floating-position/drawing.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/document-calculation/paragraph.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/document-calculation/table/correctBadTable.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/document-calculation/table/flowTablePosition.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/document-calculation/table/pageBreak.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/document-calculation/table/table-flow.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/document-calculation/table/table-header.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/document-calculation/textShaper/textShaper.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/document-calculation/text-hyphenator/text-hyphenator.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/forms/forms.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/forms/complexForm.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/numbering/numberingApplicator.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/numbering/numberingCalculation.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/numbering/numberingAutocorrect.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/api/api.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/api/cross-ref.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/api/textInput.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/styles/displayStyle.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/styles/paraPr.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/styles/styleApplicator.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/text-autocorrection/as-you-type.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/plugins/pluginsApi.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/revisions/paragraph.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/merge-documents/mergeDocuments.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/word/shortcuts/shortcuts.html 30000 "--no-sandbox"
node node_modules/node-qunit-puppeteer/cli.js tests/slide/shortcuts/shortcuts.html 30000 "--no-sandbox"
builder-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: check out repository
uses: actions/checkout@v4
with:
path: sdkjs
- uses: actions/checkout@v4

- name: check out repository sdkjs-forms current branch
id: sdkjs-forms
uses: actions/checkout@v4
continue-on-error: true
with:
repository: ONLYOFFICE/sdkjs-forms
token: ${{ secrets.READ_PAT }}
path: sdkjs-forms
ref: ${{ github.ref }}
- name: check out repository sdkjs-forms master branch
if: steps.sdkjs-forms.outcome != 'success'
uses: actions/checkout@v4
with:
repository: ONLYOFFICE/sdkjs-forms
token: ${{ secrets.READ_PAT }}
path: sdkjs-forms
- name: Use Node.js 12
ref: master

- name: Use Node.js 18
uses: actions/setup-node@v1
with:
node-version: 12
node-version: 18

- name: Run builder tests
run: |
cd sdkjs
npm install -g grunt-cli
npm install grunt-cli
npm install --prefix build
grunt --level=WHITESPACE_ONLY --addon=sdkjs-forms --base build --gruntfile build/Gruntfile.js
node node_modules/grunt-cli/bin/grunt --level=WHITESPACE_ONLY --addon=sdkjs-forms --base build --gruntfile build/Gruntfile.js
docker run -v $PWD/deploy/sdkjs/common:/opt/onlyoffice/documentbuilder/sdkjs/common \
-v $PWD/deploy/sdkjs/word:/opt/onlyoffice/documentbuilder/sdkjs/word \
-v $PWD/deploy/sdkjs/cell:/opt/onlyoffice/documentbuilder/sdkjs/cell \
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/dev_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 14
- name: Use Node.js 20
uses: actions/setup-node@v1
with:
node-version: 14
node-version: 20
- name: Run unit tests
run: |
npm install -g grunt-cli node-qunit-puppeteer
Expand Down Expand Up @@ -57,6 +57,8 @@ jobs:
node-qunit-puppeteer tests/word/document-calculation/table/correctBadTable.html
node-qunit-puppeteer tests/word/document-calculation/table/flowTablePosition.html
node-qunit-puppeteer tests/word/document-calculation/table/pageBreak.html
node-qunit-puppeteer tests/word/document-calculation/table/table-flow.html
node-qunit-puppeteer tests/word/document-calculation/table/table-header.html
node-qunit-puppeteer tests/word/document-calculation/textShaper/textShaper.html
node-qunit-puppeteer tests/word/document-calculation/text-hyphenator/text-hyphenator.html
node-qunit-puppeteer tests/word/forms/forms.html
Expand All @@ -70,6 +72,7 @@ jobs:
node-qunit-puppeteer tests/word/styles/displayStyle.html
node-qunit-puppeteer tests/word/styles/paraPr.html
node-qunit-puppeteer tests/word/styles/styleApplicator.html
node-qunit-puppeteer tests/word/text-autocorrection/as-you-type.html
node-qunit-puppeteer tests/word/plugins/pluginsApi.html
node-qunit-puppeteer tests/word/revisions/document-content.html
node-qunit-puppeteer tests/word/revisions/paragraph.html
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ package-lock.json
*/node_modules
*/package-lock.json
connector
tests/package*
34 changes: 31 additions & 3 deletions build/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ module.exports = function(grunt) {
this.word = null;
this.cell = null;
this.slide = null;
this.draw = null;

this.append(pathConfigs);
}
Expand Down Expand Up @@ -132,9 +133,10 @@ module.exports = function(grunt) {
appendOption.call(this, 'word');
appendOption.call(this, 'cell');
appendOption.call(this, 'slide');
appendOption.call(this, 'draw');
};
CConfig.prototype.valid = function () {
return this.externs && this.word && this.cell && this.slide;
return this.externs && this.word && this.cell && this.slide && this.draw;
};

function getExterns(config) {
Expand Down Expand Up @@ -176,6 +178,7 @@ module.exports = function(grunt) {
const word = path.join(deploy, 'word');
const cell = path.join(deploy, 'cell');
const slide = path.join(deploy, 'slide');
const draw = path.join(deploy, 'draw');

const level = grunt.option('level') || 'ADVANCED';
const formatting = grunt.option('formatting') || '';
Expand Down Expand Up @@ -209,7 +212,8 @@ module.exports = function(grunt) {
'libfont/engine/*',
'spell/spell/*',
'hash/hash/*',
'zlib/engine/*'
'zlib/engine/*',
'serviceworker/*'
],
dest: path.join(deploy, 'common'),
name: 'common'
Expand All @@ -236,6 +240,7 @@ module.exports = function(grunt) {
const configWord = configs.word['sdk'];
const configCell = configs.cell['sdk'];
const configSlide = configs.slide['sdk'];
const configDraw = configs.draw['sdk'];

const compilerArgs = getExterns(configs.externs);
if (formatting) {
Expand Down Expand Up @@ -301,6 +306,10 @@ module.exports = function(grunt) {
grunt.initConfig(getCompileConfig(getFilesMin(configSlide), getFilesAll(configSlide), 'sdk-all-min', 'sdk-all', 'slide', path.join(slide , '/')));
grunt.task.run('closure-compiler');
});
grunt.registerTask('compile-draw', 'Compile Draw SDK', function () {
grunt.initConfig(getCompileConfig(getFilesMin(configDraw), getFilesAll(configDraw), 'sdk-all-min', 'sdk-all', 'draw', path.join(draw , '/')));
grunt.task.run('closure-compiler');
});
grunt.registerTask('copy-maps', 'Copy maps from deploy to build', function() {
grunt.initConfig({
copy: {
Expand Down Expand Up @@ -351,6 +360,22 @@ module.exports = function(grunt) {
}
}
]
},
draw: {
files: [
{
expand: true,
cwd: draw,
src: [
'sdk-all-min.js.map',
'sdk-all.js.map',
],
dest: 'maps',
rename: function (dest, src) {
return path.join(dest , src.replace('sdk', 'draw'));
}
}
]
}
},
clean: {
Expand All @@ -365,13 +390,15 @@ module.exports = function(grunt) {
path.join(cell, 'sdk-all.js.map'),
path.join(slide, 'sdk-all-min.js.map'),
path.join(slide, 'sdk-all.js.map'),
path.join(draw, 'sdk-all-min.js.map'),
path.join(draw, 'sdk-all.js.map'),
]
}
}
});
grunt.task.run('copy', 'clean');
});
grunt.registerTask('compile-sdk', ['compile-word', 'compile-cell', 'compile-slide']);
grunt.registerTask('compile-sdk', ['compile-word', 'compile-cell', 'compile-slide', 'compile-draw']);
grunt.registerTask('clean-deploy', 'Clean deploy folder before deploying', function () {
grunt.initConfig({
clean: {
Expand Down Expand Up @@ -490,6 +517,7 @@ module.exports = function(grunt) {
writeScripts(configs.word['sdk'], 'word');
writeScripts(configs.cell['sdk'], 'cell');
writeScripts(configs.slide['sdk'], 'slide');
writeScripts(configs.draw['sdk'], 'draw');
});
const defaultTasks = ['clean-deploy', 'compile-sdk', 'copy-other'];
if (grunt.option('map')) {
Expand Down
21 changes: 7 additions & 14 deletions cell/Local/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,6 @@ var c_oAscError = Asc.c_oAscError;
var asc = window["Asc"];
var spreadsheet_api = asc['spreadsheet_api'];

spreadsheet_api.prototype._onNeedParams = function(data, opt_isPassword)
{
var type;
var options;
if (opt_isPassword) {
type = Asc.c_oAscAdvancedOptionsID.DRM;
} else {
type = Asc.c_oAscAdvancedOptionsID.CSV;
var cp = JSON.parse("{\"codepage\":46,\"delimiter\":1}");
cp['encodings'] = AscCommon.getEncodingParams();
options = new AscCommon.asc_CAdvancedOptions(cp);
}
this.handlers.trigger("asc_onAdvancedOptions", type, options);
};
spreadsheet_api.prototype.asc_addImageDrawingObject = function(urls, imgProp, token)
{
var ws = this.wb.getWorksheet();
Expand Down Expand Up @@ -290,6 +276,13 @@ var c_oAscError = Asc.c_oAscError;
let nativeOptions = options.advancedOptions.asc_getNativeOptions();
if (nativeOptions)
printOptionsObj["nativeOptions"] = nativeOptions;

// adjustPrint
printOptionsObj["adjustOptions"] = {};
if (null != options.advancedOptions.asc_getStartPageIndex())
printOptionsObj["adjustOptions"]["startPageIndex"] = options.advancedOptions.asc_getStartPageIndex();
if (null != options.advancedOptions.asc_getEndPageIndex())
printOptionsObj["adjustOptions"]["endPageIndex"] = options.advancedOptions.asc_getEndPageIndex();
}

printOptions = JSON.stringify(printOptionsObj);
Expand Down
Loading

0 comments on commit b9a30dd

Please sign in to comment.