-
- {!disableSelection && (
-
- )}
-
-
-
-
{metric.owner}
-
-
-
- {metric.isPublic ? 'Team' : 'Private'}
-
-
-
- {metric.lastModified && checkForRecent(metric.lastModified, 'LLL dd, yyyy, hh:mm a')}
-
-
e.stopPropagation()}>
-
,
- },
- {
- label: "Delete",
- key: "delete",
- icon:
- }
- ],
- onClick: onMenuClick,
- }}>
-
-
-
-
-
-
- >
+ const renderModal = () => (
+
-
-
+
+const ListView: React.FC
= (props: Props) => {
+ const { siteId, list, selectedList, toggleSelection, disableSelection = false, allSelected = false, toggleAll } = props;
+
+ const columns = [
+ {
+ title: (
+
{!disableSelection && (
selectedList(list.map((i: any) => i.metricId))}
- onClick={props.toggleAll}
+ onClick={toggleAll}
/>
)}
Title
-
- Owner
- Visibility
- Last Modified
- Options
-
- {list.map((metric: any) => (
+ ),
+ dataIndex: 'name',
+ key: 'title',
+ sorter: (a: any, b: any) => a.name.localeCompare(b.name),
+ render: (text: any, metric: any) => (
{
e.stopPropagation();
toggleSelection && toggleSelection(parseInt(metric.metricId));
}}
+ renderColumn="title"
/>
- ))}
-
+ ),
+ },
+ {
+ title: 'Owner',
+ dataIndex: 'owner',
+ key: 'owner',
+ sorter: (a: any, b: any) => a.owner.localeCompare(b.owner),
+ render: (text: any, metric: any) => (
+
+ ),
+ },
+ {
+ title: 'Visibility',
+ dataIndex: 'visibility',
+ key: 'visibility',
+ render: (text: any, metric: any) => (
+
+ ),
+ },
+ {
+ title: 'Last Modified',
+ dataIndex: 'lastModified',
+ key: 'lastModified',
+ sorter: (a: any, b: any) => new Date(a.lastModified).getTime() - new Date(b.lastModified).getTime(),
+ render: (text: any, metric: any) => (
+
+ ),
+ },
+ {
+ title: 'Options',
+ key: 'options',
+ render: (text: any, metric: any) => (
+
+ ),
+ },
+ ];
+
+ const data = list.map((metric: any) => ({
+ ...metric,
+ key: metric.metricId,
+ }));
+
+ return (
+
id.toString()),
+ onChange: (selectedRowKeys) => {
+ selectedRowKeys.forEach((key) => {
+ toggleSelection && toggleSelection(parseInt(key));
+ });
+ },
+ }
+ : undefined
+ }
+ pagination={false}
+ />
);
-}
+};
export default ListView;
diff --git a/frontend/app/components/Session/playerContext.ts b/frontend/app/components/Session/playerContext.ts
index 5a822e13d..6529a6f08 100644
--- a/frontend/app/components/Session/playerContext.ts
+++ b/frontend/app/components/Session/playerContext.ts
@@ -6,32 +6,29 @@ import {
IWebPlayerStore,
IWebLivePlayer,
IWebLivePlayerStore,
-} from 'Player'
+} from 'Player';
export interface IOSPlayerContext {
- player: IIosPlayer
- store: IIOSPlayerStore
+ player: IIosPlayer;
+ store: IIOSPlayerStore;
}
export interface IPlayerContext {
- player: IWebPlayer
- store: IWebPlayerStore,
+ player: IWebPlayer;
+ store: IWebPlayerStore;
}
export interface ILivePlayerContext {
- player: IWebLivePlayer
- store: IWebLivePlayerStore
+ player: IWebLivePlayer;
+ store: IWebLivePlayerStore;
}
-type WebContextType =
- | IPlayerContext
- | ILivePlayerContext
+type WebContextType = IPlayerContext | ILivePlayerContext;
+type MobileContextType = IOSPlayerContext;
-type MobileContextType = IOSPlayerContext
-
-export const defaultContextValue = { player: undefined, store: undefined }
+export const defaultContextValue = { player: undefined, store: undefined };
const ContextProvider = createContext>(defaultContextValue);
-export const PlayerContext = ContextProvider as Context
-export const MobilePlayerContext = ContextProvider as Context
\ No newline at end of file
+export const PlayerContext = ContextProvider as Context;
+export const MobilePlayerContext = ContextProvider as Context;
diff --git a/frontend/app/components/Session_/Player/Overlay/AutoplayTimer.module.css b/frontend/app/components/Session_/Player/Overlay/AutoplayTimer.module.css
index 9fdf9bade..1548231e3 100644
--- a/frontend/app/components/Session_/Player/Overlay/AutoplayTimer.module.css
+++ b/frontend/app/components/Session_/Player/Overlay/AutoplayTimer.module.css
@@ -1,3 +1,3 @@
.overlayBg {
background-color: rgba(255, 255, 255, 0.8);
-}
\ No newline at end of file
+}
diff --git a/frontend/app/components/shared/AutoplayToggle/AutoplayToggle.css b/frontend/app/components/shared/AutoplayToggle/AutoplayToggle.css
new file mode 100644
index 000000000..243cae928
--- /dev/null
+++ b/frontend/app/components/shared/AutoplayToggle/AutoplayToggle.css
@@ -0,0 +1,30 @@
+.ant-switch.custom-switch .ant-switch-inner-unchecked .switch-icon {
+ position: absolute;
+ left: 5px;
+ top: 5px;
+ color: grey;
+ }
+
+ .ant-switch.custom-switch .ant-switch-inner-checked .switch-icon{
+ position: relative;
+ left: 20px;
+ color: blue;
+ top: .05rem;
+ }
+
+ .ant-switch.custom-switch[aria-checked="false"] .ant-switch-inner-checked .switch-icon{
+ visibility: hidden;
+ }
+
+ .ant-switch.custom-switch[aria-checked="true"] .ant-switch-inner-checked .switch-icon{
+ visibility: visible;
+ }
+
+ .ant-switch.custom-switch[aria-checked="true"] .ant-switch-inner-unchecked .switch-icon{
+ visibility: hidden;
+ }
+
+ .ant-switch.custom-switch[aria-checked="false"] .ant-switch-inner-unchecked .switch-icon{
+ visibility: visible;
+ }
+
diff --git a/frontend/app/components/shared/AutoplayToggle/AutoplayToggle.tsx b/frontend/app/components/shared/AutoplayToggle/AutoplayToggle.tsx
index e6dbcf08f..27efefc1c 100644
--- a/frontend/app/components/shared/AutoplayToggle/AutoplayToggle.tsx
+++ b/frontend/app/components/shared/AutoplayToggle/AutoplayToggle.tsx
@@ -1,15 +1,35 @@
-import React from 'react';
+import React, { useContext } from 'react';
import { PlayerContext } from 'App/components/Session/playerContext';
import { observer } from 'mobx-react-lite';
-import { Switch } from 'antd'
+import { Switch, Tooltip, message } from 'antd';
+import { CaretRightOutlined, PauseOutlined } from '@ant-design/icons';
+import './AutoplayToggle.css';
-function AutoplayToggle() {
- const { player, store } = React.useContext(PlayerContext)
- const { autoplay } = store.get()
+const AutoplayToggle: React.FC = () => {
+ const { player, store } = useContext(PlayerContext);
+ const { autoplay } = store.get();
+
+ const handleToggle = () => {
+ player.toggleAutoplay();
+ if (!autoplay) {
+ message.success('Autoplay is ON');
+ } else {
+ message.info('Autoplay is OFF');
+ }
+ };
return (
- player.toggleAutoplay()} checked={autoplay} unCheckedChildren="Auto" checkedChildren="Auto" />
+
+ }
+ unCheckedChildren={}
+ />
+
);
-}
+};
+
export default observer(AutoplayToggle);
diff --git a/frontend/app/styles/general.css b/frontend/app/styles/general.css
index 5c1f77172..82da4b033 100644
--- a/frontend/app/styles/general.css
+++ b/frontend/app/styles/general.css
@@ -415,3 +415,4 @@ p {
.dashboardDataPeriodSelector .dashboardMoreOptionsLabel{
display: none;
}
+