Skip to content

Commit b47d4f6

Browse files
committed
docs: update banner notification docs
1 parent ff88ffa commit b47d4f6

1 file changed

Lines changed: 3 additions & 49 deletions

File tree

docs/appNotifications/readme.md

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ A sample json is as follows:
2525
{
2626
"SAMPLE_NOTIFICATION_NAME": {
2727
"DANGER_SHOW_ON_EVERY_BOOT" : false,
28+
"PRO_EDITION_ONLY" : false,
2829
"HTML_CONTENT": "<div>hello world <a class='notification_ack'>Click to acknowledge.</a></div>",
2930
"FOR_VERSIONS": "1.x || >=2.5.0 || 5.0.0 - 7.2.3",
3031
"PLATFORM" : "allDesktop"
@@ -37,6 +38,8 @@ A sample json is as follows:
3738
or there is an html element with class `notification_ack`.
3839

3940
1. `SAMPLE_NOTIFICATION_NAME` : This is a unique ID. It is used to check if the notification was shown to user.
41+
2. `PRO_EDITION_ONLY` : (Default false) Setting this to true will not show the notification on community editions.
42+
Only works in versions > 5.0.0 - so combine it with that is must!
4043
2. `DANGER_SHOW_ON_EVERY_BOOT` : (Default false) Setting this to true will cause the
4144
notification to be shown on every boot. This is bad ux and only be used if there is a critical security issue
4245
that we want the version not to be used.
@@ -48,52 +51,3 @@ A sample json is as follows:
4851
The notification will be shown to all versions satisfying this.
4952
5. `PLATFORM`: A comma seperated list(no spaces) of all platforms in which the message will be shown.
5053
allowed values are: `mac,win,linux,allDesktop,firefox,chrome,safari,allBrowser,all`
51-
52-
53-
## toast notifications - `toast.json`
54-
55-
Toast notifications are shown at the side on the general notification area. Multiple toast notifications
56-
can be shown at the same time. Format is similar to banner notification.
57-
58-
By default, a notification is shown only once and auto close after 25 seconds.
59-
If there is an html element with class `notification_ack` it must be clicked to be dismissed,
60-
else it will come up after every boot till it is acknowledged or the close button clicked.
61-
62-
### Format of `<stage>/root/toast.json`
63-
64-
> <Not yet implemented. Just use the spec below.>
65-
66-
`<stage>` can be `staging` or `prod`. (`dev` stage is directly in phoenix codebase for ease of development.)
67-
68-
A sample json is as follows:
69-
```json
70-
{
71-
"SAMPLE_NOTIFICATION_NAME": {
72-
"TRIGGER" : "MENU_CLICK:file.newFolder,HTML_ELEMENT:#project-files-container",
73-
"TYPE": "ERROR/WARN/INFO/SUCCESS",
74-
"HTML_CONTENT": "<div>hello world <a class='notification_ack'>Click to acknowledge.</a></div>",
75-
"FOR_VERSIONS": "1.x || >=2.5.0 || 5.0.0 - 7.2.3",
76-
"PLATFORM" : "allDesktop",
77-
"autoCloseTimeS": 25
78-
},
79-
"ANOTHER_SAMPLE_NOTIFICATION_NAME": {...}
80-
}
81-
```
82-
83-
1. `SAMPLE_NOTIFICATION_NAME` : This is a unique ID. It is used to check if the notification was shown to user.
84-
2. `TRIGGER` : The trigger to show the notification. Can be a comma seperated list of one of the following
85-
`APP_START/MENU_CLICK:<commandID>/KEYBOARD_SHORTCUT:<commandID>/OTHER:<commandID>/HTML_ELEMENT:<.class/#id>`
86-
1. `APP_START` : notification will be shown on app start.
87-
2. `MENU_CLICK:<commandID>` : When a command is executed by clicking on a ui menu item.
88-
3. `KEYBOARD_SHORTCUT:<commandID>` : When a command is executed by keyboard shortcut.
89-
4. `HTML_ELEMENT:<jquery selector>` : On click on the given html element with jquery selector.
90-
3. `TYPE` : Can be one of `ERROR/WARN/INFO/SUCCESS`.
91-
4. `HTML_CONTENT`: The actual html content to show to the user. It can have an optional `notification_ack` class.
92-
Setting this class in any child html node will cause the notification to be shown once a day until the user explicitly clicks
93-
on any html element with class `notification_ack` or explicitly click the close button.
94-
If such a class is not present, then the notification is shown only once ever.
95-
4. `FOR_VERSIONS` : [Semver compatible version filter](https://www.npmjs.com/package/semver).
96-
The notification will be shown to all versions satisfying this.
97-
5. `PLATFORM`: A comma seperated list(no spaces) of all platforms in which the message will be shown.
98-
allowed values are: `mac,win,linux,allDesktop,firefox,chrome,safari,allBrowser,all`
99-
6. `autoCloseTimeS`: Time to auto close the popup in seconds

0 commit comments

Comments
 (0)