Skip to content

Commit f64709f

Browse files
authored
Merge pull request #640 from GetStream/reactions-v2
feat: reaction details are now paginated, and use reaction_groups
2 parents 15c30e0 + 29fb9cf commit f64709f

42 files changed

Lines changed: 989 additions & 386 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
The `PaginatedListComponent` can display a list of arbitrary data with support for loading indicator and pagination. This is a utility component, you don't need to use it unless you're building a custom component.
2+
3+
## Usage
4+
5+
The paginated list component relies on data provided by the parent component. You can provide the HTML template for the list items.
6+
7+
```html
8+
<stream-paginated-list
9+
[items]="<list of items to display>"
10+
[isLoading]="<set to true to display loading indicator>"
11+
[hasMore]="<whether or not the list has more pages to retrieve>"
12+
(loadMore)="<use this output to fetch the next page of items>"
13+
>
14+
<ng-template let-item="item" let-index="index"
15+
><div data-testid="test-item" [style.height]="height">
16+
{{ index }}. {{ item }}
17+
</div></ng-template
18+
>
19+
</stream-user-list>
20+
```
21+
22+
## Customization
23+
24+
You can provide the HTML template for the list items, see above example.
25+
26+
[//]: # "Start of generated content"
27+
[//]: # "End of generated content"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The `UserListComponent` can display a list of Stream users with pagination. This can be useful if you want to build a user list in your application.
2+
3+
## Usage
4+
5+
The user list component relies on data provided by the parent component:
6+
7+
```html
8+
<stream-user-list
9+
[users]="<list of users to display>"
10+
[isLoading]="<set to true to display loading indicator>"
11+
[hasMore]="<whether or not the list has more pages to retrieve>"
12+
(loadMore)="<use this output to fetch the next page of users>"
13+
></stream-user-list>
14+
```
15+
16+
## Customization
17+
18+
The component is built on top of the [`PaginatedListComponent`](../../components/PaginatedListComponent.mdx), you can use that component to build your own user list component.
19+
20+
[//]: # "Start of generated content"
21+
[//]: # "End of generated content"

package-lock.json

Lines changed: 52 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
"@ctrl/ngx-emoji-mart": "^8.2.0",
114114
"@floating-ui/dom": "^1.6.3",
115115
"@ngx-translate/core": "^14.0.0",
116-
"@stream-io/stream-chat-css": "4.18.0",
116+
"@stream-io/stream-chat-css": "4.19.0",
117117
"@stream-io/transliterate": "^1.5.2",
118118
"angular-mentions": "1.4.0",
119119
"dayjs": "^1.11.10",
@@ -122,8 +122,8 @@
122122
"ngx-float-ui": "^15.0.0",
123123
"pretty-bytes": "^6.1.1",
124124
"rxjs": "~7.4.0",
125-
"stream-chat": "^8.26.0",
126125
"starwars-names": "^1.6.0",
126+
"stream-chat": "^8.40.1",
127127
"ts-node": "^10.9.2",
128128
"tslib": "^2.3.0",
129129
"uuid": "^9.0.1",
@@ -141,10 +141,10 @@
141141
"@semantic-release/exec": "^6.0.2",
142142
"@semantic-release/git": "^10.0.1",
143143
"@types/jasmine": "~3.8.0",
144-
"@typescript-eslint/eslint-plugin": "^6.21.0",
145-
"@typescript-eslint/parser": "^6.21.0",
146144
"@types/starwars-names": "^1.6.2",
147145
"@types/uuid": "^9.0.8",
146+
"@typescript-eslint/eslint-plugin": "^6.21.0",
147+
"@typescript-eslint/parser": "^6.21.0",
148148
"copyfiles": "^2.4.1",
149149
"eslint": "^8.28.0",
150150
"eslint-config-prettier": "^8.3.0",
@@ -161,7 +161,7 @@
161161
"karma-jasmine-html-reporter": "~1.7.0",
162162
"lint-staged": "^11.1.2",
163163
"ng-packagr": "^15.2.2",
164-
"prettier": "^2.4.0",
164+
"prettier": "^2.8.8",
165165
"prettier-eslint": "^13.0.0",
166166
"semantic-release": "^18.0.0",
167167
"typedoc": "^0.25.13",

projects/customizations-example/src/app/app.component.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,12 @@
163163

164164
<ng-template
165165
#messageReactionsTemplate
166-
let-messageReactionCounts="messageReactionCounts"
167-
let-latestReactions="latestReactions"
166+
let-messageReactionGroups="messageReactionGroups"
168167
let-messageId="messageId"
169168
let-ownReactions="ownReactions"
170169
>
171170
<stream-message-reactions
172-
[messageReactionCounts]="messageReactionCounts"
173-
[latestReactions]="latestReactions"
171+
[messageReactionGroups]="messageReactionGroups"
174172
[messageId]="messageId"
175173
[ownReactions]="ownReactions"
176174
></stream-message-reactions>

projects/sample-app/src/app/custom-message/custom-message.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<div class="message">{{ message?.text }}</div>
33
<div class="sender-info">
44
{{ message?.user?.name || message?.user?.id }} |
5-
{{ message?.created_at | date: "long" }}
5+
{{ message?.created_at | date : "long" }}
66
</div>
77
</div>

projects/stream-chat-angular/.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
"rules": {
5555
"@typescript-eslint/no-unsafe-call": "off",
5656
"@typescript-eslint/no-unsafe-assignment": "off",
57-
"@typescript-eslint/no-unsafe-member-access": "off"
57+
"@typescript-eslint/no-unsafe-member-access": "off",
58+
"@angular-eslint/component-max-inline-declarations": "off"
5859
}
5960
},
6061
{

projects/stream-chat-angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
2222
"@ngx-translate/core": "^14.0.0 || ^15.0.0",
2323
"rxjs": "^7.4.0",
24-
"stream-chat": "^8.26.0"
24+
"stream-chat": "^8.29.0"
2525
},
2626
"dependencies": {
2727
"@floating-ui/dom": "^1.6.3",

projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.html

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,7 @@
256256
></ng-container>
257257
<ng-template #defaultFile let-attachmentContext="attachment">
258258
<div
259-
class="
260-
str-chat__message-attachment-file--item
261-
str-chat-angular__message-attachment-file-single
262-
"
259+
class="str-chat__message-attachment-file--item str-chat-angular__message-attachment-file-single"
263260
>
264261
<stream-icon-placeholder
265262
class="str-chat__attachment-type-icon"
@@ -447,10 +444,7 @@
447444
<div class="stream-chat-angular__image-modal str-chat__image-carousel">
448445
<img
449446
#imgElement
450-
class="
451-
stream-chat-angular__image-modal-image
452-
str-chat__image-carousel-image
453-
"
447+
class="stream-chat-angular__image-modal-image str-chat__image-carousel-image"
454448
data-testid="modal-image"
455449
[src]="
456450
getCarouselImageAttachmentConfiguration(
@@ -484,10 +478,7 @@
484478
/>
485479
<div>
486480
<button
487-
class="
488-
stream-chat-angular__image-modal-stepper
489-
str-chat__image-carousel-stepper str-chat__image-carousel-stepper-prev
490-
"
481+
class="stream-chat-angular__image-modal-stepper str-chat__image-carousel-stepper str-chat__image-carousel-stepper-prev"
491482
data-testid="image-modal-prev"
492483
type="button"
493484
[ngStyle]="{
@@ -499,10 +490,7 @@
499490
<stream-icon-placeholder icon="arrow-left"></stream-icon-placeholder>
500491
</button>
501492
<button
502-
class="
503-
stream-chat-angular__image-modal-stepper
504-
str-chat__image-carousel-stepper str-chat__image-carousel-stepper-next
505-
"
493+
class="stream-chat-angular__image-modal-stepper str-chat__image-carousel-stepper str-chat__image-carousel-stepper-next"
506494
type="button"
507495
data-testid="image-modal-next"
508496
[ngStyle]="{

projects/stream-chat-angular/src/lib/channel-header/channel-header.component.html

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
<div class="str-chat__header-livestream-left str-chat__channel-header-end">
1111
<p
1212
data-testid="name"
13-
class="
14-
str-chat__header-livestream-left--title str-chat__channel-header-title
15-
"
13+
class="str-chat__header-livestream-left--title str-chat__channel-header-title"
1614
>
1715
{{ displayText }}
1816
</p>
@@ -25,10 +23,7 @@
2523
<ng-template #defaultChannelInfo>
2624
<p
2725
data-testid="info"
28-
class="
29-
str-chat__header-livestream-left--members
30-
str-chat__channel-header-info
31-
"
26+
class="str-chat__header-livestream-left--members str-chat__channel-header-info"
3227
>
3328
{{'streamChat.{{ memberCount }} members' | translate:memberCountParam}}
3429
{{canReceiveConnectEvents ? ('streamChat.{{ watcherCount }} online' |

0 commit comments

Comments
 (0)