Skip to content

Commit 36f5bda

Browse files
committed
--no-edit
1 parent a84410c commit 36f5bda

222 files changed

Lines changed: 34125 additions & 30073 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/assets_code_analysis.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ jobs:
2121
- name: Lint on SCSS files
2222
run: npm run stylelint
2323

24+
- name: UI Unit Tests
25+
run: npm run test:run
26+
27+
- name: Type Check
28+
run: npm run typecheck
29+
2430
name: ${{ matrix.actions.name }}
2531
runs-on: ubuntu-latest
2632

.stylelintrc

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,39 @@
33
"stylelint-config-standard",
44
"stylelint-config-recommended-scss"
55
],
6-
"syntax": "scss",
6+
"customSyntax": "postcss-scss",
7+
"ignoreFiles": [
8+
"assets/scss/vendor/**/*.scss"
9+
],
710
"plugins": ["stylelint-scss"],
811
"rules": {
9-
"no-descending-specificity": null
12+
"alpha-value-notation": null,
13+
"color-function-alias-notation": null,
14+
"color-function-notation": null,
15+
"custom-property-pattern": null,
16+
"declaration-block-no-redundant-longhand-properties": null,
17+
"font-family-name-quotes": null,
18+
"function-url-quotes": null,
19+
"import-notation": null,
20+
"keyframes-name-pattern": null,
21+
"no-descending-specificity": null,
22+
"no-invalid-position-at-import-rule": null,
23+
"number-max-precision": null,
24+
"property-no-deprecated": null,
25+
"property-no-vendor-prefix": null,
26+
"scss/at-extend-no-missing-placeholder": null,
27+
"scss/comment-no-empty": null,
28+
"scss/load-no-partial-leading-underscore": null,
29+
"scss/load-partial-extension": null,
30+
"scss/no-global-function-names": null,
31+
"scss/operator-no-unspaced": null,
32+
"selector-attribute-quotes": null,
33+
"selector-class-pattern": null,
34+
"selector-id-pattern": null,
35+
"selector-not-notation": null,
36+
"shorthand-property-no-redundant-values": null,
37+
"unit-no-unknown": null,
38+
"value-keyword-case": null,
39+
"value-no-vendor-prefix": null
1040
}
1141
}
Lines changed: 1 addition & 0 deletions
Loading

assets/js/app/ajax-save.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ record_id = JSON.stringify(record_id);
1414
/**
1515
* Start of Ajaxy solution for saving
1616
*/
17-
$(document).ready(function() {
17+
$(document).ready(function () {
1818
let unsaved = false;
1919

20-
$(form).change(function() {
20+
$(form).change(function () {
2121
//triggers change in all input fields including text type
2222
unsaved = true;
2323
});
@@ -48,13 +48,13 @@ $(document).ready(function() {
4848
$('#toastType').append(toastType);
4949
$('#toastBody').append(toastMessage);
5050

51-
$(document).ready(function() {
51+
$(document).ready(function () {
5252
let toastElList = [].slice.call(document.querySelectorAll('.toast'));
53-
let toastList = toastElList.map(function(toastEl) {
53+
let toastList = toastElList.map(function (toastEl) {
5454
return new Toast(toastEl, []);
5555
});
5656

57-
toastList.forEach(function(toast) {
57+
toastList.forEach(function (toast) {
5858
toast.show();
5959
});
6060
});
@@ -67,25 +67,25 @@ $(document).ready(function() {
6767

6868
// For classic POST: disable only after native HTML5 validation has passed (submit event)
6969
if (elementSubmit.length) {
70-
$(form).on('submit', function() {
70+
$(form).on('submit', function () {
7171
elementSubmit.prop('disabled', true);
7272
});
7373
}
7474

75-
elementButton.on('click', function() {
75+
elementButton.on('click', function () {
7676
elementButton.prop('disabled', true);
7777
$.ajax({
7878
type: 'POST',
7979
link: url,
8080
data: $(form).serialize(),
81-
beforeSend: function() {
81+
beforeSend: function () {
8282
patience_virtue(elementButton);
8383
},
84-
complete: function() {
84+
complete: function () {
8585
renable();
8686
elementButton.prop('disabled', false);
8787
},
88-
success: function(data, textStatus) {
88+
success: function (data, textStatus) {
8989
if (!record_id) {
9090
window.location.replace(data.url);
9191
} else if (window.location.pathname === '/bolt/duplicate/' + duplicate_id) {
@@ -98,7 +98,7 @@ $(document).ready(function() {
9898
showToast();
9999
}
100100
},
101-
error: function(jq, status, err) {
101+
error: function (jq, status, err) {
102102
// eslint-disable-next-line no-console
103103
console.log(status, err);
104104
showToast();

assets/js/app/common.js

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import ClipboardJS from 'clipboard';
88
import { version } from '../version';
99
window.assetsVersion = version;
1010

11-
$(document).ready(function() {
11+
$(document).ready(function () {
1212
// add a js class to indicate we have JS enabled. Might need a change to either modernizr or somethng comparable
1313
$('html').addClass('js');
1414

@@ -20,7 +20,7 @@ $(document).ready(function() {
2020
*/
2121
$('.admin__sidebar').addClass('admin__sidebar--is-collapsed');
2222

23-
$('.admin-sidebar-toggler').on('click', function() {
23+
$('.admin-sidebar-toggler').on('click', function () {
2424
if ($('.admin__sidebar').hasClass('admin__sidebar--is-collapsed')) {
2525
$('.admin__sidebar')
2626
.addClass('admin__sidebar--is-expanded')
@@ -52,7 +52,7 @@ $(document).ready(function() {
5252
}, 50);
5353
}
5454

55-
$('a[data-bs-toggle="tab"]').on('click', function() {
55+
$('a[data-bs-toggle="tab"]').on('click', function () {
5656
let newUrl;
5757
const hash = $(this).attr('href');
5858
newUrl = url.split('#')[0] + hash;
@@ -62,23 +62,23 @@ $(document).ready(function() {
6262
/*
6363
** Convert all ISO dates with class .datetime-relative to relative time
6464
*/
65-
$('.datetime-relative').each(function() {
65+
$('.datetime-relative').each(function () {
6666
$(this).text(DateTime.fromISO($(this).text()).toRelative());
6767
});
6868

6969
/*
7070
** Initialise all popover elements
7171
*/
7272
let popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'));
73-
popoverTriggerList.map(function(popoverTriggerEl) {
73+
popoverTriggerList.map(function (popoverTriggerEl) {
7474
return new Popover(popoverTriggerEl);
7575
});
7676

7777
/*
7878
** When a field from another group is invalid, show it.
7979
*/
80-
$('#editor button[type="submit"]').click(function() {
81-
$('#editor input:invalid').each(function() {
80+
$('#editor button[type="submit"]').click(function () {
81+
$('#editor input:invalid').each(function () {
8282
// Find the tab-pane that this element is inside, and get the id
8383
let $closest = $(this).closest('.tab-pane');
8484
let id = $closest.attr('id');
@@ -97,20 +97,15 @@ $(document).ready(function() {
9797
** Simulates disabled behavior for elements with data-readonly attribute.
9898
* This is needed, because a disabled input cannot be required.
9999
*/
100-
$('[data-readonly]').on('keydown paste', function(e) {
100+
$('[data-readonly]').on('keydown paste', function (e) {
101101
e.preventDefault();
102102
});
103103
/* Part of the code above, however make sure flatpickr is not readonly
104104
* and that its validation works.
105105
*/
106-
$('.editor--date')
107-
.siblings()
108-
.prop('readonly', false)
109-
.attr('data-readonly', 'readonly');
110-
$('.editor--date').on('change', e => {
111-
const target = $(e.target)
112-
.parent()
113-
.find('input[data-readonly="readonly"]');
106+
$('.editor--date').siblings().prop('readonly', false).attr('data-readonly', 'readonly');
107+
$('.editor--date').on('change', (e) => {
108+
const target = $(e.target).parent().find('input[data-readonly="readonly"]');
114109
if (target.val()) {
115110
target[0].setCustomValidity('');
116111
} else {
@@ -136,15 +131,12 @@ $(document).ready(function() {
136131
$('[data-errormessage]').on('input', handleInput);
137132

138133
/* Set the errormessage on the correct editor--date field */
139-
$('.editor--date').each(function() {
134+
$('.editor--date').each(function () {
140135
let siblings = $(this).siblings();
141136
const errormessage = $(this).attr('data-errormessage');
142137

143-
siblings.each(function() {
144-
$(this)
145-
.attr('data-errormessage', errormessage)
146-
.on('invalid', handleInvalid)
147-
.on('input', handleInput);
138+
siblings.each(function () {
139+
$(this).attr('data-errormessage', errormessage).on('invalid', handleInvalid).on('input', handleInput);
148140
});
149141
});
150142
/* End of custom error message */
@@ -161,7 +153,7 @@ $(document).ready(function() {
161153

162154
// Reset the content of a modal to it's default
163155

164-
window.$(document).on('click', '[data-bs-toggle="modal"]', function(event) {
156+
window.$(document).on('click', '[data-bs-toggle="modal"]', function (event) {
165157
let resourcesModal = document.getElementById('resourcesModal');
166158

167159
let saveButton = document.getElementById('modalButtonAccept');

assets/js/app/editor/Components/Checkbox.vue

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
:checked="value"
99
type="checkbox"
1010
:readonly="readonly"
11-
@change="liveValue = $event.target.checked"
11+
@change="liveValue = ($event.target as HTMLInputElement).checked"
1212
/>
1313
<label class="custom-control-label form-label" :for="name">{{ label }}</label>
1414

@@ -19,36 +19,18 @@
1919
</div>
2020
</template>
2121

22-
<script>
23-
export default {
24-
name: 'EditorCheckbox',
25-
props: {
26-
value: {
27-
type: Boolean,
28-
},
29-
name: {
30-
type: String,
31-
},
32-
id: {
33-
type: String,
34-
},
35-
required: {
36-
type: Boolean,
37-
},
38-
readonly: {
39-
type: Boolean,
40-
},
41-
label: {
42-
type: String,
43-
},
44-
mode: {
45-
type: String,
46-
},
47-
},
48-
data() {
49-
return {
50-
liveValue: this.value,
51-
};
52-
},
53-
};
22+
<script setup lang="ts">
23+
import { ref } from 'vue';
24+
25+
const props = defineProps<{
26+
value?: boolean;
27+
name?: string;
28+
id?: string;
29+
required?: boolean;
30+
readonly?: boolean;
31+
label?: string;
32+
mode?: string;
33+
}>();
34+
35+
const liveValue = ref(props.value);
5436
</script>

0 commit comments

Comments
 (0)