Skip to content

Commit

Permalink
publish wix window frontend getAppPageData function for app reflow
Browse files Browse the repository at this point in the history
* Published by the Tech Writer Single Sourcing Tool

* Published by the Tech Writer Single Sourcing Tool

* DocWorks for js-wixcode-sdk - 2 changes detected, but 14 issue detected
changes:
Service wix-window-frontend has a new operation getAppPageData
Service wix-window has a new operation getAppPageData

issues:
Message ViewChangeEventOptions has an unknown property type * (ApppointmentFieldEvent.js (8))
Operation postMessage has an unknown param type * (HtmlComponent.js (97))
Property data has an unknown type * (HtmlComponentMessageEvent.js (16))
Property fileLimit has mismatching types for get (number) and set (string) (UploadButton.js (128, 149))
Operation set has an unknown param type * (window-frontend.js (201))
Operation get has an unknown return type * (window-frontend.js (234))
Operation set has an unknown param type * (window.js (235))
Operation get has an unknown return type * (window.js (269))
Callback ViewChangeOperation is defined two or more times (AppointmentField.js (347), DatePicker.js (471))
Callback ViewChangeOperation has an unknown return type * (AppointmentField.js (347))
Callback ViewChangeEventHandler is defined two or more times (AppointmentField.js (362), DatePicker.js (465))
Callback Validator has an unknown param type * (ValidatableMixin.js (143))
Property value has an unknown type * (ValueMixin.js (62))
Property value has an unknown type * (ValueMixin.js (89))

* Published by the Tech Writer Single Sourcing Tool

---------

Co-authored-by: Wix Tech Writers <[email protected]>
Co-authored-by: Adam Friedmann <[email protected]>
  • Loading branch information
3 people authored Sep 21, 2023
1 parent 6024ce5 commit 925085e
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 2 deletions.
41 changes: 40 additions & 1 deletion js-wixcode-sdk/wix-window-frontend.service.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ "name": "wix-window-frontend",
"mixes": [],
"labels": [],
"labels":
[ "changed" ],
"location":
{ "lineno": 1,
"filename": "window-frontend.js" },
Expand Down Expand Up @@ -399,6 +400,44 @@
{ } },
"extra":
{ } },
{ "name": "getAppPageData",
"labels":
[ "new" ],
"nameParams": [],
"params": [],
"ret":
{ "type": "Object",
"doc": "The data passed to the app page." },
"locations":
[ { "lineno": 1412,
"filename": "window-frontend.js" } ],
"docs":
{ "summary": "Returns the data passed to a [custom app page](https://dev.wix.com/docs/develop-websites/articles/wix-apps/build-a-custom-wix-business-app-page).",
"description":
[ "Wix passes data to custom app pages that you can use when implementing the page's business logic.",
"Call the `getAppPageData()` function to retrieve the data and use it in your code.",
"The data retrieved by this function is different for each type of custom app page.",
"For more information, see [App Page Data](#app-page-data).",
"",
"Learn more about [building custom app pages](https://dev.wix.com/docs/develop-websites/articles/wix-apps/build-a-custom-wix-business-app-page).",
"",
"If you call the `getAppPageData()` function in the code for a page that isn't",
"a custom app page, the function returns `null`." ],
"links": [],
"examples":
[ { "title": "Get the data passed to a custom app page",
"body":
[ "import wixWindow from 'wix-window';",
"",
"// ...",
"",
"let appData = wixWindow.getAppPageData(); // {nextSection: {sectionId: \"Booking Form\"}}" ],
"extra":
{ } } ],
"extra":
{ } },
"extra":
{ } },
{ "name": "getBoundingRect",
"labels": [],
"nameParams": [],
Expand Down
29 changes: 29 additions & 0 deletions js-wixcode-sdk/wix-window-frontend/guides/App Page Data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!-- This article was published using the Doc Push single-sourcing tool. Any changes to this article MUST be made in the source file. Find it at www.github.com/wix-private/velo-docs.-->

# App Page Data

You can use the [`getAppPageData()`](/wix-window-frontend/getapppagedata) function in code for [custom app pages](https://dev.wix.com/docs/develop-websites/articles/wix-apps/build-a-custom-wix-business-app-page) to retrieve data you can use to customize the page. The data passed to each type of custom app page is different. This article lists the objects passed to each type of custom app page.

## Booking Service Page

The object passed to a custom Booking Service page contains the following properties:

| Name | Type | Description |
| --- | --- | --- |
| `service` | Object | The [Service object](https://dev.wix.com/docs/rest/api-reference/wix-bookings/services-v-2/service-object), which contains detailed data about the service. |

> **Note**: If the page URL specifies a service that is deleted, hidden, or does not exist, the app returns `null`.
Learn more about [building a custom Service page](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-bookings/build-a-custom-booking-service-page).

## Booking Calendar Page

The object passed to a custom Booking Calendar page contains the following properties:

| Name | Type | Description |
| --- | --- | --- |
| `service` | Object | The [Service object](https://dev.wix.com/docs/rest/api-reference/wix-bookings/services-v-2/service-object), which contains detailed data about the service. |

> **Note**: If the page URL specifies a service that is deleted, hidden, or does not exist, the app returns `null`.
Learn more about [building a custom Calendar page](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-bookings/build-a-custom-booking-calendar-page).
41 changes: 40 additions & 1 deletion js-wixcode-sdk/wix-window.service.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ "name": "wix-window",
"mixes": [],
"labels": [],
"labels":
[ "changed" ],
"location":
{ "lineno": 1,
"filename": "window.js" },
Expand Down Expand Up @@ -467,6 +468,44 @@
{ } },
"extra":
{ } },
{ "name": "getAppPageData",
"labels":
[ "new" ],
"nameParams": [],
"params": [],
"ret":
{ "type": "Object",
"doc": "The data passed to the app page." },
"locations":
[ { "lineno": 1511,
"filename": "window.js" } ],
"docs":
{ "summary": "Returns the data passed to a [custom app page]().",
"description":
[ "Wix passes data to custom app pages that you can use when implementing the page's business logic.",
"Call the `getAppPageData()` function to retrieve the data and use it in your code.",
"The data retrieved by this function is different for each type of custom app page.",
"For more information, see [App Page Data](#app-page-data).",
"",
"Learn more about [building custom app pages]().",
"",
"If you call the `getAppPageData()` function in the code for a page that isn't",
"a custom app page, the function returns `null`." ],
"links": [],
"examples":
[ { "title": "Get the data passed to a custom app page",
"body":
[ "import wixWindow from 'wix-window';",
"",
"// ...",
"",
"let appData = wixWindow.getAppPageData(); // {nextSection: {sectionId: \"Booking Form\"}}" ],
"extra":
{ } } ],
"extra":
{ } },
"extra":
{ } },
{ "name": "getBoundingRect",
"labels": [],
"nameParams": [],
Expand Down

0 comments on commit 925085e

Please sign in to comment.