Skip to content

Commit 99d1db0

Browse files
author
Marc Schlaeppi
committed
Replace legacy Ace editors
1 parent 99c8983 commit 99d1db0

33 files changed

Lines changed: 778 additions & 446 deletions

e2e/tests/administrator/case/ioc.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ test.beforeEach(async({ page }) => {
1313

1414
test('should be able to update IOC', async ({ page }) => {
1515
const iocValue = `IOC value - ${crypto.randomUUID()}`;
16+
const iocDescription = `IOC description - ${crypto.randomUUID()}`;
1617

1718
await page.getByRole('button', { name: 'Add IOC' }).click();
1819
await page.getByRole('button', { name: 'None' }).click();
1920
await page.getByRole('listbox').getByRole('option', { name: 'AS', exact: true }).click();
2021
await page.getByLabel('IOC Value *').fill(iocValue);
22+
await page.locator('#ioc_description .ProseMirror').fill(iocDescription);
2123
await page.getByRole('button', { name: 'Save' }).click();
2224

2325
await page.getByRole('link', { name: iocValue }).click();
26+
await expect(page.locator('#ioc_description .ProseMirror')).toContainText(iocDescription);
2427
const newIocValue = `IOC value - ${crypto.randomUUID()}`;
2528
await page.getByLabel('IOC Value *').fill(newIocValue);
2629
await page.getByRole('button', { name: 'Update' }).click();
@@ -89,4 +92,4 @@ test('should be able to update IOC custom attribute', async ({ page, rest }) =>
8992
partial_overwrite: false
9093
}
9194
})
92-
});
95+
});

source/app/blueprints/pages/case/templates/case.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<link rel="stylesheet" href="/static/assets/css/select2.css">
55
<link rel="stylesheet" href="/static/assets/css/bootstrap-multiselect.min.css">
66
<link rel="stylesheet" href="/static/assets/css/bootstrap-select.min.css">
7-
<link rel="stylesheet" href="/static/assets/css/milkdown_editor.css">
87
{% endblock stylesheets %}
98
{% block content %}
109
{% if current_user.is_authenticated %}

source/app/blueprints/pages/case/templates/case_assets.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{% extends "layouts/default_ext.html" %} {% block title %} Case Assets {% endblock title %} {% block stylesheets %}
22
{% include 'includes/header_case.html' %}
33
<link rel="stylesheet" href="/static/assets/css/bootstrap-select.min.css">
4-
<link rel="stylesheet" href="/static/assets/css/milkdown_editor.css">
54
{% endblock stylesheets %}
65
{% block content %}
76
{% include 'includes/navigation_ext.html' %}
@@ -148,4 +147,4 @@ <h5>Upload assets list (CSV format)</h5>
148147
<script type="module" src="/static/assets/js/iris/milkdown_editor.js"></script>
149148
<script type="module" src="/static/assets/js/iris/milkdown_split.js"></script>
150149

151-
{% endblock javascripts %}
150+
{% endblock javascripts %}

source/app/blueprints/pages/case/templates/case_notes_v2.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{% extends "layouts/default_ext.html" %} {% block title %} Case notes {% endblock title %} {% block stylesheets %}
22
{% include 'includes/header_case.html' %}
33
<link rel="stylesheet" href="/static/assets/css/bootstrap-select.min.css">
4-
<link rel="stylesheet" href="/static/assets/css/milkdown_editor.css">
54
{% endblock stylesheets %}
65
{% block content %}
76
{% include 'includes/navigation_ext.html' %}

source/app/blueprints/pages/manage/templates/manage_attributes.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,5 @@
7474
{% endblock content %}
7575

7676
{% block javascripts %}
77-
<script src="/static/assets/js/plugin/ace/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
78-
<script src="/static/assets/js/plugin/ace/src-noconflict/ext-language_tools.js" type="text/javascript"
79-
charset="utf-8"></script>
80-
8177
<script src="/static/assets/js/iris/manage.attributes.js"></script>
82-
{% endblock javascripts %}
78+
{% endblock javascripts %}

source/app/blueprints/pages/manage/templates/manage_case_templates.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,5 @@
8686
{% endblock content %}
8787

8888
{% block javascripts %}
89-
<script src="/static/assets/js/plugin/ace/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
90-
<script src="/static/assets/js/plugin/ace/src-noconflict/ext-language_tools.js" type="text/javascript"
91-
charset="utf-8"></script>
9289
<script src="/static/assets/js/iris/manage.case.templates.js"></script>
93-
{% endblock javascripts %}
90+
{% endblock javascripts %}

source/app/blueprints/pages/manage/templates/manage_modules.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@
135135
{% endblock content %}
136136

137137
{% block javascripts %}
138-
<script src="/static/assets/js/plugin/ace/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
139-
<script src="/static/assets/js/plugin/ace/src-noconflict/ext-language_tools.js" type="text/javascript"
140-
charset="utf-8"></script>
141138
<script src="/static/assets/js/plugin/datatables/dataTables.group.min.js"></script>
142139
<script src="/static/assets/js/iris/manage.modules.js"></script>
143-
{% endblock javascripts %}
140+
{% endblock javascripts %}

source/app/blueprints/pages/manage/templates/modal_update_parameter.html

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,17 @@ <h4>Update {{ parameter["param_human_name"] }} of {{ mod_name }} </h4>
4646
<script>
4747
$(document).ready(function(){
4848
if ($('#editor_detail').length != 0) {
49-
var editor = ace.edit("editor_detail",
49+
var editor = create_iris_code_editor("editor_detail",
5050
{
5151
autoScrollEditorIntoView: true,
5252
minLines: 30,
5353
});
54-
editor.setTheme("ace/theme/tomorrow");
55-
5654
{% if parameter["type"].endswith("json") %}
57-
editor.session.setMode("ace/mode/json");
55+
editor.setMode("json");
5856
{% elif parameter["type"].endswith("html") %}
59-
editor.session.setMode("ace/mode/html");
57+
editor.setMode("html");
6058
{% elif parameter["type"].endswith("markdown") %}
61-
editor.session.setMode("ace/mode/markdown");
59+
editor.setMode("markdown");
6260
{% endif %}
6361

6462
editor.renderer.setShowGutter(true);
@@ -71,4 +69,4 @@ <h4>Update {{ parameter["param_human_name"] }} of {{ mod_name }} </h4>
7169
editor.renderer.setScrollMargin(8, 5);
7270
}
7371
});
74-
</script>
72+
</script>

source/app/blueprints/pages/search/templates/search.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,7 @@
153153
<script src="/static/assets/js/plugin/datatables/buttons.html5.min.js"></script>
154154
<script src="/static/assets/js/plugin/datatables/buttons.print.min.js"></script>
155155

156-
<script src="/static/assets/js/plugin/ace/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
157-
<script src="/static/assets/js/plugin/ace/src-noconflict/ext-language_tools.js" type="text/javascript"
158-
charset="utf-8"></script>
159-
160156
<script src="/static/assets/js/plugin/showdown/showdown.min.js"></script>
161157
<script src="/static/assets/js/iris/case.common.js"></script>
162158
<script src="/static/assets/js/iris/search.js"></script>
163-
{% endblock javascripts %}
159+
{% endblock javascripts %}

source/app/templates/layouts/default.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<link rel="stylesheet" href="/static/assets/css/atlantis.css">
2828
<link rel="stylesheet" href="/static/assets/css/bootstrap-select.min.css">
2929
<link rel="stylesheet" href="/static/assets/css/suggestags.css">
30+
<link rel="stylesheet" href="/static/assets/css/milkdown_editor.css">
3031

3132
<!-- Specific CSS goes HERE -->
3233
{% block stylesheets %}{% endblock stylesheets %}
@@ -96,9 +97,7 @@
9697
<!-- Atlantis JS -->
9798
<script src="/static/assets/js/atlantis.min.js"></script>
9899

99-
<script src="/static/assets/js/plugin/ace/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
100-
<script src="/static/assets/js/plugin/ace/src-noconflict/ext-language_tools.js" type="text/javascript"
101-
charset="utf-8"></script>
100+
<script type="module" src="/static/assets/js/iris/unified_editor.js"></script>
102101

103102
<!-- Iris Common -->
104103
<script src="/static/assets/js/iris/common.js"></script>
@@ -115,4 +114,4 @@
115114
{% block javascripts %}{% endblock javascripts %}
116115

117116
</body>
118-
</html>
117+
</html>

0 commit comments

Comments
 (0)