diff --git a/frontend/app/components/Assist/RecordingsList/Recordings.tsx b/frontend/app/components/Assist/RecordingsList/Recordings.tsx
index 1bc29efaa..c03b703f3 100644
--- a/frontend/app/components/Assist/RecordingsList/Recordings.tsx
+++ b/frontend/app/components/Assist/RecordingsList/Recordings.tsx
@@ -1,25 +1,44 @@
-import React from 'react'
+import React from 'react';
import { PageTitle } from 'UI';
+import Select from 'Shared/Select';
import RecordingsSearch from './RecordingsSearch';
import RecordingsList from './RecordingsList';
+import { useStore } from 'App/mstore';
+import { connect } from 'react-redux';
-function Recordings() {
+function Recordings({ userId }: { userId: string }) {
+ const { recordingsStore } = useStore();
+
+ const recordingsOwner = [
+ { value: '0', label: 'All Recordings' },
+ { value: userId, label: 'My Recordings' },
+ ];
return (
-
-
-
+
+
+
- )
+
+
+
+
+
+ );
}
-export default Recordings
+export default connect((state: any) => ({ userId: state.getIn(['user', 'account', 'id']) }))(
+ Recordings
+);
diff --git a/frontend/app/components/shared/SessionListContainer/components/Notes/NoteTags.tsx b/frontend/app/components/shared/SessionListContainer/components/Notes/NoteTags.tsx
index 26e57cc58..2831824b3 100644
--- a/frontend/app/components/shared/SessionListContainer/components/Notes/NoteTags.tsx
+++ b/frontend/app/components/shared/SessionListContainer/components/Notes/NoteTags.tsx
@@ -10,20 +10,22 @@ const sortOptionsMap = {
'createdAt-ASC': 'Oldest',
};
const sortOptions = Object.entries(sortOptionsMap).map(([value, label]) => ({ value, label }));
-const notesOwner = [{ value: '0', label: 'All Notes'},{ value: '1', label: 'My Notes'}]
+const notesOwner = [
+ { value: '0', label: 'All Notes' },
+ { value: '1', label: 'My Notes' },
+];
function NoteTags() {
- const { notesStore } = useStore()
-
+ const { notesStore } = useStore();
return (
-
- notesStore.toggleTag()}
- label="ALL"
- isActive={notesStore.activeTags.length === 0}
- />
-
+
+ notesStore.toggleTag()}
+ label="ALL"
+ isActive={notesStore.activeTags.length === 0}
+ />
+
{TAGS.map((tag: iTag) => (
))}
-
);
}
diff --git a/frontend/app/mstore/recordingsStore.ts b/frontend/app/mstore/recordingsStore.ts
index 39ff50bb6..63dd5b927 100644
--- a/frontend/app/mstore/recordingsStore.ts
+++ b/frontend/app/mstore/recordingsStore.ts
@@ -11,7 +11,7 @@ export default class RecordingsStore {
order: 'desc' | 'asc' = 'desc';
search = '';
// later we will add search by user id
- userId: number;
+ userId?: string;
constructor() {
makeAutoObservable(this);
@@ -21,6 +21,11 @@ export default class RecordingsStore {
this.recordings = records;
}
+ setUserId(userId: string) {
+ this.userId = userId;
+ this.fetchRecordings();
+ }
+
updateSearch(val: string) {
this.search = val;
}
@@ -34,6 +39,7 @@ export default class RecordingsStore {
limit: this.pageSize,
order: this.order,
search: this.search,
+ userId: this.userId === '0' ? undefined : this.userId,
};
this.loading = true;
diff --git a/frontend/app/mstore/userStore.ts b/frontend/app/mstore/userStore.ts
index 523ae04f7..8e8913de6 100644
--- a/frontend/app/mstore/userStore.ts
+++ b/frontend/app/mstore/userStore.ts
@@ -1,12 +1,12 @@
import { makeAutoObservable, observable, action } from "mobx"
-import User, { IUser } from "./types/user";
+import User from "./types/user";
import { userService } from "App/services";
import { toast } from 'react-toastify';
import copy from 'copy-to-clipboard';
export default class UserStore {
- list: IUser[] = [];
- instance: IUser|null = null;
+ list: User[] = [];
+ instance: User|null = null;
page: number = 1;
pageSize: number = 10;
searchQuery: string = "";
@@ -62,7 +62,7 @@ export default class UserStore {
}
}
- updateUser(user: IUser) {
+ updateUser(user: User) {
const index = this.list.findIndex(u => u.userId === user.userId);
if (index > -1) {
this.list[index] = user;
@@ -101,7 +101,7 @@ export default class UserStore {
});
}
- saveUser(user: IUser): Promise
{
+ saveUser(user: User): Promise {
this.saving = true;
const wasCreating = !user.userId;
return new Promise((resolve, reject) => {