Skip to content

Commit 3a8d646

Browse files
committed
Remove users endpoint from store
1 parent d01c19c commit 3a8d646

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

src/store/Store.ts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { css, html } from 'lit';
2828
import { configureLocalization } from '@lit/localize';
2929
import { sourceLocale, targetLocales } from '../locales/locale-codes';
3030
import { StoreMonitorElement } from './StoreMonitorElement';
31+
import { getFullName } from '../user/TembaUser';
3132

3233
const { setLocale } = configureLocalization({
3334
sourceLocale,
@@ -83,9 +84,6 @@ export class Store extends RapidElement {
8384
@property({ type: String, attribute: 'workspace' })
8485
workspaceEndpoint: string;
8586

86-
@property({ type: String, attribute: 'users' })
87-
usersEndpoint: string;
88-
8987
@property({ type: String, attribute: 'shortcuts' })
9088
shortcutsEndpoint: string;
9189

@@ -226,14 +224,6 @@ export class Store extends RapidElement {
226224
);
227225
}
228226

229-
if (this.usersEndpoint) {
230-
fetches.push(
231-
getAssets(this.usersEndpoint).then((users: any[]) => {
232-
this.users = users;
233-
})
234-
);
235-
}
236-
237227
if (this.shortcutsEndpoint) {
238228
fetches.push(this.refreshShortcuts());
239229
}
@@ -249,12 +239,6 @@ export class Store extends RapidElement {
249239
return this.shortcuts || [];
250240
}
251241

252-
public getAssignableUsers() {
253-
return this.users.filter((user: User) =>
254-
['administrator', 'editor', 'agent'].includes(user.role)
255-
);
256-
}
257-
258242
public firstUpdated() {
259243
this.reset();
260244
}
@@ -560,6 +544,9 @@ export class Store extends RapidElement {
560544
}
561545
if (value && value.email === user.email) {
562546
// only care about avatars for now
547+
const orginalUser = last[parts[parts.length - 1]];
548+
orginalUser.avatar = user.avatar;
549+
orginalUser.name = getFullName(user);
563550
last[parts[parts.length - 1]].avatar = user.avatar;
564551
}
565552
});

0 commit comments

Comments
 (0)