fixing various stuff
This commit is contained in:
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"main.js": {
|
||||
"file": "assets/main.96863591.js",
|
||||
"file": "assets/main.28b0c00f.js",
|
||||
"src": "main.js",
|
||||
"isEntry": true,
|
||||
"css": [
|
||||
|
||||
@@ -32,10 +32,29 @@
|
||||
function removeReference(e, recordId) {
|
||||
e.preventDefault();
|
||||
graph.edges = graph.edges.filter(
|
||||
(edge) => !(edge.target === recordId && edge.field === field.name)
|
||||
(edge) => !(edge.source === record.id && edge.target === recordId && edge.field === field.name)
|
||||
);
|
||||
}
|
||||
|
||||
function sendToTop(e, recordId) {
|
||||
e.preventDefault();
|
||||
let ref = graph.edges.find(
|
||||
(edge) => edge.source === record.id && edge.target === recordId && edge.field === field.name
|
||||
);
|
||||
removeReference(e, recordId);
|
||||
graph.edges = [ref, ...graph.edges];
|
||||
}
|
||||
|
||||
function sendToBottom(e, recordId) {
|
||||
e.preventDefault();
|
||||
let ref = graph.edges.find(
|
||||
(edge) => edge.source === record.id && edge.target === recordId && edge.field === field.name
|
||||
);
|
||||
removeReference(e, recordId);
|
||||
graph.edges = [...graph.edges, ref];
|
||||
}
|
||||
|
||||
|
||||
function reorder(e) {
|
||||
graph.edges = sortByField(e.detail.source, e.detail.target, graph.edges, field.name);
|
||||
}
|
||||
@@ -88,7 +107,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<Sortable isTable={true} on:update={reorder}>
|
||||
{#each references as record (record.id)}
|
||||
{#each references as record,index (record.id)}
|
||||
<tr>
|
||||
<td class="">
|
||||
<div class="">
|
||||
@@ -121,6 +140,26 @@
|
||||
>
|
||||
<Icon icon="trash-can"/>
|
||||
</button>
|
||||
{#if references.length > 30 && index > 0}
|
||||
<button
|
||||
title="Send item to top"
|
||||
class="to-top-button text-dark btn btn-sm btn-link"
|
||||
on:click={(e) =>
|
||||
sendToTop(e, record.id)}
|
||||
>
|
||||
<Icon icon="circle-chevron-up"/>
|
||||
</button>
|
||||
{/if}
|
||||
{#if references.length > 30 && index + 1 < references.length}
|
||||
<button
|
||||
title="Send item to bottom"
|
||||
class="to-top-button text-dark btn btn-sm btn-link"
|
||||
on:click={(e) =>
|
||||
sendToBottom(e, record.id)}
|
||||
>
|
||||
<Icon icon="circle-chevron-down"/>
|
||||
</button>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/each}
|
||||
|
||||
@@ -68,9 +68,9 @@ class ImageService
|
||||
return $this->notFoundImage;
|
||||
}
|
||||
|
||||
$image->filter(new $this->channelService->channel->imageFilters[$template]);
|
||||
$image = $image->filter(new $this->channelService->channel->imageFilters[$template]);
|
||||
try {
|
||||
$image->encode('webp', 75);
|
||||
$image = $this->imageManager->make((string)$image->encode('webp', 75));
|
||||
$image->save($templateFilePath);
|
||||
} catch (Exception $e) {
|
||||
$this->logger->error($e->getMessage());
|
||||
|
||||
@@ -211,9 +211,9 @@ class RecordController extends Controller
|
||||
->limit(1)
|
||||
->skip(0)
|
||||
->childrenDepth(2)
|
||||
->childrenLimit(100)
|
||||
->childrenLimit(200)
|
||||
->parentsDepth(1)
|
||||
->parentsLimit(100)
|
||||
->parentsLimit(200)
|
||||
->run();
|
||||
|
||||
if ($graph->records->isEmpty()) {
|
||||
|
||||
@@ -107,7 +107,6 @@ readonly class RecordService
|
||||
bool $updateEdges = false
|
||||
): void
|
||||
{
|
||||
|
||||
$record = $this->query->filter(["id" => $id])->run()->records->first();
|
||||
|
||||
if (empty($record)) {
|
||||
|
||||
Reference in New Issue
Block a user