Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

components: Allow buttons to be described by a banner's label.

Dhruv Shetty4a55343c6dd0
diff --git a/web/src/banners.ts b/web/src/banners.ts
index 508d3566222..7e8ced48f9c 100644
--- a/web/src/banners.ts
+++ b/web/src/banners.ts
@@ -9,6 +9,7 @@ import type {ComponentIntent} from "./types.ts";
export type Banner = {
intent: ComponentIntent;
label: string | Handlebars.SafeString;
+ label_id?: string;
buttons: ActionButton[];
close_button: boolean;
custom_classes?: string;
diff --git a/web/src/buttons.ts b/web/src/buttons.ts
index e5292b870e7..ae7ac0031d2 100644
--- a/web/src/buttons.ts
+++ b/web/src/buttons.ts
@@ -15,6 +15,7 @@ export type ActionButton = {
icon?: string;
id?: string;
custom_classes?: string;
+ "aria-describedby"?: string;
};
let loading_indicator_count = 0;
diff --git a/web/templates/components/action_button.hbs b/web/templates/components/action_button.hbs
index fecf4d52aa1..00c5a805d13 100644
--- a/web/templates/components/action_button.hbs
+++ b/web/templates/components/action_button.hbs
@@ -1,4 +1,4 @@
-<button type="{{#if type}}{{type}}{{else}}button{{/if}}" {{#if id}}id="{{id}}"{{/if}} class="{{#if custom_classes}}{{custom_classes}} {{/if}}action-button action-button-{{variant}}-{{intent}} {{#if hidden}}hide{{/if}}" {{#if data-tippy-content}}data-tippy-content="{{data-tippy-content}}"{{/if}} {{#if data-tooltip-template-id}}data-tooltip-template-id="{{data-tooltip-template-id}}"{{/if}} tabindex="0" {{#if aria-label}}aria-label="{{aria-label}}"{{/if}}
+<button type="{{#if type}}{{type}}{{else}}button{{/if}}" {{#if id}}id="{{id}}"{{/if}} class="{{#if custom_classes}}{{custom_classes}} {{/if}}action-button action-button-{{variant}}-{{intent}} {{#if hidden}}hide{{/if}}" {{#if data-tippy-content}}data-tippy-content="{{data-tippy-content}}"{{/if}} {{#if data-tooltip-template-id}}data-tooltip-template-id="{{data-tooltip-template-id}}"{{/if}} tabindex="0" {{#if aria-label}}aria-label="{{aria-label}}"{{/if}} {{#if aria-describedby}}aria-describedby="{{aria-describedby}}"{{/if}}
{{#if disabled}}disabled{{/if}}
>
{{#if icon}}
diff --git a/web/templates/components/banner.hbs b/web/templates/components/banner.hbs
index 1f62f3043b4..40705bf9238 100644
--- a/web/templates/components/banner.hbs
+++ b/web/templates/components/banner.hbs
@@ -1,6 +1,6 @@
<div {{#if process}}data-process="{{process}}"{{/if}} class="{{#if custom_classes}}{{custom_classes}} {{/if}}banner banner-{{intent}}">
<span class="banner-content">
- <span class="banner-label">
+ <span class="banner-label" {{#if label_id}}id="{{label_id}}"{{/if}}>
{{#if label}}
{{label}}
{{else}}