Skip to content

Commit

Permalink
Fix tests and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
oxixes committed Mar 11, 2024
1 parent 24c3634 commit cbbf60e
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/wirecloud/commons/static/js/StyledElements/CodeArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

/* globals StyledElements */

(function(se, utils, monaco) {
(function (se, utils, monaco) {

"use strict";

Expand Down
20 changes: 10 additions & 10 deletions src/wirecloud/commons/static/js/StyledElements/InputInterfaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,19 +507,19 @@
*/
se.CodeInputInterface = class CodeInputInterface extends se.InputInterface {

constructor(fieldId, fieldDesc) {
super(fieldId, fieldDesc);
constructor(fieldId, fieldDesc) {
super(fieldId, fieldDesc);

this.inputElement = new StyledElements.CodeArea(fieldDesc);
}
this.inputElement = new StyledElements.CodeArea(fieldDesc);
}

static parse(value) {
return value;
}
static parse(value) {
return value;
}

static stringify(value) {
return value;
}
static stringify(value) {
return value;
}

}

Expand Down
8 changes: 8 additions & 0 deletions src/wirecloud/commons/tests/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def setUpClass(cls):
'value': None,
'multiuser': False,
'required': False,
'language': ''
},
{
'name': 'pref2',
Expand All @@ -182,6 +183,7 @@ def setUpClass(cls):
'value': '5',
'multiuser': False,
'required': False,
'language': ''
}
],
'properties': [
Expand Down Expand Up @@ -304,6 +306,7 @@ def setUpClass(cls):
'value': None,
'multiuser': False,
'required': False,
'language': ''
},
{
'name': 'pref2',
Expand All @@ -316,6 +319,7 @@ def setUpClass(cls):
'value': '5',
'multiuser': False,
'required': False,
'language': ''
}
],
'properties': [
Expand Down Expand Up @@ -1290,6 +1294,7 @@ def setUpClass(cls):
'value': None,
'multiuser': False,
'required': False,
'language': ''
},
{
'name': 'pref2',
Expand All @@ -1302,6 +1307,7 @@ def setUpClass(cls):
'value': '5',
'multiuser': False,
'required': False,
'language': ''
}
],
'properties': [
Expand Down Expand Up @@ -1499,6 +1505,7 @@ def setUpClass(cls):
'value': None,
'multiuser': False,
'required': False,
'language': ''
},
{
'name': 'pref2',
Expand All @@ -1511,6 +1518,7 @@ def setUpClass(cls):
'value': None,
'multiuser': False,
'required': False,
'language': ''
},
],
'properties': [],
Expand Down
2 changes: 1 addition & 1 deletion src/wirecloud/commons/utils/template/parsers/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def _init(self):
self._check_array_fields(('preferences', 'properties'))
for preference in self._info['preferences']:
self._check_string_fields(('name', 'type'), place=preference, required=True)
self._check_string_fields(('label', 'description', 'default'), place=preference)
self._check_string_fields(('label', 'description', 'default', 'language'), place=preference)
self._check_boolean_fields(('readonly', 'secure'), place=preference, default=False)
self._check_string_fields(('value',), place=preference, null=True, default=None)
preference['multiuser'] = False
Expand Down
2 changes: 1 addition & 1 deletion src/wirecloud/commons/utils/template/parsers/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def _parse_component_preferences(self):
'secure': preference.get('secure', 'false').lower() == 'true',
'multiuser': False,
'required': preference.get('required', 'false').lower() == 'true',
'language': str(preference.get('language', 'plaintext'))
'language': str(preference.get('language', ''))
}

if preference_info['type'] == 'list':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
{% endblock %}

{% block basejs %}
{% compress js %}
<script type="text/javascript" src="{% url "wirecloud.javascript_translation_catalogue" %}?language={{ LANGUAGE_CODE }}&amp;v={{ WIRECLOUD_VERSION_HASH }}"></script>
{% compress js %}
<script type="text/javascript" src="{% static "js/lib/moment-with-locales.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/lib/moment-timezone-with-data.min.js" %}"></script>
{% endcompress %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
{% endblock %}

{% block basejs %}
{% compress js %}
<script type="text/javascript" src="{% url "wirecloud.javascript_translation_catalogue" %}?language={{ LANGUAGE_CODE }}&amp;v={{ WIRECLOUD_VERSION_HASH }}"></script>
{% compress js %}
<script type="text/javascript" src="{% static "js/lib/moment-with-locales.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/lib/moment-timezone-with-data.min.js" %}"></script>
{% endcompress %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
{% endblock %}

{% block basejs %}
{% compress js %}
<script type="text/javascript" src="{% url "wirecloud.javascript_translation_catalogue" %}?language={{ LANGUAGE_CODE }}&amp;v={{ WIRECLOUD_VERSION_HASH }}"></script>
{% compress js %}
<script type="text/javascript" src="{% static "js/lib/moment-with-locales.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/lib/moment-timezone-with-data.min.js" %}"></script>
{% endcompress %}
Expand Down
3 changes: 3 additions & 0 deletions src/wirecloud/platform/localcatalogue/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def check_basic_widget_info(self, resource):
'secure': False,
'name': 'pref',
'label': 'Preference label',
'language': '',
'type': 'list',
'options': [{'value': '1', 'label': 'Option name'}],
'readonly': False,
Expand Down Expand Up @@ -376,6 +377,7 @@ def test_template_translations(self):
'secure': False,
'name': 'pref',
'label': 'Etiqueta de la preferencia',
'language': '',
'type': 'list',
'options': [{'value': '1', 'label': 'Nombre de la opción'}],
'readonly': False,
Expand Down Expand Up @@ -412,6 +414,7 @@ def test_repeated_translation_indexes(self):
'secure': False,
'name': 'pref',
'label': 'Label',
'language': '',
'type': 'text',
'readonly': False,
'description': 'Preference description',
Expand Down

0 comments on commit cbbf60e

Please sign in to comment.