@nyaruka/temba-components 0.159.3 → 0.159.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,10 +5,10 @@ import { Flow, ObjectReference } from '../interfaces';
5
5
 
6
6
  /**
7
7
  * Flow CRUDL list — drop-in replacement for the rapidpro
8
- * `flows/flow_list.html` table. Each row's leading icon reflects
9
- * the flow type (messaging / voice / background / surveyor).
10
- * Columns: name, status, runs, ongoing, completion bar, activity
11
- * sparkline.
8
+ * `flows/flow_list.html` table. Rows of the unusual flow types
9
+ * (voice / background / surveyor) carry a leading type icon;
10
+ * message flows don't. Columns: name, runs, ongoing, completion
11
+ * bar, activity sparkline.
12
12
  */
13
13
  export class FlowList extends ContentList<Flow> {
14
14
  static get styles() {
@@ -92,7 +92,6 @@ export class FlowList extends ContentList<Flow> {
92
92
  width: '280px',
93
93
  pinned: true
94
94
  },
95
- { key: 'status', label: 'Status', width: '110px' },
96
95
  {
97
96
  key: 'runs',
98
97
  label: 'Runs',
@@ -137,7 +136,9 @@ export class FlowList extends ContentList<Flow> {
137
136
  case 'survey':
138
137
  return Icon.flow_surveyor;
139
138
  default:
140
- return Icon.flow_message;
139
+ // message flows are the common case and carry no icon — only
140
+ // the unusual types get flagged, matching the legacy table
141
+ return null;
141
142
  }
142
143
  }
143
144
 
@@ -183,8 +184,6 @@ export class FlowList extends ContentList<Flow> {
183
184
  return this.renderCompletion(item);
184
185
  case 'activity':
185
186
  return this.renderSparkline(item.activity || []);
186
- case 'status':
187
- return this.renderFlowStatus(item);
188
187
  default:
189
188
  return super.renderCell(item, column);
190
189
  }
@@ -235,11 +234,4 @@ export class FlowList extends ContentList<Flow> {
235
234
  </svg>
236
235
  `;
237
236
  }
238
-
239
- private renderFlowStatus(item: Flow): TemplateResult {
240
- const status = (item.status || 'active').toString().toLowerCase();
241
- const kind = status === 'archived' ? 'archived' : 'active';
242
- const label = status === 'archived' ? 'Archived' : 'Active';
243
- return this.renderStatusPill(kind, label);
244
- }
245
237
  }
@@ -8,7 +8,7 @@ import { Msg } from '../interfaces';
8
8
  * `msgs/msg_list.html` table. Reverse-chronological; the message
9
9
  * cell carries the body text with its attachment thumbnails right
10
10
  * after it and the flow / label pills pushed to the trailing edge,
11
- * with a duration timestamp closing the row.
11
+ * with a timedate timestamp closing the row.
12
12
  */
13
13
  export class MsgList extends ContentList<Msg> {
14
14
  static get styles() {
@@ -100,11 +100,13 @@ export class MsgList extends ContentList<Msg> {
100
100
  this.searchPlaceholder = 'Search messages';
101
101
  // Messages page 100 at a time, matching rapidpro's msg list.
102
102
  this.pageSize = 100;
103
- // Fixed layout so a long message ellipsis-truncates within its
104
- // column instead of stretching the table; minTableWidth lets the
105
- // list scroll horizontally once the container is too narrow to
106
- // keep the columns usable, rather than clipping anything.
107
- this.fixedLayout = true;
103
+ // Auto layout so the Contact / Sent columns size to their content
104
+ // (no stranded width on the short Sent value), while the Message
105
+ // column is a `grow` column under auto layout it claims zero
106
+ // intrinsic width and ellipsis-truncates against the leftover space
107
+ // rather than stretching the table. minTableWidth lets the list
108
+ // scroll horizontally once the container is too narrow to keep the
109
+ // columns usable, rather than clipping anything.
108
110
  this.minTableWidth = '640px';
109
111
  this.columns = [
110
112
  {
@@ -117,9 +119,7 @@ export class MsgList extends ContentList<Msg> {
117
119
  {
118
120
  key: 'created_on',
119
121
  label: 'Sent',
120
- width: '120px',
121
- align: 'right',
122
- pinned: 'right'
122
+ align: 'right'
123
123
  }
124
124
  ];
125
125
  this.bulkActions = [
@@ -172,7 +172,7 @@ export class MsgList extends ContentList<Msg> {
172
172
  `;
173
173
  }
174
174
 
175
- /** The sent cell — duration timestamp with an optional channel-log
175
+ /** The sent cell — timedate timestamp with an optional channel-log
176
176
  * icon to its right. The icon is rendered when the server includes
177
177
  * a logs_url on the row (permission- and retention-gated
178
178
  * server-side). stopPropagation keeps the row's contact navigation
@@ -181,7 +181,7 @@ export class MsgList extends ContentList<Msg> {
181
181
  if (!item.created_on) return '';
182
182
  return html`
183
183
  <div class="sent-cell">
184
- <temba-date value=${item.created_on} display="duration"></temba-date>
184
+ <temba-date value=${item.created_on} display="timedate"></temba-date>
185
185
  ${item.logs_url && this.isSafeHref(item.logs_url)
186
186
  ? html`
187
187
  <a