mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 21:20:45 +00:00
Try to make happier when scripts & apis don't live together
This commit is contained in:
@ -382,7 +382,6 @@ public class ScriptsMetaDataProvider
|
||||
.withRecordLabelFormat("%s v%s")
|
||||
.withRecordLabelFields(List.of("scriptId", "sequenceNo"))
|
||||
.withSection(new QFieldSection("identity", new QIcon().withName("badge"), Tier.T1, List.of("id", "scriptId", "sequenceNo")))
|
||||
.withSection(new QFieldSection("api", "API", new QIcon().withName("code"), Tier.T2, List.of("apiName", "apiVersion")))
|
||||
.withSection(new QFieldSection("code", new QIcon().withName("data_object"), Tier.T2, List.of("contents")))
|
||||
.withSection(new QFieldSection("changeManagement", new QIcon().withName("history"), Tier.T2, List.of("commitMessage", "author")))
|
||||
.withSection(new QFieldSection("dates", new QIcon().withName("calendar_month"), Tier.T3, List.of("createDate", "modifyDate")));
|
||||
@ -390,6 +389,23 @@ public class ScriptsMetaDataProvider
|
||||
tableMetaData.getField("contents").withFieldAdornment(new FieldAdornment(AdornmentType.CODE_EDITOR).withValue(AdornmentType.CodeEditorValues.languageMode("javascript")));
|
||||
tableMetaData.getField("scriptId").withFieldAdornment(AdornmentType.Size.LARGE.toAdornment());
|
||||
|
||||
try
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// if the api module is loaded, then add a section to the table for the api name & version fields //
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
Class.forName("com.kingsrook.qqq.api.model.metadata.ApiInstanceMetaDataProvider");
|
||||
tableMetaData.getSections().add(1, new QFieldSection("api", "API", new QIcon().withName("code"), Tier.T2, List.of("apiName", "apiVersion")));
|
||||
}
|
||||
catch(ClassNotFoundException e)
|
||||
{
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// if the api module is not loaded, then make sure we don't have these fields in our scripts table //
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
tableMetaData.getFields().remove("apiName");
|
||||
tableMetaData.getFields().remove("apiVersion");
|
||||
}
|
||||
|
||||
return (tableMetaData);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user