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
4 changes: 2 additions & 2 deletions allterrain-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: AllTerrain Forms
* Plugin URI: https://github.com/AllTerrainDeveloper/forms
* Description: Forms for WordPress with every premium feature free — conditional logic, calculations, multi-page, file uploads, signatures, repeaters, entry management, ten themes — built as an OpenStation desktop app with a drag-and-drop builder.
* Version: 1.2.0
* Version: 1.2.1
* Requires at least: 6.9
* Requires PHP: 7.4
* Requires Plugins: desktop-mode
Expand Down Expand Up @@ -55,7 +55,7 @@

defined( 'ABSPATH' ) || exit;

define( 'ALLTFO_VERSION', '1.2.0' );
define( 'ALLTFO_VERSION', '1.2.1' );
define( 'ALLTFO_FILE', __FILE__ );
define( 'ALLTFO_DIR', plugin_dir_path( __FILE__ ) );
define( 'ALLTFO_URL', plugin_dir_url( __FILE__ ) );
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "allterrain-forms",
"version": "1.2.0",
"version": "1.2.1",
"private": true,
"description": "Forms for WordPress with every premium feature free, as an OpenStation desktop app.",
"license": "GPL-2.0-or-later",
Expand Down
11 changes: 10 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Requires at least: 6.9
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: desktop-mode
Stable tag: 1.2.0
Stable tag: 1.2.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -327,6 +327,12 @@ API, importer hooks, and a REST namespace. Full reference in the repository.

== Changelog ==

= 1.2.1 =

* Fixed the Recent submissions desktop widget failing to mount in OpenStation because its callback was absent from the widget registry.
* Preserved other plugins' registered widgets and compatibility with older Desktop Mode builds.
* Thanks to Juan Lentino for the fix in PR #60.

= 1.2.0 =

* Build forms on your phone: open "Add a field", tap a field type, and edit it in a full-width inspector with a Done button to return to the canvas.
Expand Down Expand Up @@ -367,6 +373,9 @@ API, importer hooks, and a REST namespace. Full reference in the repository.

== Upgrade Notice ==

= 1.2.1 =
Restores the Recent submissions desktop widget in OpenStation. No form or entry data changes.

= 1.2.0 =
Build and edit forms comfortably on your phone, with tap-to-add fields, full-width editing panels and reachable Save controls. Existing forms and saved data keep their current format.

Expand Down
47 changes: 47 additions & 0 deletions tests/vitest/widget-registry.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* OpenStation resolves widget callbacks by ID after loading the bundle. A
* working standalone export does not help if that global registration is absent.
*/

import { afterEach, describe, expect, it, vi } from 'vitest';

type Registry = Record< string, ( host: HTMLElement ) => unknown >;
type RegistryWindow = Window & {
openStationWidgets?: Registry;
desktopModeWidgets?: Registry;
};

const host = window as RegistryWindow;

afterEach( () => {
delete host.openStationWidgets;
delete host.desktopModeWidgets;
vi.resetModules();
} );

describe( 'Recent submissions widget registration', () => {
it( 'adds its mount callback without removing another OpenStation widget', async () => {
const other = vi.fn();
const registry: Registry = { 'other/widget': other };
host.openStationWidgets = registry;

const widget = await import( '../../src/widget' );

expect( host.openStationWidgets ).toBe( registry );
expect( host.openStationWidgets[ 'other/widget' ] ).toBe( other );
expect( host.openStationWidgets[ 'allterrain-forms/recent' ] ).toBe( widget.renderWidget );
expect( widget.render ).toBe( widget.renderWidget );
expect( host.desktopModeWidgets ).toBe( registry );
} );

it( 'reuses the legacy registry when OpenStation has not created one', async () => {
const registry: Registry = { 'legacy/widget': vi.fn() };
host.desktopModeWidgets = registry;

const widget = await import( '../../src/widget' );

expect( host.openStationWidgets ).toBe( registry );
expect( host.desktopModeWidgets[ 'legacy/widget' ] ).toBeDefined();
expect( host.desktopModeWidgets[ 'allterrain-forms/recent' ] ).toBe( widget.renderWidget );
} );
} );
Loading