Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Components/DLM/BExIS.Dlm.Entities/Data/EntityTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ public class EntityTemplate : BaseEntity
/// </summary>
public virtual string Description { get; set; }

/// <summary>
/// Description of the Entity Template
/// </summary>
public virtual int Order { get; set; }

/// <summary>
/// Entity
/// </summary>
Expand Down Expand Up @@ -169,7 +174,7 @@ public EntityTemplate()
PermissionGroups = new PermissionsType();
NotificationGroups = new List<long>();
MetadataInvalidSaveMode = true;

Order = 0;
JsonAllowedFileTypes = "";
JsonDatastructureList = "";
JsonDisabledHooks = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
<column name="Description" sql-type="text" />
</property>

<property name="Order" type="Int32">
<column name="OrderNr"/>
</property>

<property name="MetadataInvalidSaveMode" type="Boolean">
<column name="MetadataInvalidSaveMode" />
</property>
Expand Down
2 changes: 1 addition & 1 deletion Console/BExIS.Web.Shell.Svelte/src/components/entry.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<div id={entry.key} on:mouseover={() => helpStore.show(entry.key)}>
<MultiSelect
id={entry.key}
title={entry.key}
title={entry.title + ' (key: ' + entry.key + ')'}
source={entry.options}
bind:target={entry.value}
isMulti={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@

function errorHandler(e) {
resetInformations();
error = e.detail.messages;
error = e.detail.messages.filter((item) => item != null && item != undefined && item != '');

}

function successHandler(e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export interface EntityTemplateModel {
id: number;
name: string;
description: string;
order: number;
entityType: ListItem;
metadataStructure: ListItem;
metadataFields: number[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<!-- svelte-ignore a11y-click-events-have-key-events -->

<div
<div role="button" tabindex="0"
class="flex gap-5 border-b-violet-700 p-5 shadow-md ring-1 ring-gray-900/5
hover:bg-primary-100 space-x-100 active:bg-primary-300"
on:click
Expand All @@ -26,18 +26,16 @@ hover:bg-primary-100 space-x-100 active:bg-primary-300"
<h3 class="h3">{name}</h3>
<span class="text-sm">{description}</span>
</div>
<div class="flex-none text-right">
<div class="flex gap-2">
<!--{#if inUse}
<span class="badge variant-filled-error">in use</span>
{/if}-->
<span class="badge variant-filled-surface">{metadataStructure.text}</span>
<span class="badge variant-filled-secondary">{entityType.text}</span>
</div>
<div class="h-content">
<b>
{allowedFileTypes.join(', ')}
</b>
<div class="flex flex-col gap-2 text-end">

<div >
<span class="badge variant-filled-surface">{metadataStructure.text}</span>
<span class="badge variant-filled-secondary">{entityType.text}</span>
</div>
<div class="h-content text-end">
<b>
{allowedFileTypes.join(', ')}
</b>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
export let linkedSubjects = [];
export let allowedFileTypes = [];
export let activated = false;
export let order = 0;

let hidden = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// ui Components
import Fa from 'svelte-fa';
import { DropdownKVP, MultiSelect, TextArea, TextInput, Spinner } from '@bexis2/bexis2-core-ui';
import { DropdownKVP, MultiSelect, TextArea, TextInput, Spinner, NumberInput } from '@bexis2/bexis2-core-ui';
import { faSave, faXmark } from '@fortawesome/free-solid-svg-icons/index';
import { SlideToggle } from '@skeletonlabs/skeleton';
import ContentContainer from '../../lib/components/ContentContainer.svelte';
Expand Down Expand Up @@ -176,6 +176,7 @@
placeholder="Define a unique content-related name for your template."
help={true}
/>


<DropdownKVP
id="entityType"
Expand Down Expand Up @@ -203,6 +204,12 @@
placeholder="Briefly describe in which cases this template should be used. Based on an entity or use case."
help={true}
/>

<NumberInput
id="order"
label="Order"
bind:value={entityTemplate.order}
/>
</div>

<h3 class="h3">Metadata</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ public JsonResult GetEntityTemplateList()
List<EntityTemplateModel> entityTemplateModels = new List<EntityTemplateModel>();
using (var entityTemplateManager = new EntityTemplateManager())
{
foreach (var e in entityTemplateManager.Repo.Query(e=>e.Activated).ToList())
foreach (var e in entityTemplateManager.Repo.Query(e=>e.Activated).OrderBy(e=>e.Order).ToList())
{
entityTemplateModels.Add(EntityTemplateHelper.ConvertTo(e, false));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Telerik.Web.Mvc.Extensions;
using Vaiona.Web.Extensions;

namespace BExIS.Modules.Dcm.UI.Controllers
Expand Down Expand Up @@ -49,7 +50,9 @@ public JsonResult Load()
List<EntityTemplateModel> entityTemplateModels = new List<EntityTemplateModel>();
using (var entityTemplateManager = new EntityTemplateManager())
{
foreach (var e in entityTemplateManager.Repo.Get())
var l = entityTemplateManager.Repo.Query().OrderBy(e => e.Order).ToList();

foreach (var e in l)
{
entityTemplateModels.Add(EntityTemplateHelper.ConvertTo(e));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public static EntityTemplate ConvertTo(EntityTemplateModel model)
entityTemplate.NotificationGroups = model.NotificationGroups;
entityTemplate.MetadataFields = model.MetadataFields;
entityTemplate.Activated = model.Activated;
entityTemplate.Order = model.Order;

// load entites
// metadata
Expand Down Expand Up @@ -68,6 +69,7 @@ public static EntityTemplate Merge(EntityTemplateModel model)
entityTemplate.NotificationGroups = model.NotificationGroups;
entityTemplate.MetadataFields = model.MetadataFields;
entityTemplate.Activated = model.Activated;
entityTemplate.Order = model.Order;

// load entites
// metadata
Expand Down Expand Up @@ -98,6 +100,8 @@ public static EntityTemplateModel ConvertTo(EntityTemplate entityTemplate, bool
model.NotificationGroups = entityTemplate.NotificationGroups != null ? entityTemplate.NotificationGroups : new List<long>();
model.MetadataFields = entityTemplate.MetadataFields != null ? entityTemplate.MetadataFields : new List<int>();
model.Activated = entityTemplate.Activated;
model.Order = entityTemplate.Order;



var xmlDatasetHelper = new XmlDatasetHelper();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public class EntityTemplateModel
/// </summary>
public string Description { get; set; }

/// <summary>
/// Order of the Entity Template in the list of templates
/// </summary>
public int Order { get; set; }

/// <summary>
/// Entity
/// </summary>
Expand Down Expand Up @@ -101,6 +106,7 @@ public EntityTemplateModel()

LinkedSubjects = new List<ListItem>();
InUse = false;
Order = 0;
}

public class KvP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
}
}
</script>
{#if dwcExtensions && isActive}

<div class="flex items-end gap-2 mt-4 mb-2 bg-gray-50 p-2 rounded-md border border-gray-200">
{#if dwcExtensions && isActive}
<MultiSelect
id="check_dwc"
title="Check Darwin Core Requirements"
Expand Down Expand Up @@ -76,5 +76,6 @@
<div><span class="chip variant-filled-success">All required fields are set.</span></div>
{/if}
{/if}
{/if}
</div>
{/if}

Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public ActionResult Create(string file, long entityId = 0, long structureId = 0,
ViewData["enforcePrimaryKey"] = enforcePrimaryKey;

bool showDarwinCoreValidation = (bool)ModuleManager.GetModuleSettings("RPM").GetValueByKey("showDarwinCoreValidation");
ViewData["showDarwinCoreValidation"] = enforcePrimaryKey;
ViewData["showDarwinCoreValidation"] = showDarwinCoreValidation;

return View("Create");
}
Expand Down Expand Up @@ -169,7 +169,7 @@ public ActionResult Edit(long structureId = 0)
ViewData["enforcePrimaryKey"] = enforcePrimaryKey;

bool showDarwinCoreValidation = (bool)ModuleManager.GetModuleSettings("RPM").GetValueByKey("showDarwinCoreValidation");
ViewData["showDarwinCoreValidation"] = enforcePrimaryKey;
ViewData["showDarwinCoreValidation"] = showDarwinCoreValidation;

ViewData["dataExist"] = structureHelper.InUseAndDataExist(structureId);

Expand Down
6 changes: 6 additions & 0 deletions database update scripts/4.2.1-4.3.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ INSERT INTO public.versions(
versionno, extra, module, value, date)
VALUES (1, null, 'Shell', '4.3.0',NOW());


--- operations for new features
INSERT INTO public.operations (versionno, extra, module, controller, action, featureref)
SELECT 1, NULL, 'DDM', 'metadiff', '*', null
WHERE NOT EXISTS (SELECT * FROM public.operations WHERE module='DDM' AND controller='metadiff');
Expand All @@ -29,4 +31,8 @@ INSERT INTO public.operations (versionno, extra, module, controller, action, fea
SELECT 1, NULL, 'DCM', 'componentconfig', '*', null
WHERE NOT EXISTS (SELECT * FROM public.operations WHERE module='DCM' AND controller='componentconfig');

-- add order column in entity template table
ALTER TABLE entitytemplates
ADD COLUMN "ordernr" INTEGER;

commit;
Loading