You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Notification Agent Core/Controllers/HelpBuilder.swift
+6-5Lines changed: 6 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,8 @@ public final class HelpBuilder {
20
20
"-icon_height".yellow(),
21
21
"-accessory_view_type".yellow(),
22
22
"-accessory_view_payload".yellow(),
23
-
"-secondary_accessory_view_type".yellow(),
24
-
"-secondary_accessory_view_payload".yellow(),
23
+
"-accessory_view_type_N".yellow(),
24
+
"-accessory_view_payload_N".yellow(),
25
25
"-main_button_label".yellow(),
26
26
"-main_button_cta_type".yellow(),
27
27
"-main_button_cta_payload".yellow(),
@@ -112,8 +112,8 @@ public final class HelpBuilder {
112
112
"Example 3: -accessory_view_payload \"/percent indeterminate /top_message This is the top message /bottom_message This is the bottom message\";\n"+
113
113
"Example 4: -accessory_view_payload \"<h1>Hello, world!</h1>this is a line of text<br><br><code>this is a code block<br>this is the second line of a code block</code><br>this is <span style=\"color: #ff0000\">red</span> text\"\n"+
"\n Same as for accessory_view_payload argument.",
115
+
"\n Same as for accessory_view_type argument. The tool support multiple accessory views on each pop-up;\n Example 1: accessory_view_type_1 image;\n Example 2: accessory_view_type_2 dropdown;",
116
+
"\n Same as for accessory_view_payload argument. The tool support multiple accessory views on each pop-up;\n Example 1: accessory_view_payload_1 \"path/or/URL/to/file\";\n Example 2: accessory_view_payload_2 \"/list One\\nTwo\\nThree\";",
117
117
"\n The label of the main button.\n Example: -main_button_label \"Main button title\"",
118
118
"[ none | link ]".red()+"\n The call to action type for the main button (default: none -> exit).\n Example: -main_button_cta_type link",
119
119
"\n An URL if "+"[ link ]".red()+" cta type defined.\n Example: -main_button_cta_payload \"URL\"",
@@ -180,7 +180,8 @@ public final class HelpBuilder {
180
180
"\n Flag that tells the agent to show the suppression future notifications button on the UI. If checked by the user the agent will print \"suppressed\" in the output before exit.\n Example: -showSuppressionButton"]
181
181
staticletpopupSyntacticRules:[String]=["At least one argument between"+" [ -title | -subtitle | -accessory_view_type + -accessory_view_payload ] ".red()+"must be defined to present a pop-up.",
182
182
"By default tertiary button is not destructive. Use "+"[ exitlink ]".red()+" cta type to trigger a link (optional) and make it destructive for the pop-up.",
183
-
"In general if a call to action type is defined for a button, must be defined also the related payload. Except for the cta types "+"[ none | exitlink ]".red()+"."]
183
+
"In general if a call to action type is defined for a button, must be defined also the related payload. Except for the cta types "+"[ none | exitlink ]".red()+".",
184
+
"To setup multiple accessory views on the pop-up use \"-accessory_view_type_N\" and \"-accessory_view_payload_N\" where N is an integer number that goes from 1 to 100. Use only sequential integers (CORRECT: 1, 2 ,3, 4, ... | WRONG: 1, 3, 5, 6, ...)."]
184
185
staticletbannerSyntacticRules:[String]=["At least one argument between"+" [ -title | -subtitle ] ".red()+"must be defined to present a banner.",
185
186
"In general if a call to action type is defined for a button, must be defined also the related payload."]
186
187
staticletsystemAlertSyntacticRules:[String]=["At least one argument between"+" [ -title | -subtitle ] ".red()+"must be defined to present a systemAlert."]
Copy file name to clipboardExpand all lines: Notification Agent Popup UI Tests/NAPUITests.swift
+54Lines changed: 54 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1165,5 +1165,59 @@ class NAPUITests: XCTestCase {
1165
1165
XCTAssert(false,"Failed to encode the usecase.")
1166
1166
}
1167
1167
}
1168
+
1169
+
/// Testing Pop-up with:
1170
+
/// Title: This is a title
1171
+
/// Subtitle: This is a subtitle
1172
+
/// Main Button: Primary
1173
+
/// Secondary Button: Secondary
1174
+
/// AccessoryView: dropdown
1175
+
/// AccessoryView1: datepicker
1176
+
/// AccessoryView2: whitebox
1177
+
/// AccessoryView3: GIF
1178
+
/// AccessoryView4: image
1179
+
func testE1Popup()throws{
1180
+
letuseCase="""
1181
+
{"notification":{"topicID":"untracked","mainButton":{"label":"Primary","callToActionType":"none","callToActionPayload":""},"secondaryButton":{"label":"Secondary","callToActionType":"none","callToActionPayload":""},"hideTitleBarButtons":false,"retainValues":false,"alwaysOnTop":false,"type":"popup","title":"This is a title","subtitle":"This is a subtitle","silent":false,"showSuppressionButton":false,"miniaturizable":false,"barTitle":"Some","forceLightMode":false,"notificationID":"untracked","isMovable":true,"disableQuit":false,"buttonless":false,"hideTitleBar":false, "accessoryViews":[{"type":"dropdown","payload":"/list First\\nSecond\\nThird /placeholder Pick something /title Some title"},{"type":"datepicker","payload":"/title Some title /style graphical /components date"},{"type":"whitebox","payload":"Some text in the whitebox accessory view Some text in the whitebox accessory view Some text in the whitebox accessory view Some text in the whitebox accessory view Some text in the whitebox accessory view Some text in the whitebox accessory view Some text in the whitebox accessory view Some text in the whitebox accessory view"},{"type":"image","payload":"https://compote.slate.com/images/697b023b-64a5-49a0-8059-27b963453fb1.gif?crop=780%2C520%2Cx0%2Cy0&width=2200"},{"type":"image","payload":"https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885_1280.jpg"}]},"settings":{"isVerboseModeEnabled":false,"environment":"prod"}}
XCTAssertEqual(app.textViews["markdown_accessory_view"].value as?String??"","Some text in the whitebox accessory view Some text in the whitebox accessory view Some text in the whitebox accessory view Some text in the whitebox accessory view Some text in the whitebox accessory view Some text in the whitebox accessory view Some text in the whitebox accessory view Some text in the whitebox accessory view")
0 commit comments