Skip to content

Commit

Permalink
Merge pull request #537 from oxixes/v2-editor
Browse files Browse the repository at this point in the history
Add `CodeArea` to Wirecloud
  • Loading branch information
aarranz committed Jun 5, 2024
2 parents 2e3ccd9 + 20dd55e commit b197d37
Show file tree
Hide file tree
Showing 36 changed files with 3,230 additions and 149 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
curl "http://localhost:8983/solr/admin/cores?action=RELOAD&core=tester"
fi
python manage.py collectstatic -v 0 -c --noinput
coverage run -a --branch --source wirecloud --omit="*/wirecloud/semanticwiring/*,*/wirecloud/guidebuilder/*,*/tests/*,*/tests.py" manage.py test --noinput --nologcapture -v 2 -a tags='wirecloud-search-api'
coverage run -a --branch --source wirecloud --omit="*/wirecloud/semanticwiring/*,*/wirecloud/guidebuilder/*,*/tests/*,*/tests.py,*/wirecloud/commons/utils/template/*" manage.py test --noinput --nologcapture -v 2 -a tags='wirecloud-search-api'
- name: Coveralls Parallel
uses: AndreMiras/coveralls-python-action@develop
with:
Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:
pip install elasticsearch==2.4.1
cat ci_scripts/templates/elasticsearch-conf.template >> settings.py
python manage.py collectstatic -v 0 -c --noinput
coverage run -a --branch --source wirecloud --omit="*/wirecloud/semanticwiring/*,*/wirecloud/guidebuilder/*,*/tests/*,*/tests.py" manage.py test --noinput --nologcapture -v 2 -a tags='wirecloud-selenium'
coverage run -a --branch --source wirecloud --omit="*/wirecloud/semanticwiring/*,*/wirecloud/guidebuilder/*,*/tests/*,*/tests.py,*/wirecloud/commons/utils/template/*" manage.py test --noinput --nologcapture -v 2 -a tags='wirecloud-selenium'
- name: Coveralls Parallel
uses: AndreMiras/coveralls-python-action@develop
with:
Expand Down
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ Once installed all the npm dependencies, tests can be executed using `grunt`:

$ grunt

## Monaco Editor

Wirecloud uses the Monaco Editor as its code editor. The Monaco Editor is the code editor that powers VS Code.

In order to use the Monaco Editor, install the npm dependencies and build the editor:

$ npm install
$ npm run build-monaco (optional, already done by npm install)

This will download the Monaco Editor and build it for Wirecloud.

---

Expand All @@ -152,17 +162,17 @@ any later, at your option) with classpath-like exception.

### Are there any legal issues with AGPL 3.0? Is it safe for me to use?

There is absolutely no problem in using a product licensed under AGPL 3.0. Issues with GPL
(or AGPL) licenses are mostly related with the fact that different people assign different
There is absolutely no problem in using a product licensed under AGPL 3.0. Issues with GPL
(or AGPL) licenses are mostly related with the fact that different people assign different
interpretations on the meaning of the term “derivate work” used in these licenses. Due to this,
some people believe that there is a risk in just _using_ software under GPL or AGPL licenses
(even without _modifying_ it).

For the avoidance of doubt, the owners of this software licensed under an AGPL-3.0 license
For the avoidance of doubt, the owners of this software licensed under an AGPL-3.0 license
wish to make a clarifying public statement as follows:

> Please note that software derived as a result of modifying the source code of this
> software in order to fix a bug or incorporate enhancements is considered a derivative
> work of the product. Software that merely uses or aggregates (i.e. links to) an otherwise
> software in order to fix a bug or incorporate enhancements is considered a derivative
> work of the product. Software that merely uses or aggregates (i.e. links to) an otherwise
> unmodified version of existing software is not considered a derivative work, and therefore
> it does not need to be released as under the same license, or even released as open source.
3 changes: 2 additions & 1 deletion src/GruntFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const dependencies = [
'wirecloud/platform/static/js/common/ComputedStyle.js',
'wirecloud/commons/static/js/lib/urlify.js',
'wirecloud/commons/static/js/lib/moment-with-locales.min.js',
'wirecloud/commons/static/js/lib/moment-timezone-with-data.min.js',
'wirecloud/commons/static/js/lib/moment-timezone-with-data.min.js'
];

const styledElementsFiles = [
Expand Down Expand Up @@ -63,6 +63,7 @@ const styledElementsFiles = [
'wirecloud/commons/static/js/StyledElements/NumericField.js',
'wirecloud/commons/static/js/StyledElements/TextField.js',
'wirecloud/commons/static/js/StyledElements/TextArea.js',
'wirecloud/commons/static/js/StyledElements/CodeArea.js',
'wirecloud/commons/static/js/StyledElements/List.js',
'wirecloud/commons/static/js/StyledElements/PasswordField.js',
'wirecloud/commons/static/js/StyledElements/Select.js',
Expand Down
84 changes: 84 additions & 0 deletions src/js_tests/styledelements/CodeAreaInputInterfaceSpec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
* Copyright (c) 2024 Future Internet Consulting and Development Solutions S.L.
*
* This file is part of Wirecloud Platform.
*
* Wirecloud Platform is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Wirecloud is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Wirecloud Platform. If not, see
* <http://www.gnu.org/licenses/>.
*
*/

/* globals StyledElements */

(function (se) {

"use strict";

describe("CodeInputInterface", () => {

let dom = null;

beforeEach(function () {
dom = document.createElement('div');
document.body.appendChild(dom);
});

afterEach(function () {
if (dom != null) {
dom.remove();
dom = null;
}
});

describe("new CodeInputInterface(fieldId, description)", () => {

it("is a class constructor", () => {
expect(() => {
se.CodeInputInterface("pass", {}); // eslint-disable-line new-cap
}).toThrowError(TypeError);
});

it("requires fieldId and description parameters", () => {
expect(() => {
new se.CodeInputInterface();
}).toThrowError(TypeError);
});

it("should work by providing the minimum details", () => {
const field = new se.CodeInputInterface("code", {});
expect(field.id).toBe("code");
expect(field).toEqual(jasmine.any(se.InputInterface));
});

});

describe("CodeInputInterface.parse(value)", () => {

it("should return the value as is", () => {
expect(se.CodeInputInterface.parse("value")).toBe("value");
});

});

describe("CodeInputInterface.stringify(value)", () => {

it("should return the value as is", () => {
expect(se.CodeInputInterface.stringify("value")).toBe("value");
});

});

});

})(StyledElements);
Loading

0 comments on commit b197d37

Please sign in to comment.