Compare commits

...

8 Commits

Author SHA1 Message Date
Dan Brown
606f9d92d0 Updated version and assets for release v24.02.3 2024-04-05 15:20:08 +01:00
Dan Brown
a5e25abb9c Merge branch 'v24-02' into release 2024-04-05 15:19:34 +01:00
Dan Brown
3e23f456fe CSS: Removed redundant calc 2024-04-05 15:18:58 +01:00
Dan Brown
b9e2d33ed4 Page Content: Aligned max-width across viewer and editors
For #4916
2024-04-05 15:06:08 +01:00
Dan Brown
19f78dbe6c WYSIWYG descriptions: Allowed anchor target attrs
Allowed since this is a control in the editor UI, but would previously
be stripped by editor config & server-side filtering.
For #4925
2024-04-03 16:46:53 +01:00
Dan Brown
a33dbcb04a References: Fixed references count/list recycle bin interaction
Count and reference list would get references then attempt to load
entities, which could fail to load if in the recycle bin.
This updates the queries to effectively ignore references for items we
can't see (in recycle bin).
Added test to cover.

For #4918
2024-04-01 17:08:53 +01:00
Dan Brown
58f6219cb3 Code: Fixed highlighting issues when no code language set
For #4917
2024-03-31 14:33:08 +01:00
Dan Brown
b310e87e4c Updated version and assets for release v24.02.2 2024-03-11 14:30:48 +00:00
12 changed files with 81 additions and 52 deletions

View File

@@ -41,7 +41,8 @@ class ReferenceFetcher
{
$baseQuery = Reference::query()
->where('to_type', '=', $entity->getMorphClass())
->where('to_id', '=', $entity->id);
->where('to_id', '=', $entity->id)
->whereHas('from');
return $this->permissions->restrictEntityRelationQuery(
$baseQuery,

View File

@@ -20,7 +20,7 @@ class HtmlDescriptionFilter
*/
protected static array $allowedAttrsByElements = [
'p' => [],
'a' => ['href', 'title'],
'a' => ['href', 'title', 'target'],
'ol' => [],
'ul' => [],
'li' => [],

50
public/dist/app.js vendored

File diff suppressed because one or more lines are too long

32
public/dist/code.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -48,14 +48,16 @@ function highlightElem(elem) {
const content = elem.textContent.trimEnd();
let langName = '';
let innerCodeDirection = '';
if (innerCodeElem !== null) {
langName = innerCodeElem.className.replace('language-', '');
innerCodeDirection = innerCodeElem.getAttribute('dir');
}
const wrapper = document.createElement('div');
elem.parentNode.insertBefore(wrapper, elem);
const direction = innerCodeElem.getAttribute('dir') || elem.getAttribute('dir') || '';
const direction = innerCodeDirection || elem.getAttribute('dir') || '';
if (direction) {
wrapper.setAttribute('dir', direction);
}

View File

@@ -348,7 +348,7 @@ export function buildForInput(options) {
toolbar: 'bold italic link bullist numlist',
content_style: getContentStyle(options),
file_picker_types: 'file',
valid_elements: 'p,a[href|title],ol,ul,li,strong,em,br',
valid_elements: 'p,a[href|title|target],ol,ul,li,strong,em,br',
file_picker_callback: filePickerCallback,
init_instance_callback(editor) {
addCustomHeadContent(editor.getDoc());

View File

@@ -128,8 +128,9 @@
body {
display: block;
background-color: #fff;
padding-inline-start: 16px;
padding-inline-end: 16px;
padding-inline-start: 12px;
padding-inline-end: 12px;
max-width: 864px;
}
[drawio-diagram]:hover {
outline: 2px solid var(--color-primary);

View File

@@ -21,6 +21,7 @@
padding-block-end: 1rem;
outline: 0;
display: block;
max-width: 870px;
}
.wysiwyg-input.mce-content-body {

View File

@@ -266,8 +266,8 @@ class BookTest extends TestCase
{
$book = $this->entities->book();
$input = '<h1>Test</h1><p id="abc" href="beans">Content<a href="#cat" data-a="b">a</a><section>Hello</section></p>';
$expected = '<p>Content<a href="#cat">a</a></p>';
$input = '<h1>Test</h1><p id="abc" href="beans">Content<a href="#cat" target="_blank" data-a="b">a</a><section>Hello</section></p>';
$expected = '<p>Content<a href="#cat" target="_blank">a</a></p>';
$this->asEditor()->put($book->getUrl(), [
'name' => $book->name,

View File

@@ -271,7 +271,31 @@ class ReferencesTest extends TestCase
}
}
protected function createReference(Model $from, Model $to)
public function test_reference_from_deleted_item_does_not_count_or_show_in_references_page()
{
$page = $this->entities->page();
$referencingPageA = $this->entities->page();
$referencingPageB = $this->entities->page();
$this->asEditor();
$this->createReference($referencingPageA, $page);
$this->createReference($referencingPageB, $page);
$resp = $this->get($page->getUrl());
$resp->assertSee('Referenced by 2 items');
$this->delete($referencingPageA->getUrl());
$resp = $this->get($page->getUrl());
$resp->assertSee('Referenced by 1 item');
$resp = $this->get($page->getUrl('/references'));
$resp->assertOk();
$resp->assertSee($referencingPageB->getUrl());
$resp->assertDontSee($referencingPageA->getUrl());
}
protected function createReference(Model $from, Model $to): void
{
(new Reference())->forceFill([
'from_type' => $from->getMorphClass(),

View File

@@ -1 +1 @@
v24.02
v24.02.3