Sealgen changelog

2024-06-06 • v0.15.17 • 65fec8010eab

The File and Photo control types in forms no longer make the <inputs required if they already have an „old” value. This issue was reported by @ziomek :pray:

To use the fixed version, run npm install --save @sealcode/sealgen@0.15.17

2024-06-08 • v0.15.18 • ddca246d68

Make it so the isValueValid method isn’t run on a field if its value is empty. This helps prevent some form errors appearing even if there are no actual errors in the form

2024-06-08 • v0.15.19 • 5db79116

Fix an issue where .parse was not taking empty values into consideration. It used to be the case that empty values were passed to .parse and gave weird results, especially with CollectionFields, where they run a Sealious Field .parse function that assumes the value is not empty.

This change introduces a small change in the field API - now the getValue function takes an optional third boolean argument. Set it to true to include validation result in the output of the function

v0.15.20

Simplified constructor argument for the Checkbox form control

v0.15.21

Put the error messages of the form in the application log for easier debugging

v0.15.22

Make the debug log more verbose for test errors

v0.15.23

Make the checkboxed list form control not hide label and field errors

1 Like

v0.15.24

  • Add control type to class list of form control containers to help with contextual styling

  • Fix a crash when displaying sealious-list pages that I’ve accidentally introduced yesterday (cc @ziomek). Add tests to prevent regression in that regard

  • Add a new TestOnRealApp helper. Now you can test sealgen CLI and features on a sealious app end-to-end with a much simplified syntax:

describe("add route test", () => {
	it("creates minimal sealious app and adds a simple route that works", async function () {
		const test_app = await RealAppTest.init();

		const path = "/sample";
		await test_app.runSealgenCommand(`add-route --url=${path} --action=Sample --mode=page`);
		await test_app.start();
		const res = await test_app.httpGet(path);
		if (res.status != 200) {
			throw new Error("url generated by add-route exists but doesn't return 200");
		}
		await test_app.close();
	}).timeout(100 * 1000);
});

v0.15.25

Add more classes to make styling forms easier

v0.15.26

Show checkboxed-list errors at the top of the list so they don’t get cut out by overflow in certain cases

v0.15.27

Make the form class use getInitialValues to populate the form after successful submission. This resolves an issue where after editing a photo in a form the old photo remained visible until the page is refreshed

v0.15.28 and v0.15.29

Changes to how image thumbnail is displayed in image form control. It’s now cropped with SmartCrop to always be a neat square.

v0.15.30

Sealgen now supports FormControls for SingleReference fields in shape of a dropdown with customizable labels.

Use it like so in the controls array of the form:

new Controls.SingleReferenceDropdown(
    fields.article, 
    { getLabel: item => item.get("title") }
)

In the above example, fields.article is a CollectionField that points to a SingleReference field.

Implemented by @FilipI and e2e-tested by @kuba-orlik

v0.15.31

Fix the sealious-list template to make auto-generated text list filters to work with partial matches.

This changes the API for DefaultList filters. You need to change

	{ field: "name", render: DefaultListFilters["text"] },

to

	{ field: "name", ...DefaultListFilters["text"] },

in filterFields. The ListFilter is now not only a function for rendering the control, but an object that contains the render function and optionally a prepareValue function. So, in places when you get access to the render function, you need to change

render = DefaultListFilters.fallback;

to

render = DefaultListFilters.fallback.render;

Here you can see the filter in action:

v0.15.32, v0.15.33

The getParsedValues on form now returns proper TS types when used with CollectionFields. It also takes into consideration whether or not the field is required

v0.15.34

Added withFallback method for easier setup of values for forms when some values can be null but shouldn’t from the form’s perspective