add accessibility ids for end-to-end tests
This commit is contained in:
parent
17011f6d9e
commit
28355ca3c5
|
@ -90,7 +90,8 @@
|
|||
(fn []
|
||||
(let [show-actions @show-actions]
|
||||
[touchable-highlight
|
||||
{:on-press #(dispatch [:set-chat-ui-props {:show-actions? (not show-actions)}])}
|
||||
{:on-press #(dispatch [:set-chat-ui-props {:show-actions? (not show-actions)}])
|
||||
:accessibility-label :chat-menu}
|
||||
[view st/action
|
||||
(if show-actions
|
||||
[vi/icon :icons/dropdown-up]
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
:subtitle (members-text members)
|
||||
:icon :menu_group
|
||||
:icon-opts {:width 25
|
||||
:height 19}
|
||||
:height 19}
|
||||
;; TODO not implemented: action Members
|
||||
:handler nil})
|
||||
|
||||
|
@ -90,26 +90,29 @@
|
|||
custom-icon
|
||||
handler
|
||||
title
|
||||
subtitle]
|
||||
subtitle
|
||||
accessibility-label]
|
||||
:or {accessibility-label :action}
|
||||
icon-name :icon}]
|
||||
[touchable-highlight {:on-press (fn []
|
||||
(dispatch [:set-chat-ui-props {:show-actions? false}])
|
||||
(when handler
|
||||
(handler)))}
|
||||
[view st/action-icon-row
|
||||
[view {:accessibility-label accessibility-label
|
||||
:style st/action-icon-row}
|
||||
[view st/action-icon-view
|
||||
(or custom-icon
|
||||
[icon icon-name icon-style])]
|
||||
[view st/action-view
|
||||
[text {:style st/action-title
|
||||
:number-of-lines 1
|
||||
:font :medium}
|
||||
title]
|
||||
(when-let [subtitle subtitle]
|
||||
[text {:style st/action-subtitle
|
||||
:number-of-lines 1
|
||||
:font :default}
|
||||
subtitle])]]])
|
||||
[icon icon-name icon-style])
|
||||
[view st/action-view
|
||||
[text {:style st/action-title
|
||||
:number-of-lines 1
|
||||
:font :medium}
|
||||
title]
|
||||
(when-let [subtitle subtitle]
|
||||
[text {:style st/action-subtitle
|
||||
:number-of-lines 1
|
||||
:font :default}
|
||||
subtitle])]]]])
|
||||
|
||||
(defview actions-list-view []
|
||||
(letsubs [group-chat [:chat :group-chat]
|
||||
|
@ -121,8 +124,8 @@
|
|||
(group-chat-items members public?)
|
||||
(user-chat-items chat-id))]
|
||||
[view (merge
|
||||
(st/actions-wrapper status-bar-height)
|
||||
(get-in platform-specific [:component-styles :actions-list-view]))
|
||||
(st/actions-wrapper status-bar-height)
|
||||
(get-in platform-specific [:component-styles :actions-list-view]))
|
||||
[view st/actions-separator]
|
||||
[view st/actions-view
|
||||
(for [action actions]
|
||||
|
|
|
@ -154,23 +154,24 @@
|
|||
(fn [{:keys [command-width container-width]}]
|
||||
(when (get-in @command [:command :sequential-params])
|
||||
(let [{:keys [placeholder hidden type]} (get-in @command [:command :params @arg-pos])]
|
||||
[text-input (merge {:ref #(dispatch [:set-chat-ui-props {:seq-input-ref %}])
|
||||
:style (style/seq-input-text command-width container-width)
|
||||
:default-value (or @seq-arg-input-text "")
|
||||
:on-change-text #(do (dispatch [:set-chat-seq-arg-input-text %])
|
||||
(dispatch [:load-chat-parameter-box (:command @command)])
|
||||
(dispatch [:set-chat-ui-props {:validation-messages nil}]))
|
||||
:placeholder placeholder
|
||||
:blur-on-submit false
|
||||
:editable (not @sending-in-progress?)
|
||||
:on-focus #(dispatch [:set-chat-ui-props {:show-emoji? false}])
|
||||
:on-submit-editing (fn []
|
||||
(when-not (or (str/blank? @seq-arg-input-text)
|
||||
(get-in @command [:command :hide-send-button]))
|
||||
(dispatch [:send-seq-argument]))
|
||||
(js/setTimeout
|
||||
#(dispatch [:chat-input-focus :seq-input-ref])
|
||||
100))}
|
||||
[text-input (merge {:ref #(dispatch [:set-chat-ui-props {:seq-input-ref %}])
|
||||
:style (style/seq-input-text command-width container-width)
|
||||
:default-value (or @seq-arg-input-text "")
|
||||
:on-change-text #(do (dispatch [:set-chat-seq-arg-input-text %])
|
||||
(dispatch [:load-chat-parameter-box (:command @command)])
|
||||
(dispatch [:set-chat-ui-props {:validation-messages nil}]))
|
||||
:placeholder placeholder
|
||||
:accessibility-label :chat-request-input
|
||||
:blur-on-submit false
|
||||
:editable (not @sending-in-progress?)
|
||||
:on-focus #(dispatch [:set-chat-ui-props {:show-emoji? false}])
|
||||
:on-submit-editing (fn []
|
||||
(when-not (or (str/blank? @seq-arg-input-text)
|
||||
(get-in @command [:command :hide-send-button]))
|
||||
(dispatch [:send-seq-argument]))
|
||||
(js/setTimeout
|
||||
#(dispatch [:chat-input-focus :seq-input-ref])
|
||||
100))}
|
||||
(get-options type))])))))
|
||||
|
||||
(defn input-view [_]
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
(when (and extended? (not (empty? extend-options)))
|
||||
[view st/more-btn-container
|
||||
[context-menu
|
||||
[vi/icon :icons/options]
|
||||
[vi/icon :icons/options {:accessibility-label :options}]
|
||||
extend-options
|
||||
nil
|
||||
st/more-btn]])]]])
|
||||
|
@ -50,4 +50,4 @@
|
|||
(when checked {:style st/selected-contact}))]
|
||||
[view (st/icon-check-container checked)
|
||||
(when checked
|
||||
[vi/icon :icons/ok {:style st/check-icon}])]]]])
|
||||
[vi/icon :icons/ok {:style st/check-icon}])]]]])
|
||||
|
|
|
@ -75,25 +75,27 @@
|
|||
|
||||
(defn icon
|
||||
([name] (icon name nil))
|
||||
([name {:keys [color container-style style]}]
|
||||
[react/view {:style container-style}
|
||||
([name {:keys [color container-style style accessibility-label]
|
||||
:or {accessibility-label :icon}}]
|
||||
[react/view {:style container-style
|
||||
:accessibility-label accessibility-label}
|
||||
(if-let [icon-fn (get icons (normalize-property-name name))]
|
||||
(into []
|
||||
(concat
|
||||
[svg (merge default-viewbox style)]
|
||||
(icon-fn
|
||||
(cond
|
||||
(keyword? color)
|
||||
(case color
|
||||
:dark styles/icon-dark-color
|
||||
:gray styles/icon-gray-color
|
||||
:blue styles/color-light-blue
|
||||
:active styles/color-blue4
|
||||
:white styles/color-white
|
||||
:red styles/icon-red-color
|
||||
styles/icon-dark-color)
|
||||
(string? color)
|
||||
color
|
||||
:else
|
||||
styles/icon-dark-color))))
|
||||
(throw (js/Error. (str "Unknown icon: " name))))]))
|
||||
[svg (merge default-viewbox style)]
|
||||
(icon-fn
|
||||
(cond
|
||||
(keyword? color)
|
||||
(case color
|
||||
:dark styles/icon-dark-color
|
||||
:gray styles/icon-gray-color
|
||||
:blue styles/color-light-blue
|
||||
:active styles/color-blue4
|
||||
:white styles/color-white
|
||||
:red styles/icon-red-color
|
||||
styles/icon-dark-color)
|
||||
(string? color)
|
||||
color
|
||||
:else
|
||||
styles/icon-dark-color))))
|
||||
(throw (js/Error. (str "Unknown icon: " name))))]))
|
||||
|
|
|
@ -61,12 +61,13 @@
|
|||
:search-placeholder (i18n/label :t/search-for)}]))
|
||||
|
||||
(defn chats-action-button []
|
||||
[native-action-button {:button-color color-blue
|
||||
:offset-x 16
|
||||
:offset-y 40
|
||||
:spacing 13
|
||||
:hide-shadow true
|
||||
:on-press #(re-frame/dispatch [:navigate-to :new-chat])}])
|
||||
[native-action-button {:button-color color-blue
|
||||
:offset-x 16
|
||||
:offset-y 40
|
||||
:spacing 13
|
||||
:hide-shadow true
|
||||
:accessibility-label :plus-button
|
||||
:on-press #(re-frame/dispatch [:navigate-to :new-chat])}])
|
||||
|
||||
(defn chat-list-item [[chat-id chat] edit?]
|
||||
[react/touchable-highlight {:on-press #(re-frame/dispatch [:navigate-to :chat chat-id])}
|
||||
|
|
|
@ -109,9 +109,10 @@
|
|||
:hide-shadow true
|
||||
:spacing 13}
|
||||
[native-action-button-item
|
||||
{:title (label :t/new-contact)
|
||||
:buttonColor :#9b59b6
|
||||
:onPress #(dispatch [:navigate-to :new-contact])}
|
||||
{:title (label :t/new-contact)
|
||||
:accessibility-label :new-contact
|
||||
:buttonColor :#9b59b6
|
||||
:onPress #(dispatch [:navigate-to :new-contact])}
|
||||
[ion-icon {:name :md-create
|
||||
:style create-icon}]]])
|
||||
|
||||
|
|
|
@ -42,10 +42,11 @@
|
|||
|
||||
(defn contact-extended-options [group-id]
|
||||
(fn [item]
|
||||
[{:value #(dispatch [:remove-contact-from-group
|
||||
(:whisper-identity item)
|
||||
group-id])
|
||||
:text (label :t/remove-from-group)}]))
|
||||
[{:value #(dispatch [:remove-contact-from-group
|
||||
(:whisper-identity item)
|
||||
group-id])
|
||||
:accessibility-label :remove-button
|
||||
:text (label :t/remove-from-group)}]))
|
||||
|
||||
(defview edit-chat-group-contact-list []
|
||||
(letsubs [chat-name [:chat :name]
|
||||
|
@ -69,9 +70,8 @@
|
|||
(contact-extended-options group-id)]))
|
||||
|
||||
(defview edit-contact-group-contact-list []
|
||||
(letsubs [group [:get-contact-group]
|
||||
type [:get-group-type]]
|
||||
(letsubs [group [:get-contact-group]]
|
||||
[view styles/group-container
|
||||
[status-bar]
|
||||
[contact-list-toolbar (:name group)]
|
||||
[contacts-list-view (:group-id group)]]))
|
||||
[contacts-list-view (:group-id group)]]))
|
||||
|
|
Loading…
Reference in New Issue