mirror of
https://github.com/pawelmalak/flame.git
synced 2024-12-21 01:01:30 +03:00
Merge branch 'feature' into feature-docker-secret-integration
This commit is contained in:
commit
2b25a67bbf
@ -1,4 +1,4 @@
|
|||||||
FROM node:14 as builder
|
FROM node:16 as builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ RUN mkdir -p ./public ./data \
|
|||||||
&& mv ./client/build/* ./public \
|
&& mv ./client/build/* ./public \
|
||||||
&& rm -rf ./client
|
&& rm -rf ./client
|
||||||
|
|
||||||
FROM node:14-alpine
|
FROM node:16-alpine
|
||||||
|
|
||||||
COPY --from=builder /app /app
|
COPY --from=builder /app /app
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM node:14-alpine3.11 as builder
|
FROM node:16-alpine3.11 as builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ RUN mkdir -p ./public ./data \
|
|||||||
&& mv ./client/build/* ./public \
|
&& mv ./client/build/* ./public \
|
||||||
&& rm -rf ./client
|
&& rm -rf ./client
|
||||||
|
|
||||||
FROM node:14-alpine3.11
|
FROM node:16-alpine3.11
|
||||||
|
|
||||||
COPY --from=builder /app /app
|
COPY --from=builder /app /app
|
||||||
|
|
||||||
|
2
.env
2
.env
@ -1,5 +1,5 @@
|
|||||||
PORT=5005
|
PORT=5005
|
||||||
NODE_ENV=development
|
NODE_ENV=development
|
||||||
VERSION=2.0.1
|
VERSION=2.1.0
|
||||||
PASSWORD=flame_password
|
PASSWORD=flame_password
|
||||||
SECRET=e02eb43d69953658c6d07311d6313f2d4467672cb881f96b29368ba1f3f4da4b
|
SECRET=e02eb43d69953658c6d07311d6313f2d4467672cb881f96b29368ba1f3f4da4b
|
12
CHANGELOG.md
12
CHANGELOG.md
@ -1,3 +1,15 @@
|
|||||||
|
### v2.1.1 (TBA)
|
||||||
|
- Changed some messages and buttons to make it easier to open bookmarks editor ([#239](https://github.com/pawelmalak/flame/issues/239))
|
||||||
|
|
||||||
|
### v2.1.0 (2021-11-26)
|
||||||
|
- Added option to set custom order for bookmarks ([#43](https://github.com/pawelmalak/flame/issues/43)) and ([#187](https://github.com/pawelmalak/flame/issues/187))
|
||||||
|
- Added support for .ico files for custom icons ([#209](https://github.com/pawelmalak/flame/issues/209))
|
||||||
|
- Empty apps and categories sections will now be hidden from guests ([#210](https://github.com/pawelmalak/flame/issues/210))
|
||||||
|
- Fixed bug with fahrenheit degrees being displayed as float ([#221](https://github.com/pawelmalak/flame/issues/221))
|
||||||
|
- Fixed bug with alphabetical order not working for bookmarks until the page was refreshed ([#224](https://github.com/pawelmalak/flame/issues/224))
|
||||||
|
- Added option to change visibilty of apps, categories and bookmarks directly from table view
|
||||||
|
- Password input will now autofocus when visiting /settings/app
|
||||||
|
|
||||||
### v2.0.1 (2021-11-19)
|
### v2.0.1 (2021-11-19)
|
||||||
- Added option to display humidity in the weather widget ([#136](https://github.com/pawelmalak/flame/issues/136))
|
- Added option to display humidity in the weather widget ([#136](https://github.com/pawelmalak/flame/issues/136))
|
||||||
- Added option to set default theme for all new users ([#165](https://github.com/pawelmalak/flame/issues/165))
|
- Added option to set default theme for all new users ([#165](https://github.com/pawelmalak/flame/issues/165))
|
||||||
|
@ -1 +1 @@
|
|||||||
REACT_APP_VERSION=2.0.1
|
REACT_APP_VERSION=2.1.0
|
12
client/src/components/Actions/TableActions.module.css
Normal file
12
client/src/components/Actions/TableActions.module.css
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
.TableActions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.TableAction {
|
||||||
|
width: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.TableAction:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
81
client/src/components/Actions/TableActions.tsx
Normal file
81
client/src/components/Actions/TableActions.tsx
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
import { Icon } from '../UI';
|
||||||
|
import classes from './TableActions.module.css';
|
||||||
|
|
||||||
|
interface Entity {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
isPinned?: boolean;
|
||||||
|
isPublic: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
entity: Entity;
|
||||||
|
deleteHandler: (id: number, name: string) => void;
|
||||||
|
updateHandler: (id: number) => void;
|
||||||
|
pinHanlder?: (id: number) => void;
|
||||||
|
changeVisibilty: (id: number) => void;
|
||||||
|
showPin?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const TableActions = (props: Props): JSX.Element => {
|
||||||
|
const {
|
||||||
|
entity,
|
||||||
|
deleteHandler,
|
||||||
|
updateHandler,
|
||||||
|
pinHanlder,
|
||||||
|
changeVisibilty,
|
||||||
|
showPin = true,
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
const _pinHandler = pinHanlder || function () {};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<td className={classes.TableActions}>
|
||||||
|
{/* DELETE */}
|
||||||
|
<div
|
||||||
|
className={classes.TableAction}
|
||||||
|
onClick={() => deleteHandler(entity.id, entity.name)}
|
||||||
|
tabIndex={0}
|
||||||
|
>
|
||||||
|
<Icon icon="mdiDelete" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* UPDATE */}
|
||||||
|
<div
|
||||||
|
className={classes.TableAction}
|
||||||
|
onClick={() => updateHandler(entity.id)}
|
||||||
|
tabIndex={0}
|
||||||
|
>
|
||||||
|
<Icon icon="mdiPencil" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* PIN */}
|
||||||
|
{showPin && (
|
||||||
|
<div
|
||||||
|
className={classes.TableAction}
|
||||||
|
onClick={() => _pinHandler(entity.id)}
|
||||||
|
tabIndex={0}
|
||||||
|
>
|
||||||
|
{entity.isPinned ? (
|
||||||
|
<Icon icon="mdiPinOff" color="var(--color-accent)" />
|
||||||
|
) : (
|
||||||
|
<Icon icon="mdiPin" />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* VISIBILITY */}
|
||||||
|
<div
|
||||||
|
className={classes.TableAction}
|
||||||
|
onClick={() => changeVisibilty(entity.id)}
|
||||||
|
tabIndex={0}
|
||||||
|
>
|
||||||
|
{entity.isPublic ? (
|
||||||
|
<Icon icon="mdiEyeOff" color="var(--color-accent)" />
|
||||||
|
) : (
|
||||||
|
<Icon icon="mdiEye" />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
);
|
||||||
|
};
|
@ -1,6 +1,6 @@
|
|||||||
import { useState, useEffect, ChangeEvent, SyntheticEvent } from 'react';
|
import { useState, useEffect, ChangeEvent, SyntheticEvent } from 'react';
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { App, NewApp } from '../../../interfaces';
|
import { NewApp } from '../../../interfaces';
|
||||||
|
|
||||||
import classes from './AppForm.module.css';
|
import classes from './AppForm.module.css';
|
||||||
|
|
||||||
@ -8,29 +8,34 @@ import { ModalForm, InputGroup, Button } from '../../UI';
|
|||||||
import { inputHandler, newAppTemplate } from '../../../utility';
|
import { inputHandler, newAppTemplate } from '../../../utility';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { actionCreators } from '../../../store';
|
import { actionCreators } from '../../../store';
|
||||||
|
import { State } from '../../../store/reducers';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
modalHandler: () => void;
|
modalHandler: () => void;
|
||||||
app?: App;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AppForm = ({ app, modalHandler }: Props): JSX.Element => {
|
export const AppForm = ({ modalHandler }: Props): JSX.Element => {
|
||||||
|
const { appInUpdate } = useSelector((state: State) => state.apps);
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { addApp, updateApp } = bindActionCreators(actionCreators, dispatch);
|
const { addApp, updateApp, setEditApp } = bindActionCreators(
|
||||||
|
actionCreators,
|
||||||
|
dispatch
|
||||||
|
);
|
||||||
|
|
||||||
const [useCustomIcon, toggleUseCustomIcon] = useState<boolean>(false);
|
const [useCustomIcon, toggleUseCustomIcon] = useState<boolean>(false);
|
||||||
const [customIcon, setCustomIcon] = useState<File | null>(null);
|
const [customIcon, setCustomIcon] = useState<File | null>(null);
|
||||||
const [formData, setFormData] = useState<NewApp>(newAppTemplate);
|
const [formData, setFormData] = useState<NewApp>(newAppTemplate);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (app) {
|
if (appInUpdate) {
|
||||||
setFormData({
|
setFormData({
|
||||||
...app,
|
...appInUpdate,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setFormData(newAppTemplate);
|
setFormData(newAppTemplate);
|
||||||
}
|
}
|
||||||
}, [app]);
|
}, [appInUpdate]);
|
||||||
|
|
||||||
const inputChangeHandler = (
|
const inputChangeHandler = (
|
||||||
e: ChangeEvent<HTMLInputElement | HTMLSelectElement>,
|
e: ChangeEvent<HTMLInputElement | HTMLSelectElement>,
|
||||||
@ -66,7 +71,7 @@ export const AppForm = ({ app, modalHandler }: Props): JSX.Element => {
|
|||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!app) {
|
if (!appInUpdate) {
|
||||||
if (customIcon) {
|
if (customIcon) {
|
||||||
const data = createFormData();
|
const data = createFormData();
|
||||||
addApp(data);
|
addApp(data);
|
||||||
@ -76,14 +81,15 @@ export const AppForm = ({ app, modalHandler }: Props): JSX.Element => {
|
|||||||
} else {
|
} else {
|
||||||
if (customIcon) {
|
if (customIcon) {
|
||||||
const data = createFormData();
|
const data = createFormData();
|
||||||
updateApp(app.id, data);
|
updateApp(appInUpdate.id, data);
|
||||||
} else {
|
} else {
|
||||||
updateApp(app.id, formData);
|
updateApp(appInUpdate.id, formData);
|
||||||
modalHandler();
|
modalHandler();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setFormData(newAppTemplate);
|
setFormData(newAppTemplate);
|
||||||
|
setEditApp(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -154,7 +160,7 @@ export const AppForm = ({ app, modalHandler }: Props): JSX.Element => {
|
|||||||
id="icon"
|
id="icon"
|
||||||
required
|
required
|
||||||
onChange={(e) => fileChangeHandler(e)}
|
onChange={(e) => fileChangeHandler(e)}
|
||||||
accept=".jpg,.jpeg,.png,.svg"
|
accept=".jpg,.jpeg,.png,.svg,.ico"
|
||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@ -182,7 +188,7 @@ export const AppForm = ({ app, modalHandler }: Props): JSX.Element => {
|
|||||||
</select>
|
</select>
|
||||||
</InputGroup>
|
</InputGroup>
|
||||||
|
|
||||||
{!app ? (
|
{!appInUpdate ? (
|
||||||
<Button>Add new application</Button>
|
<Button>Add new application</Button>
|
||||||
) : (
|
) : (
|
||||||
<Button>Update application</Button>
|
<Button>Update application</Button>
|
||||||
|
@ -20,21 +20,3 @@
|
|||||||
grid-template-columns: repeat(4, 1fr);
|
grid-template-columns: repeat(4, 1fr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.GridMessage {
|
|
||||||
color: var(--color-primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.GridMessage a {
|
|
||||||
color: var(--color-accent);
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.AppsMessage {
|
|
||||||
color: var(--color-primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.AppsMessage a {
|
|
||||||
color: var(--color-accent);
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
@ -3,6 +3,7 @@ import { Link } from 'react-router-dom';
|
|||||||
import { App } from '../../../interfaces/App';
|
import { App } from '../../../interfaces/App';
|
||||||
|
|
||||||
import { AppCard } from '../AppCard/AppCard';
|
import { AppCard } from '../AppCard/AppCard';
|
||||||
|
import { Message } from '../../UI';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
apps: App[];
|
apps: App[];
|
||||||
@ -13,7 +14,10 @@ interface Props {
|
|||||||
export const AppGrid = (props: Props): JSX.Element => {
|
export const AppGrid = (props: Props): JSX.Element => {
|
||||||
let apps: JSX.Element;
|
let apps: JSX.Element;
|
||||||
|
|
||||||
if (props.apps.length > 0) {
|
if (props.searching || props.apps.length) {
|
||||||
|
if (!props.apps.length) {
|
||||||
|
apps = <Message>No apps match your search criteria</Message>;
|
||||||
|
} else {
|
||||||
apps = (
|
apps = (
|
||||||
<div className={classes.AppGrid}>
|
<div className={classes.AppGrid}>
|
||||||
{props.apps.map((app: App): JSX.Element => {
|
{props.apps.map((app: App): JSX.Element => {
|
||||||
@ -21,28 +25,21 @@ export const AppGrid = (props: Props): JSX.Element => {
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
if (props.totalApps) {
|
|
||||||
if (props.searching) {
|
|
||||||
apps = (
|
|
||||||
<p className={classes.AppsMessage}>
|
|
||||||
No apps match your search criteria
|
|
||||||
</p>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
apps = (
|
|
||||||
<p className={classes.AppsMessage}>
|
|
||||||
There are no pinned applications. You can pin them from the{' '}
|
|
||||||
<Link to="/applications">/applications</Link> menu
|
|
||||||
</p>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (props.totalApps) {
|
||||||
apps = (
|
apps = (
|
||||||
<p className={classes.AppsMessage}>
|
<Message>
|
||||||
|
There are no pinned applications. You can pin them from the{' '}
|
||||||
|
<Link to="/applications">/applications</Link> menu
|
||||||
|
</Message>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
apps = (
|
||||||
|
<Message>
|
||||||
You don't have any applications. You can add a new one from{' '}
|
You don't have any applications. You can add a new one from{' '}
|
||||||
<Link to="/applications">/applications</Link> menu
|
<Link to="/applications">/applications</Link> menu
|
||||||
</p>
|
</Message>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Fragment, KeyboardEvent, useState, useEffect } from 'react';
|
import { Fragment, useState, useEffect } from 'react';
|
||||||
import {
|
import {
|
||||||
DragDropContext,
|
DragDropContext,
|
||||||
Droppable,
|
Droppable,
|
||||||
@ -9,21 +9,19 @@ import { Link } from 'react-router-dom';
|
|||||||
|
|
||||||
// Redux
|
// Redux
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
|
|
||||||
// Typescript
|
|
||||||
import { App } from '../../../interfaces';
|
|
||||||
|
|
||||||
// CSS
|
|
||||||
import classes from './AppTable.module.css';
|
|
||||||
|
|
||||||
// UI
|
|
||||||
import { Icon, Table } from '../../UI';
|
|
||||||
import { State } from '../../../store/reducers';
|
import { State } from '../../../store/reducers';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { actionCreators } from '../../../store';
|
import { actionCreators } from '../../../store';
|
||||||
|
|
||||||
|
// Typescript
|
||||||
|
import { App } from '../../../interfaces';
|
||||||
|
|
||||||
|
// Other
|
||||||
|
import { Message, Table } from '../../UI';
|
||||||
|
import { TableActions } from '../../Actions/TableActions';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
updateAppHandler: (app: App) => void;
|
openFormForUpdating: (app: App) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AppTable = (props: Props): JSX.Element => {
|
export const AppTable = (props: Props): JSX.Element => {
|
||||||
@ -33,49 +31,18 @@ export const AppTable = (props: Props): JSX.Element => {
|
|||||||
} = useSelector((state: State) => state);
|
} = useSelector((state: State) => state);
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { pinApp, deleteApp, reorderApps, updateConfig, createNotification } =
|
const { pinApp, deleteApp, reorderApps, createNotification, updateApp } =
|
||||||
bindActionCreators(actionCreators, dispatch);
|
bindActionCreators(actionCreators, dispatch);
|
||||||
|
|
||||||
const [localApps, setLocalApps] = useState<App[]>([]);
|
const [localApps, setLocalApps] = useState<App[]>([]);
|
||||||
const [isCustomOrder, setIsCustomOrder] = useState<boolean>(false);
|
|
||||||
|
|
||||||
// Copy apps array
|
// Copy apps array
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setLocalApps([...apps]);
|
setLocalApps([...apps]);
|
||||||
}, [apps]);
|
}, [apps]);
|
||||||
|
|
||||||
// Check ordering
|
|
||||||
useEffect(() => {
|
|
||||||
const order = config.useOrdering;
|
|
||||||
|
|
||||||
if (order === 'orderId') {
|
|
||||||
setIsCustomOrder(true);
|
|
||||||
}
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const deleteAppHandler = (app: App): void => {
|
|
||||||
const proceed = window.confirm(
|
|
||||||
`Are you sure you want to delete ${app.name} at ${app.url} ?`
|
|
||||||
);
|
|
||||||
|
|
||||||
if (proceed) {
|
|
||||||
deleteApp(app.id);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Support keyboard navigation for actions
|
|
||||||
const keyboardActionHandler = (
|
|
||||||
e: KeyboardEvent,
|
|
||||||
app: App,
|
|
||||||
handler: Function
|
|
||||||
) => {
|
|
||||||
if (e.key === 'Enter') {
|
|
||||||
handler(app);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const dragEndHanlder = (result: DropResult): void => {
|
const dragEndHanlder = (result: DropResult): void => {
|
||||||
if (!isCustomOrder) {
|
if (config.useOrdering !== 'orderId') {
|
||||||
createNotification({
|
createNotification({
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
message: 'Custom order is disabled',
|
message: 'Custom order is disabled',
|
||||||
@ -95,18 +62,43 @@ export const AppTable = (props: Props): JSX.Element => {
|
|||||||
reorderApps(tmpApps);
|
reorderApps(tmpApps);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Action handlers
|
||||||
|
const deleteAppHandler = (id: number, name: string) => {
|
||||||
|
const proceed = window.confirm(`Are you sure you want to delete ${name}?`);
|
||||||
|
|
||||||
|
if (proceed) {
|
||||||
|
deleteApp(id);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateAppHandler = (id: number) => {
|
||||||
|
const app = apps.find((a) => a.id === id) as App;
|
||||||
|
props.openFormForUpdating(app);
|
||||||
|
};
|
||||||
|
|
||||||
|
const pinAppHandler = (id: number) => {
|
||||||
|
const app = apps.find((a) => a.id === id) as App;
|
||||||
|
pinApp(app);
|
||||||
|
};
|
||||||
|
|
||||||
|
const changeAppVisibiltyHandler = (id: number) => {
|
||||||
|
const app = apps.find((a) => a.id === id) as App;
|
||||||
|
updateApp(id, { ...app, isPublic: !app.isPublic });
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<div className={classes.Message}>
|
<Message isPrimary={false}>
|
||||||
{isCustomOrder ? (
|
{config.useOrdering === 'orderId' ? (
|
||||||
<p>You can drag and drop single rows to reorder application</p>
|
<p>You can drag and drop single rows to reorder application</p>
|
||||||
) : (
|
) : (
|
||||||
<p>
|
<p>
|
||||||
Custom order is disabled. You can change it in{' '}
|
Custom order is disabled. You can change it in the{' '}
|
||||||
<Link to="/settings/other">settings</Link>
|
<Link to="/settings/interface">settings</Link>
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</Message>
|
||||||
|
|
||||||
<DragDropContext onDragEnd={dragEndHanlder}>
|
<DragDropContext onDragEnd={dragEndHanlder}>
|
||||||
<Droppable droppableId="apps">
|
<Droppable droppableId="apps">
|
||||||
{(provided) => (
|
{(provided) => (
|
||||||
@ -143,54 +135,15 @@ export const AppTable = (props: Props): JSX.Element => {
|
|||||||
<td style={{ width: '200px' }}>
|
<td style={{ width: '200px' }}>
|
||||||
{app.isPublic ? 'Visible' : 'Hidden'}
|
{app.isPublic ? 'Visible' : 'Hidden'}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
{!snapshot.isDragging && (
|
{!snapshot.isDragging && (
|
||||||
<td className={classes.TableActions}>
|
<TableActions
|
||||||
<div
|
entity={app}
|
||||||
className={classes.TableAction}
|
deleteHandler={deleteAppHandler}
|
||||||
onClick={() => deleteAppHandler(app)}
|
updateHandler={updateAppHandler}
|
||||||
onKeyDown={(e) =>
|
pinHanlder={pinAppHandler}
|
||||||
keyboardActionHandler(
|
changeVisibilty={changeAppVisibiltyHandler}
|
||||||
e,
|
|
||||||
app,
|
|
||||||
deleteAppHandler
|
|
||||||
)
|
|
||||||
}
|
|
||||||
tabIndex={0}
|
|
||||||
>
|
|
||||||
<Icon icon="mdiDelete" />
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className={classes.TableAction}
|
|
||||||
onClick={() => props.updateAppHandler(app)}
|
|
||||||
onKeyDown={(e) =>
|
|
||||||
keyboardActionHandler(
|
|
||||||
e,
|
|
||||||
app,
|
|
||||||
props.updateAppHandler
|
|
||||||
)
|
|
||||||
}
|
|
||||||
tabIndex={0}
|
|
||||||
>
|
|
||||||
<Icon icon="mdiPencil" />
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className={classes.TableAction}
|
|
||||||
onClick={() => pinApp(app)}
|
|
||||||
onKeyDown={(e) =>
|
|
||||||
keyboardActionHandler(e, app, pinApp)
|
|
||||||
}
|
|
||||||
tabIndex={0}
|
|
||||||
>
|
|
||||||
{app.isPinned ? (
|
|
||||||
<Icon
|
|
||||||
icon="mdiPinOff"
|
|
||||||
color="var(--color-accent)"
|
|
||||||
/>
|
/>
|
||||||
) : (
|
|
||||||
<Icon icon="mdiPin" />
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
)}
|
)}
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
|
@ -19,7 +19,6 @@ import { AppForm } from './AppForm/AppForm';
|
|||||||
import { AppTable } from './AppTable/AppTable';
|
import { AppTable } from './AppTable/AppTable';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import { appTemplate } from '../../utility';
|
|
||||||
import { State } from '../../store/reducers';
|
import { State } from '../../store/reducers';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { actionCreators } from '../../store';
|
import { actionCreators } from '../../store';
|
||||||
@ -29,57 +28,53 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const Apps = (props: Props): JSX.Element => {
|
export const Apps = (props: Props): JSX.Element => {
|
||||||
|
// Get Redux state
|
||||||
const {
|
const {
|
||||||
apps: { apps, loading },
|
apps: { apps, loading },
|
||||||
auth: { isAuthenticated },
|
auth: { isAuthenticated },
|
||||||
} = useSelector((state: State) => state);
|
} = useSelector((state: State) => state);
|
||||||
|
|
||||||
|
// Get Redux action creators
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { getApps } = bindActionCreators(actionCreators, dispatch);
|
const { getApps, setEditApp } = bindActionCreators(actionCreators, dispatch);
|
||||||
|
|
||||||
const [modalIsOpen, setModalIsOpen] = useState(false);
|
|
||||||
const [isInEdit, setIsInEdit] = useState(false);
|
|
||||||
const [isInUpdate, setIsInUpdate] = useState(false);
|
|
||||||
const [appInUpdate, setAppInUpdate] = useState<App>(appTemplate);
|
|
||||||
|
|
||||||
|
// Load apps if array is empty
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!apps.length) {
|
if (!apps.length) {
|
||||||
getApps();
|
getApps();
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// observe if user is authenticated -> set default view if not
|
// Form
|
||||||
|
const [modalIsOpen, setModalIsOpen] = useState(false);
|
||||||
|
const [showTable, setShowTable] = useState(false);
|
||||||
|
|
||||||
|
// Observe if user is authenticated -> set default view if not
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isAuthenticated) {
|
if (!isAuthenticated) {
|
||||||
setIsInEdit(false);
|
setShowTable(false);
|
||||||
setModalIsOpen(false);
|
setModalIsOpen(false);
|
||||||
}
|
}
|
||||||
}, [isAuthenticated]);
|
}, [isAuthenticated]);
|
||||||
|
|
||||||
|
// Form actions
|
||||||
const toggleModal = (): void => {
|
const toggleModal = (): void => {
|
||||||
setModalIsOpen(!modalIsOpen);
|
setModalIsOpen(!modalIsOpen);
|
||||||
setIsInUpdate(false);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const toggleEdit = (): void => {
|
const toggleEdit = (): void => {
|
||||||
setIsInEdit(!isInEdit);
|
setShowTable(!showTable);
|
||||||
setIsInUpdate(false);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const toggleUpdate = (app: App): void => {
|
const openFormForUpdating = (app: App): void => {
|
||||||
setAppInUpdate(app);
|
setEditApp(app);
|
||||||
setIsInUpdate(true);
|
|
||||||
setModalIsOpen(true);
|
setModalIsOpen(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
<Modal isOpen={modalIsOpen} setIsOpen={setModalIsOpen}>
|
<Modal isOpen={modalIsOpen} setIsOpen={setModalIsOpen}>
|
||||||
{!isInUpdate ? (
|
|
||||||
<AppForm modalHandler={toggleModal} />
|
<AppForm modalHandler={toggleModal} />
|
||||||
) : (
|
|
||||||
<AppForm modalHandler={toggleModal} app={appInUpdate} />
|
|
||||||
)}
|
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Headline
|
<Headline
|
||||||
@ -89,7 +84,14 @@ export const Apps = (props: Props): JSX.Element => {
|
|||||||
|
|
||||||
{isAuthenticated && (
|
{isAuthenticated && (
|
||||||
<div className={classes.ActionsContainer}>
|
<div className={classes.ActionsContainer}>
|
||||||
<ActionButton name="Add" icon="mdiPlusBox" handler={toggleModal} />
|
<ActionButton
|
||||||
|
name="Add"
|
||||||
|
icon="mdiPlusBox"
|
||||||
|
handler={() => {
|
||||||
|
setEditApp(null);
|
||||||
|
toggleModal();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<ActionButton name="Edit" icon="mdiPencil" handler={toggleEdit} />
|
<ActionButton name="Edit" icon="mdiPencil" handler={toggleEdit} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -97,10 +99,10 @@ export const Apps = (props: Props): JSX.Element => {
|
|||||||
<div className={classes.Apps}>
|
<div className={classes.Apps}>
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<Spinner />
|
<Spinner />
|
||||||
) : !isInEdit ? (
|
) : !showTable ? (
|
||||||
<AppGrid apps={apps} searching={props.searching} />
|
<AppGrid apps={apps} searching={props.searching} />
|
||||||
) : (
|
) : (
|
||||||
<AppTable updateAppHandler={toggleUpdate} />
|
<AppTable openFormForUpdating={openFormForUpdating} />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Container>
|
</Container>
|
||||||
|
@ -10,6 +10,10 @@
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.BookmarkHeader:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
.Bookmarks {
|
.Bookmarks {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
@ -1,28 +1,52 @@
|
|||||||
import { Fragment } from 'react';
|
import { Fragment } from 'react';
|
||||||
|
|
||||||
import { useSelector } from 'react-redux';
|
// Redux
|
||||||
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { State } from '../../../store/reducers';
|
import { State } from '../../../store/reducers';
|
||||||
|
import { bindActionCreators } from 'redux';
|
||||||
|
import { actionCreators } from '../../../store';
|
||||||
|
|
||||||
|
// Typescript
|
||||||
import { Bookmark, Category } from '../../../interfaces';
|
import { Bookmark, Category } from '../../../interfaces';
|
||||||
|
|
||||||
|
// Other
|
||||||
import classes from './BookmarkCard.module.css';
|
import classes from './BookmarkCard.module.css';
|
||||||
|
|
||||||
import { Icon } from '../../UI';
|
import { Icon } from '../../UI';
|
||||||
|
|
||||||
import { iconParser, isImage, isSvg, isUrl, urlParser } from '../../../utility';
|
import { iconParser, isImage, isSvg, isUrl, urlParser } from '../../../utility';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
category: Category;
|
category: Category;
|
||||||
|
fromHomepage?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const BookmarkCard = (props: Props): JSX.Element => {
|
export const BookmarkCard = (props: Props): JSX.Element => {
|
||||||
const { config } = useSelector((state: State) => state.config);
|
const { category, fromHomepage = false } = props;
|
||||||
|
|
||||||
|
const {
|
||||||
|
config: { config },
|
||||||
|
auth: { isAuthenticated },
|
||||||
|
} = useSelector((state: State) => state);
|
||||||
|
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const { setEditCategory } = bindActionCreators(actionCreators, dispatch);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.BookmarkCard}>
|
<div className={classes.BookmarkCard}>
|
||||||
<h3>{props.category.name}</h3>
|
<h3
|
||||||
|
className={
|
||||||
|
fromHomepage || !isAuthenticated ? '' : classes.BookmarkHeader
|
||||||
|
}
|
||||||
|
onClick={() => {
|
||||||
|
if (!fromHomepage && isAuthenticated) {
|
||||||
|
setEditCategory(category);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{category.name}
|
||||||
|
</h3>
|
||||||
|
|
||||||
<div className={classes.Bookmarks}>
|
<div className={classes.Bookmarks}>
|
||||||
{props.category.bookmarks.map((bookmark: Bookmark) => {
|
{category.bookmarks.map((bookmark: Bookmark) => {
|
||||||
const redirectUrl = urlParser(bookmark.url)[1];
|
const redirectUrl = urlParser(bookmark.url)[1];
|
||||||
|
|
||||||
let iconEl: JSX.Element = <Fragment></Fragment>;
|
let iconEl: JSX.Element = <Fragment></Fragment>;
|
||||||
|
@ -20,12 +20,3 @@
|
|||||||
grid-template-columns: repeat(4, 1fr);
|
grid-template-columns: repeat(4, 1fr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.BookmarksMessage {
|
|
||||||
color: var(--color-primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.BookmarksMessage a {
|
|
||||||
color: var(--color-accent);
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
@ -5,48 +5,57 @@ import classes from './BookmarkGrid.module.css';
|
|||||||
import { Category } from '../../../interfaces';
|
import { Category } from '../../../interfaces';
|
||||||
|
|
||||||
import { BookmarkCard } from '../BookmarkCard/BookmarkCard';
|
import { BookmarkCard } from '../BookmarkCard/BookmarkCard';
|
||||||
|
import { Message } from '../../UI';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
categories: Category[];
|
categories: Category[];
|
||||||
totalCategories?: number;
|
totalCategories?: number;
|
||||||
searching: boolean;
|
searching: boolean;
|
||||||
|
fromHomepage?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const BookmarkGrid = (props: Props): JSX.Element => {
|
export const BookmarkGrid = (props: Props): JSX.Element => {
|
||||||
|
const {
|
||||||
|
categories,
|
||||||
|
totalCategories,
|
||||||
|
searching,
|
||||||
|
fromHomepage = false,
|
||||||
|
} = props;
|
||||||
|
|
||||||
let bookmarks: JSX.Element;
|
let bookmarks: JSX.Element;
|
||||||
|
|
||||||
if (props.categories.length) {
|
if (categories.length) {
|
||||||
if (props.searching && !props.categories[0].bookmarks.length) {
|
if (searching && !categories[0].bookmarks.length) {
|
||||||
bookmarks = (
|
bookmarks = <Message>No bookmarks match your search criteria</Message>;
|
||||||
<p className={classes.BookmarksMessage}>
|
|
||||||
No bookmarks match your search criteria
|
|
||||||
</p>
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
bookmarks = (
|
bookmarks = (
|
||||||
<div className={classes.BookmarkGrid}>
|
<div className={classes.BookmarkGrid}>
|
||||||
{props.categories.map(
|
{categories.map(
|
||||||
(category: Category): JSX.Element => (
|
(category: Category): JSX.Element => (
|
||||||
<BookmarkCard category={category} key={category.id} />
|
<BookmarkCard
|
||||||
|
category={category}
|
||||||
|
fromHomepage={fromHomepage}
|
||||||
|
key={category.id}
|
||||||
|
/>
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (props.totalCategories) {
|
if (totalCategories) {
|
||||||
bookmarks = (
|
bookmarks = (
|
||||||
<p className={classes.BookmarksMessage}>
|
<Message>
|
||||||
There are no pinned categories. You can pin them from the{' '}
|
There are no pinned categories. You can pin them from the{' '}
|
||||||
<Link to="/bookmarks">/bookmarks</Link> menu
|
<Link to="/bookmarks">/bookmarks</Link> menu
|
||||||
</p>
|
</Message>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
bookmarks = (
|
bookmarks = (
|
||||||
<p className={classes.BookmarksMessage}>
|
<Message>
|
||||||
You don't have any bookmarks. You can add a new one from{' '}
|
You don't have any bookmarks. You can add a new one from{' '}
|
||||||
<Link to="/bookmarks">/bookmarks</Link> menu
|
<Link to="/bookmarks">/bookmarks</Link> menu
|
||||||
</p>
|
</Message>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
.TableActions {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.TableAction {
|
|
||||||
width: 22px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.TableAction:hover {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.Message {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: baseline;
|
|
||||||
color: var(--color-primary);
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.Message a {
|
|
||||||
color: var(--color-accent);
|
|
||||||
}
|
|
||||||
|
|
||||||
.Message a:hover {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
@ -1,272 +0,0 @@
|
|||||||
import { KeyboardEvent, useState, useEffect, Fragment } from 'react';
|
|
||||||
import {
|
|
||||||
DragDropContext,
|
|
||||||
Droppable,
|
|
||||||
Draggable,
|
|
||||||
DropResult,
|
|
||||||
} from 'react-beautiful-dnd';
|
|
||||||
import { Link } from 'react-router-dom';
|
|
||||||
|
|
||||||
// Redux
|
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
|
||||||
import { State } from '../../../store/reducers';
|
|
||||||
import { bindActionCreators } from 'redux';
|
|
||||||
import { actionCreators } from '../../../store';
|
|
||||||
|
|
||||||
// Typescript
|
|
||||||
import { Bookmark, Category } from '../../../interfaces';
|
|
||||||
import { ContentType } from '../Bookmarks';
|
|
||||||
|
|
||||||
// CSS
|
|
||||||
import classes from './BookmarkTable.module.css';
|
|
||||||
|
|
||||||
// UI
|
|
||||||
import { Table, Icon } from '../../UI';
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
contentType: ContentType;
|
|
||||||
categories: Category[];
|
|
||||||
updateHandler: (data: Category | Bookmark) => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const BookmarkTable = (props: Props): JSX.Element => {
|
|
||||||
const { config } = useSelector((state: State) => state.config);
|
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
|
||||||
const {
|
|
||||||
pinCategory,
|
|
||||||
deleteCategory,
|
|
||||||
deleteBookmark,
|
|
||||||
createNotification,
|
|
||||||
reorderCategories,
|
|
||||||
} = bindActionCreators(actionCreators, dispatch);
|
|
||||||
|
|
||||||
const [localCategories, setLocalCategories] = useState<Category[]>([]);
|
|
||||||
const [isCustomOrder, setIsCustomOrder] = useState<boolean>(false);
|
|
||||||
|
|
||||||
// Copy categories array
|
|
||||||
useEffect(() => {
|
|
||||||
setLocalCategories([...props.categories]);
|
|
||||||
}, [props.categories]);
|
|
||||||
|
|
||||||
// Check ordering
|
|
||||||
useEffect(() => {
|
|
||||||
const order = config.useOrdering;
|
|
||||||
|
|
||||||
if (order === 'orderId') {
|
|
||||||
setIsCustomOrder(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const deleteCategoryHandler = (category: Category): void => {
|
|
||||||
const proceed = window.confirm(
|
|
||||||
`Are you sure you want to delete ${category.name}? It will delete ALL assigned bookmarks`
|
|
||||||
);
|
|
||||||
|
|
||||||
if (proceed) {
|
|
||||||
deleteCategory(category.id);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const deleteBookmarkHandler = (bookmark: Bookmark): void => {
|
|
||||||
const proceed = window.confirm(
|
|
||||||
`Are you sure you want to delete ${bookmark.name}?`
|
|
||||||
);
|
|
||||||
|
|
||||||
if (proceed) {
|
|
||||||
deleteBookmark(bookmark.id, bookmark.categoryId);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const keyboardActionHandler = (
|
|
||||||
e: KeyboardEvent,
|
|
||||||
category: Category,
|
|
||||||
handler: Function
|
|
||||||
) => {
|
|
||||||
if (e.key === 'Enter') {
|
|
||||||
handler(category);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const dragEndHanlder = (result: DropResult): void => {
|
|
||||||
if (!isCustomOrder) {
|
|
||||||
createNotification({
|
|
||||||
title: 'Error',
|
|
||||||
message: 'Custom order is disabled',
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!result.destination) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const tmpCategories = [...localCategories];
|
|
||||||
const [movedApp] = tmpCategories.splice(result.source.index, 1);
|
|
||||||
tmpCategories.splice(result.destination.index, 0, movedApp);
|
|
||||||
|
|
||||||
setLocalCategories(tmpCategories);
|
|
||||||
reorderCategories(tmpCategories);
|
|
||||||
};
|
|
||||||
|
|
||||||
if (props.contentType === ContentType.category) {
|
|
||||||
return (
|
|
||||||
<Fragment>
|
|
||||||
<div className={classes.Message}>
|
|
||||||
{isCustomOrder ? (
|
|
||||||
<p>You can drag and drop single rows to reorder categories</p>
|
|
||||||
) : (
|
|
||||||
<p>
|
|
||||||
Custom order is disabled. You can change it in{' '}
|
|
||||||
<Link to="/settings/other">settings</Link>
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<DragDropContext onDragEnd={dragEndHanlder}>
|
|
||||||
<Droppable droppableId="categories">
|
|
||||||
{(provided) => (
|
|
||||||
<Table
|
|
||||||
headers={['Name', 'Visibility', 'Actions']}
|
|
||||||
innerRef={provided.innerRef}
|
|
||||||
>
|
|
||||||
{localCategories.map(
|
|
||||||
(category: Category, index): JSX.Element => {
|
|
||||||
return (
|
|
||||||
<Draggable
|
|
||||||
key={category.id}
|
|
||||||
draggableId={category.id.toString()}
|
|
||||||
index={index}
|
|
||||||
>
|
|
||||||
{(provided, snapshot) => {
|
|
||||||
const style = {
|
|
||||||
border: snapshot.isDragging
|
|
||||||
? '1px solid var(--color-accent)'
|
|
||||||
: 'none',
|
|
||||||
borderRadius: '4px',
|
|
||||||
...provided.draggableProps.style,
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<tr
|
|
||||||
{...provided.draggableProps}
|
|
||||||
{...provided.dragHandleProps}
|
|
||||||
ref={provided.innerRef}
|
|
||||||
style={style}
|
|
||||||
>
|
|
||||||
<td style={{ width: '300px' }}>
|
|
||||||
{category.name}
|
|
||||||
</td>
|
|
||||||
<td style={{ width: '300px' }}>
|
|
||||||
{category.isPublic ? 'Visible' : 'Hidden'}
|
|
||||||
</td>
|
|
||||||
{!snapshot.isDragging && (
|
|
||||||
<td className={classes.TableActions}>
|
|
||||||
<div
|
|
||||||
className={classes.TableAction}
|
|
||||||
onClick={() =>
|
|
||||||
deleteCategoryHandler(category)
|
|
||||||
}
|
|
||||||
onKeyDown={(e) =>
|
|
||||||
keyboardActionHandler(
|
|
||||||
e,
|
|
||||||
category,
|
|
||||||
deleteCategoryHandler
|
|
||||||
)
|
|
||||||
}
|
|
||||||
tabIndex={0}
|
|
||||||
>
|
|
||||||
<Icon icon="mdiDelete" />
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className={classes.TableAction}
|
|
||||||
onClick={() =>
|
|
||||||
props.updateHandler(category)
|
|
||||||
}
|
|
||||||
tabIndex={0}
|
|
||||||
>
|
|
||||||
<Icon icon="mdiPencil" />
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className={classes.TableAction}
|
|
||||||
onClick={() => pinCategory(category)}
|
|
||||||
onKeyDown={(e) =>
|
|
||||||
keyboardActionHandler(
|
|
||||||
e,
|
|
||||||
category,
|
|
||||||
pinCategory
|
|
||||||
)
|
|
||||||
}
|
|
||||||
tabIndex={0}
|
|
||||||
>
|
|
||||||
{category.isPinned ? (
|
|
||||||
<Icon
|
|
||||||
icon="mdiPinOff"
|
|
||||||
color="var(--color-accent)"
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<Icon icon="mdiPin" />
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
)}
|
|
||||||
</tr>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
</Draggable>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
)}
|
|
||||||
</Table>
|
|
||||||
)}
|
|
||||||
</Droppable>
|
|
||||||
</DragDropContext>
|
|
||||||
</Fragment>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
const bookmarks: { bookmark: Bookmark; categoryName: string }[] = [];
|
|
||||||
props.categories.forEach((category: Category) => {
|
|
||||||
category.bookmarks.forEach((bookmark: Bookmark) => {
|
|
||||||
bookmarks.push({
|
|
||||||
bookmark,
|
|
||||||
categoryName: category.name,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Table
|
|
||||||
headers={['Name', 'URL', 'Icon', 'Visibility', 'Category', 'Actions']}
|
|
||||||
>
|
|
||||||
{bookmarks.map(
|
|
||||||
(bookmark: { bookmark: Bookmark; categoryName: string }) => {
|
|
||||||
return (
|
|
||||||
<tr key={bookmark.bookmark.id}>
|
|
||||||
<td>{bookmark.bookmark.name}</td>
|
|
||||||
<td>{bookmark.bookmark.url}</td>
|
|
||||||
<td>{bookmark.bookmark.icon}</td>
|
|
||||||
<td>{bookmark.bookmark.isPublic ? 'Visible' : 'Hidden'}</td>
|
|
||||||
<td>{bookmark.categoryName}</td>
|
|
||||||
<td className={classes.TableActions}>
|
|
||||||
<div
|
|
||||||
className={classes.TableAction}
|
|
||||||
onClick={() => deleteBookmarkHandler(bookmark.bookmark)}
|
|
||||||
tabIndex={0}
|
|
||||||
>
|
|
||||||
<Icon icon="mdiDelete" />
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className={classes.TableAction}
|
|
||||||
onClick={() => props.updateHandler(bookmark.bookmark)}
|
|
||||||
tabIndex={0}
|
|
||||||
>
|
|
||||||
<Icon icon="mdiPencil" />
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
)}
|
|
||||||
</Table>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
@ -14,15 +14,19 @@ import { Category, Bookmark } from '../../interfaces';
|
|||||||
import classes from './Bookmarks.module.css';
|
import classes from './Bookmarks.module.css';
|
||||||
|
|
||||||
// UI
|
// UI
|
||||||
import { Container, Headline, ActionButton, Spinner, Modal } from '../UI';
|
import {
|
||||||
|
Container,
|
||||||
|
Headline,
|
||||||
|
ActionButton,
|
||||||
|
Spinner,
|
||||||
|
Modal,
|
||||||
|
Message,
|
||||||
|
} from '../UI';
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
import { BookmarkGrid } from './BookmarkGrid/BookmarkGrid';
|
import { BookmarkGrid } from './BookmarkGrid/BookmarkGrid';
|
||||||
import { BookmarkTable } from './BookmarkTable/BookmarkTable';
|
|
||||||
import { Form } from './Form/Form';
|
import { Form } from './Form/Form';
|
||||||
|
import { Table } from './Table/Table';
|
||||||
// Utils
|
|
||||||
import { bookmarkTemplate, categoryTemplate } from '../../utility';
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
searching: boolean;
|
searching: boolean;
|
||||||
@ -34,76 +38,101 @@ export enum ContentType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const Bookmarks = (props: Props): JSX.Element => {
|
export const Bookmarks = (props: Props): JSX.Element => {
|
||||||
|
// Get Redux state
|
||||||
const {
|
const {
|
||||||
bookmarks: { loading, categories },
|
bookmarks: { loading, categories, categoryInEdit },
|
||||||
auth: { isAuthenticated },
|
auth: { isAuthenticated },
|
||||||
} = useSelector((state: State) => state);
|
} = useSelector((state: State) => state);
|
||||||
|
|
||||||
|
// Get Redux action creators
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { getCategories } = bindActionCreators(actionCreators, dispatch);
|
const { getCategories, setEditCategory, setEditBookmark } =
|
||||||
|
bindActionCreators(actionCreators, dispatch);
|
||||||
const [modalIsOpen, setModalIsOpen] = useState(false);
|
|
||||||
const [formContentType, setFormContentType] = useState(ContentType.category);
|
|
||||||
const [isInEdit, setIsInEdit] = useState(false);
|
|
||||||
const [tableContentType, setTableContentType] = useState(
|
|
||||||
ContentType.category
|
|
||||||
);
|
|
||||||
const [isInUpdate, setIsInUpdate] = useState(false);
|
|
||||||
const [categoryInUpdate, setCategoryInUpdate] =
|
|
||||||
useState<Category>(categoryTemplate);
|
|
||||||
const [bookmarkInUpdate, setBookmarkInUpdate] =
|
|
||||||
useState<Bookmark>(bookmarkTemplate);
|
|
||||||
|
|
||||||
|
// Load categories if array is empty
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!categories.length) {
|
if (!categories.length) {
|
||||||
getCategories();
|
getCategories();
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// observe if user is authenticated -> set default view if not
|
// Form
|
||||||
|
const [modalIsOpen, setModalIsOpen] = useState(false);
|
||||||
|
const [formContentType, setFormContentType] = useState(ContentType.category);
|
||||||
|
const [isInUpdate, setIsInUpdate] = useState(false);
|
||||||
|
|
||||||
|
// Table
|
||||||
|
const [showTable, setShowTable] = useState(false);
|
||||||
|
const [tableContentType, setTableContentType] = useState(
|
||||||
|
ContentType.category
|
||||||
|
);
|
||||||
|
|
||||||
|
// Observe if user is authenticated -> set default view (grid) if not
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isAuthenticated) {
|
if (!isAuthenticated) {
|
||||||
setIsInEdit(false);
|
setShowTable(false);
|
||||||
setModalIsOpen(false);
|
setModalIsOpen(false);
|
||||||
}
|
}
|
||||||
}, [isAuthenticated]);
|
}, [isAuthenticated]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (categoryInEdit && !modalIsOpen) {
|
||||||
|
setTableContentType(ContentType.bookmark);
|
||||||
|
setShowTable(true);
|
||||||
|
}
|
||||||
|
}, [categoryInEdit]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setShowTable(false);
|
||||||
|
setEditCategory(null);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// Form actions
|
||||||
const toggleModal = (): void => {
|
const toggleModal = (): void => {
|
||||||
setModalIsOpen(!modalIsOpen);
|
setModalIsOpen(!modalIsOpen);
|
||||||
};
|
};
|
||||||
|
|
||||||
const addActionHandler = (contentType: ContentType) => {
|
const openFormForAdding = (contentType: ContentType) => {
|
||||||
setFormContentType(contentType);
|
setFormContentType(contentType);
|
||||||
setIsInUpdate(false);
|
setIsInUpdate(false);
|
||||||
toggleModal();
|
toggleModal();
|
||||||
};
|
};
|
||||||
|
|
||||||
const editActionHandler = (contentType: ContentType) => {
|
const openFormForUpdating = (data: Category | Bookmark): void => {
|
||||||
// We're in the edit mode and the same button was clicked - go back to list
|
setIsInUpdate(true);
|
||||||
if (isInEdit && contentType === tableContentType) {
|
|
||||||
setIsInEdit(false);
|
|
||||||
} else {
|
|
||||||
setIsInEdit(true);
|
|
||||||
setTableContentType(contentType);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const instanceOfCategory = (object: any): object is Category => {
|
const instanceOfCategory = (object: any): object is Category => {
|
||||||
return 'bookmarks' in object;
|
return 'bookmarks' in object;
|
||||||
};
|
};
|
||||||
|
|
||||||
const goToUpdateMode = (data: Category | Bookmark): void => {
|
|
||||||
setIsInUpdate(true);
|
|
||||||
if (instanceOfCategory(data)) {
|
if (instanceOfCategory(data)) {
|
||||||
setFormContentType(ContentType.category);
|
setFormContentType(ContentType.category);
|
||||||
setCategoryInUpdate(data);
|
setEditCategory(data);
|
||||||
} else {
|
} else {
|
||||||
setFormContentType(ContentType.bookmark);
|
setFormContentType(ContentType.bookmark);
|
||||||
setBookmarkInUpdate(data);
|
setEditBookmark(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleModal();
|
toggleModal();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Table actions
|
||||||
|
const showTableForEditing = (contentType: ContentType) => {
|
||||||
|
// We're in the edit mode and the same button was clicked - go back to list
|
||||||
|
if (showTable && contentType === tableContentType) {
|
||||||
|
setEditCategory(null);
|
||||||
|
setShowTable(false);
|
||||||
|
} else {
|
||||||
|
setShowTable(true);
|
||||||
|
setTableContentType(contentType);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const finishEditing = () => {
|
||||||
|
setShowTable(false);
|
||||||
|
setEditCategory(null);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
<Modal isOpen={modalIsOpen} setIsOpen={toggleModal}>
|
<Modal isOpen={modalIsOpen} setIsOpen={toggleModal}>
|
||||||
@ -111,8 +140,6 @@ export const Bookmarks = (props: Props): JSX.Element => {
|
|||||||
modalHandler={toggleModal}
|
modalHandler={toggleModal}
|
||||||
contentType={formContentType}
|
contentType={formContentType}
|
||||||
inUpdate={isInUpdate}
|
inUpdate={isInUpdate}
|
||||||
category={categoryInUpdate}
|
|
||||||
bookmark={bookmarkInUpdate}
|
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
@ -123,35 +150,44 @@ export const Bookmarks = (props: Props): JSX.Element => {
|
|||||||
<ActionButton
|
<ActionButton
|
||||||
name="Add Category"
|
name="Add Category"
|
||||||
icon="mdiPlusBox"
|
icon="mdiPlusBox"
|
||||||
handler={() => addActionHandler(ContentType.category)}
|
handler={() => openFormForAdding(ContentType.category)}
|
||||||
/>
|
/>
|
||||||
<ActionButton
|
<ActionButton
|
||||||
name="Add Bookmark"
|
name="Add Bookmark"
|
||||||
icon="mdiPlusBox"
|
icon="mdiPlusBox"
|
||||||
handler={() => addActionHandler(ContentType.bookmark)}
|
handler={() => openFormForAdding(ContentType.bookmark)}
|
||||||
/>
|
/>
|
||||||
<ActionButton
|
<ActionButton
|
||||||
name="Edit Categories"
|
name="Edit Categories"
|
||||||
icon="mdiPencil"
|
icon="mdiPencil"
|
||||||
handler={() => editActionHandler(ContentType.category)}
|
handler={() => showTableForEditing(ContentType.category)}
|
||||||
/>
|
/>
|
||||||
|
{showTable && tableContentType === ContentType.bookmark && (
|
||||||
<ActionButton
|
<ActionButton
|
||||||
name="Edit Bookmarks"
|
name="Finish Editing"
|
||||||
icon="mdiPencil"
|
icon="mdiPencil"
|
||||||
handler={() => editActionHandler(ContentType.bookmark)}
|
handler={finishEditing}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{categories.length && isAuthenticated && !showTable ? (
|
||||||
|
<Message isPrimary={false}>
|
||||||
|
Click on category name to edit its bookmarks
|
||||||
|
</Message>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
|
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<Spinner />
|
<Spinner />
|
||||||
) : !isInEdit ? (
|
) : !showTable ? (
|
||||||
<BookmarkGrid categories={categories} searching={props.searching} />
|
<BookmarkGrid categories={categories} searching={props.searching} />
|
||||||
) : (
|
) : (
|
||||||
<BookmarkTable
|
<Table
|
||||||
contentType={tableContentType}
|
contentType={tableContentType}
|
||||||
categories={categories}
|
openFormForUpdating={openFormForUpdating}
|
||||||
updateHandler={goToUpdateMode}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Container>
|
</Container>
|
||||||
|
@ -137,15 +137,15 @@ export const BookmarksForm = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
modalHandler();
|
modalHandler();
|
||||||
|
|
||||||
setFormData(newBookmarkTemplate);
|
|
||||||
|
|
||||||
setCustomIcon(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setFormData({ ...newBookmarkTemplate, categoryId: formData.categoryId });
|
||||||
|
setCustomIcon(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalForm modalHandler={modalHandler} formHandler={formSubmitHandler}>
|
<ModalForm modalHandler={modalHandler} formHandler={formSubmitHandler}>
|
||||||
|
{/* NAME */}
|
||||||
<InputGroup>
|
<InputGroup>
|
||||||
<label htmlFor="name">Bookmark Name</label>
|
<label htmlFor="name">Bookmark Name</label>
|
||||||
<input
|
<input
|
||||||
@ -159,6 +159,7 @@ export const BookmarksForm = ({
|
|||||||
/>
|
/>
|
||||||
</InputGroup>
|
</InputGroup>
|
||||||
|
|
||||||
|
{/* URL */}
|
||||||
<InputGroup>
|
<InputGroup>
|
||||||
<label htmlFor="url">Bookmark URL</label>
|
<label htmlFor="url">Bookmark URL</label>
|
||||||
<input
|
<input
|
||||||
@ -172,6 +173,7 @@ export const BookmarksForm = ({
|
|||||||
/>
|
/>
|
||||||
</InputGroup>
|
</InputGroup>
|
||||||
|
|
||||||
|
{/* CATEGORY */}
|
||||||
<InputGroup>
|
<InputGroup>
|
||||||
<label htmlFor="categoryId">Bookmark Category</label>
|
<label htmlFor="categoryId">Bookmark Category</label>
|
||||||
<select
|
<select
|
||||||
@ -192,6 +194,7 @@ export const BookmarksForm = ({
|
|||||||
</select>
|
</select>
|
||||||
</InputGroup>
|
</InputGroup>
|
||||||
|
|
||||||
|
{/* ICON */}
|
||||||
{!useCustomIcon ? (
|
{!useCustomIcon ? (
|
||||||
// mdi
|
// mdi
|
||||||
<InputGroup>
|
<InputGroup>
|
||||||
@ -227,7 +230,7 @@ export const BookmarksForm = ({
|
|||||||
name="icon"
|
name="icon"
|
||||||
id="icon"
|
id="icon"
|
||||||
onChange={(e) => fileChangeHandler(e)}
|
onChange={(e) => fileChangeHandler(e)}
|
||||||
accept=".jpg,.jpeg,.png,.svg"
|
accept=".jpg,.jpeg,.png,.svg,.ico"
|
||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@ -241,6 +244,7 @@ export const BookmarksForm = ({
|
|||||||
</InputGroup>
|
</InputGroup>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/* VISIBILTY */}
|
||||||
<InputGroup>
|
<InputGroup>
|
||||||
<label htmlFor="isPublic">Bookmark visibility</label>
|
<label htmlFor="isPublic">Bookmark visibility</label>
|
||||||
<select
|
<select
|
||||||
|
@ -60,10 +60,10 @@ export const CategoryForm = ({
|
|||||||
addCategory(formData);
|
addCategory(formData);
|
||||||
} else {
|
} else {
|
||||||
updateCategory(category.id, formData);
|
updateCategory(category.id, formData);
|
||||||
|
modalHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
setFormData(newCategoryTemplate);
|
setFormData(newCategoryTemplate);
|
||||||
modalHandler();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,22 +1,26 @@
|
|||||||
// Typescript
|
// Typescript
|
||||||
import { Bookmark, Category } from '../../../interfaces';
|
|
||||||
import { ContentType } from '../Bookmarks';
|
import { ContentType } from '../Bookmarks';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import { CategoryForm } from './CategoryForm';
|
import { CategoryForm } from './CategoryForm';
|
||||||
import { BookmarksForm } from './BookmarksForm';
|
import { BookmarksForm } from './BookmarksForm';
|
||||||
import { Fragment } from 'react';
|
import { Fragment } from 'react';
|
||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
import { State } from '../../../store/reducers';
|
||||||
|
import { bookmarkTemplate, categoryTemplate } from '../../../utility';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
modalHandler: () => void;
|
modalHandler: () => void;
|
||||||
contentType: ContentType;
|
contentType: ContentType;
|
||||||
inUpdate?: boolean;
|
inUpdate?: boolean;
|
||||||
category?: Category;
|
|
||||||
bookmark?: Bookmark;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Form = (props: Props): JSX.Element => {
|
export const Form = (props: Props): JSX.Element => {
|
||||||
const { modalHandler, contentType, inUpdate, category, bookmark } = props;
|
const { categoryInEdit, bookmarkInEdit } = useSelector(
|
||||||
|
(state: State) => state.bookmarks
|
||||||
|
);
|
||||||
|
|
||||||
|
const { modalHandler, contentType, inUpdate } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
@ -33,9 +37,15 @@ export const Form = (props: Props): JSX.Element => {
|
|||||||
// form: update
|
// form: update
|
||||||
<Fragment>
|
<Fragment>
|
||||||
{contentType === ContentType.category ? (
|
{contentType === ContentType.category ? (
|
||||||
<CategoryForm modalHandler={modalHandler} category={category} />
|
<CategoryForm
|
||||||
|
modalHandler={modalHandler}
|
||||||
|
category={categoryInEdit || categoryTemplate}
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
<BookmarksForm modalHandler={modalHandler} bookmark={bookmark} />
|
<BookmarksForm
|
||||||
|
modalHandler={modalHandler}
|
||||||
|
bookmark={bookmarkInEdit || bookmarkTemplate}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)}
|
)}
|
||||||
|
188
client/src/components/Bookmarks/Table/BookmarksTable.tsx
Normal file
188
client/src/components/Bookmarks/Table/BookmarksTable.tsx
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
import { useState, useEffect, Fragment } from 'react';
|
||||||
|
import {
|
||||||
|
DragDropContext,
|
||||||
|
Droppable,
|
||||||
|
Draggable,
|
||||||
|
DropResult,
|
||||||
|
} from 'react-beautiful-dnd';
|
||||||
|
|
||||||
|
// Redux
|
||||||
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
|
import { State } from '../../../store/reducers';
|
||||||
|
import { bindActionCreators } from 'redux';
|
||||||
|
import { actionCreators } from '../../../store';
|
||||||
|
|
||||||
|
// Typescript
|
||||||
|
import { Bookmark, Category } from '../../../interfaces';
|
||||||
|
|
||||||
|
// UI
|
||||||
|
import { Message, Table } from '../../UI';
|
||||||
|
import { TableActions } from '../../Actions/TableActions';
|
||||||
|
import { bookmarkTemplate } from '../../../utility';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
openFormForUpdating: (data: Category | Bookmark) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const BookmarksTable = ({ openFormForUpdating }: Props): JSX.Element => {
|
||||||
|
const {
|
||||||
|
bookmarks: { categoryInEdit },
|
||||||
|
config: { config },
|
||||||
|
} = useSelector((state: State) => state);
|
||||||
|
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const {
|
||||||
|
deleteBookmark,
|
||||||
|
updateBookmark,
|
||||||
|
createNotification,
|
||||||
|
reorderBookmarks,
|
||||||
|
} = bindActionCreators(actionCreators, dispatch);
|
||||||
|
|
||||||
|
const [localBookmarks, setLocalBookmarks] = useState<Bookmark[]>([]);
|
||||||
|
|
||||||
|
// Copy bookmarks array
|
||||||
|
useEffect(() => {
|
||||||
|
if (categoryInEdit) {
|
||||||
|
setLocalBookmarks([...categoryInEdit.bookmarks]);
|
||||||
|
}
|
||||||
|
}, [categoryInEdit]);
|
||||||
|
|
||||||
|
// Drag and drop handler
|
||||||
|
const dragEndHanlder = (result: DropResult): void => {
|
||||||
|
if (config.useOrdering !== 'orderId') {
|
||||||
|
createNotification({
|
||||||
|
title: 'Error',
|
||||||
|
message: 'Custom order is disabled',
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!result.destination) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const tmpBookmarks = [...localBookmarks];
|
||||||
|
const [movedBookmark] = tmpBookmarks.splice(result.source.index, 1);
|
||||||
|
tmpBookmarks.splice(result.destination.index, 0, movedBookmark);
|
||||||
|
|
||||||
|
setLocalBookmarks(tmpBookmarks);
|
||||||
|
|
||||||
|
const categoryId = categoryInEdit?.id || -1;
|
||||||
|
reorderBookmarks(tmpBookmarks, categoryId);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Action hanlders
|
||||||
|
const deleteBookmarkHandler = (id: number, name: string) => {
|
||||||
|
const categoryId = categoryInEdit?.id || -1;
|
||||||
|
|
||||||
|
const proceed = window.confirm(`Are you sure you want to delete ${name}?`);
|
||||||
|
if (proceed) {
|
||||||
|
deleteBookmark(id, categoryId);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateBookmarkHandler = (id: number) => {
|
||||||
|
const bookmark =
|
||||||
|
categoryInEdit?.bookmarks.find((b) => b.id === id) || bookmarkTemplate;
|
||||||
|
|
||||||
|
openFormForUpdating(bookmark);
|
||||||
|
};
|
||||||
|
|
||||||
|
const changeBookmarkVisibiltyHandler = (id: number) => {
|
||||||
|
const bookmark =
|
||||||
|
categoryInEdit?.bookmarks.find((b) => b.id === id) || bookmarkTemplate;
|
||||||
|
|
||||||
|
const categoryId = categoryInEdit?.id || -1;
|
||||||
|
const [prev, curr] = [categoryId, categoryId];
|
||||||
|
|
||||||
|
updateBookmark(
|
||||||
|
id,
|
||||||
|
{ ...bookmark, isPublic: !bookmark.isPublic },
|
||||||
|
{ prev, curr }
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Fragment>
|
||||||
|
{!categoryInEdit ? (
|
||||||
|
<Message isPrimary={false}>
|
||||||
|
Switch to grid view and click on the name of category you want to edit
|
||||||
|
</Message>
|
||||||
|
) : (
|
||||||
|
<Message isPrimary={false}>
|
||||||
|
Editing bookmarks from <span>{categoryInEdit.name}</span>
|
||||||
|
category
|
||||||
|
</Message>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{categoryInEdit && (
|
||||||
|
<DragDropContext onDragEnd={dragEndHanlder}>
|
||||||
|
<Droppable droppableId="bookmarks">
|
||||||
|
{(provided) => (
|
||||||
|
<Table
|
||||||
|
headers={[
|
||||||
|
'Name',
|
||||||
|
'URL',
|
||||||
|
'Icon',
|
||||||
|
'Visibility',
|
||||||
|
'Category',
|
||||||
|
'Actions',
|
||||||
|
]}
|
||||||
|
innerRef={provided.innerRef}
|
||||||
|
>
|
||||||
|
{localBookmarks.map((bookmark, index): JSX.Element => {
|
||||||
|
return (
|
||||||
|
<Draggable
|
||||||
|
key={bookmark.id}
|
||||||
|
draggableId={bookmark.id.toString()}
|
||||||
|
index={index}
|
||||||
|
>
|
||||||
|
{(provided, snapshot) => {
|
||||||
|
const style = {
|
||||||
|
border: snapshot.isDragging
|
||||||
|
? '1px solid var(--color-accent)'
|
||||||
|
: 'none',
|
||||||
|
borderRadius: '4px',
|
||||||
|
...provided.draggableProps.style,
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<tr
|
||||||
|
{...provided.draggableProps}
|
||||||
|
{...provided.dragHandleProps}
|
||||||
|
ref={provided.innerRef}
|
||||||
|
style={style}
|
||||||
|
>
|
||||||
|
<td style={{ width: '200px' }}>{bookmark.name}</td>
|
||||||
|
<td style={{ width: '200px' }}>{bookmark.url}</td>
|
||||||
|
<td style={{ width: '200px' }}>{bookmark.icon}</td>
|
||||||
|
<td style={{ width: '200px' }}>
|
||||||
|
{bookmark.isPublic ? 'Visible' : 'Hidden'}
|
||||||
|
</td>
|
||||||
|
<td style={{ width: '200px' }}>
|
||||||
|
{categoryInEdit.name}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
{!snapshot.isDragging && (
|
||||||
|
<TableActions
|
||||||
|
entity={bookmark}
|
||||||
|
deleteHandler={deleteBookmarkHandler}
|
||||||
|
updateHandler={updateBookmarkHandler}
|
||||||
|
changeVisibilty={changeBookmarkVisibiltyHandler}
|
||||||
|
showPin={false}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</tr>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Draggable>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Table>
|
||||||
|
)}
|
||||||
|
</Droppable>
|
||||||
|
</DragDropContext>
|
||||||
|
)}
|
||||||
|
</Fragment>
|
||||||
|
);
|
||||||
|
};
|
166
client/src/components/Bookmarks/Table/CategoryTable.tsx
Normal file
166
client/src/components/Bookmarks/Table/CategoryTable.tsx
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
import { useState, useEffect, Fragment } from 'react';
|
||||||
|
import {
|
||||||
|
DragDropContext,
|
||||||
|
Droppable,
|
||||||
|
Draggable,
|
||||||
|
DropResult,
|
||||||
|
} from 'react-beautiful-dnd';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
|
// Redux
|
||||||
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
|
import { State } from '../../../store/reducers';
|
||||||
|
import { bindActionCreators } from 'redux';
|
||||||
|
import { actionCreators } from '../../../store';
|
||||||
|
|
||||||
|
// Typescript
|
||||||
|
import { Bookmark, Category } from '../../../interfaces';
|
||||||
|
|
||||||
|
// UI
|
||||||
|
import { Message, Table } from '../../UI';
|
||||||
|
import { TableActions } from '../../Actions/TableActions';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
openFormForUpdating: (data: Category | Bookmark) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const CategoryTable = ({ openFormForUpdating }: Props): JSX.Element => {
|
||||||
|
const {
|
||||||
|
config: { config },
|
||||||
|
bookmarks: { categories },
|
||||||
|
} = useSelector((state: State) => state);
|
||||||
|
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const {
|
||||||
|
pinCategory,
|
||||||
|
deleteCategory,
|
||||||
|
createNotification,
|
||||||
|
reorderCategories,
|
||||||
|
updateCategory,
|
||||||
|
} = bindActionCreators(actionCreators, dispatch);
|
||||||
|
|
||||||
|
const [localCategories, setLocalCategories] = useState<Category[]>([]);
|
||||||
|
|
||||||
|
// Copy categories array
|
||||||
|
useEffect(() => {
|
||||||
|
setLocalCategories([...categories]);
|
||||||
|
}, [categories]);
|
||||||
|
|
||||||
|
// Drag and drop handler
|
||||||
|
const dragEndHanlder = (result: DropResult): void => {
|
||||||
|
if (config.useOrdering !== 'orderId') {
|
||||||
|
createNotification({
|
||||||
|
title: 'Error',
|
||||||
|
message: 'Custom order is disabled',
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!result.destination) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const tmpCategories = [...localCategories];
|
||||||
|
const [movedCategory] = tmpCategories.splice(result.source.index, 1);
|
||||||
|
tmpCategories.splice(result.destination.index, 0, movedCategory);
|
||||||
|
|
||||||
|
setLocalCategories(tmpCategories);
|
||||||
|
reorderCategories(tmpCategories);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Action handlers
|
||||||
|
const deleteCategoryHandler = (id: number, name: string) => {
|
||||||
|
const proceed = window.confirm(
|
||||||
|
`Are you sure you want to delete ${name}? It will delete ALL assigned bookmarks`
|
||||||
|
);
|
||||||
|
|
||||||
|
if (proceed) {
|
||||||
|
deleteCategory(id);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateCategoryHandler = (id: number) => {
|
||||||
|
const category = categories.find((c) => c.id === id) as Category;
|
||||||
|
openFormForUpdating(category);
|
||||||
|
};
|
||||||
|
|
||||||
|
const pinCategoryHandler = (id: number) => {
|
||||||
|
const category = categories.find((c) => c.id === id) as Category;
|
||||||
|
pinCategory(category);
|
||||||
|
};
|
||||||
|
|
||||||
|
const changeCategoryVisibiltyHandler = (id: number) => {
|
||||||
|
const category = categories.find((c) => c.id === id) as Category;
|
||||||
|
updateCategory(id, { ...category, isPublic: !category.isPublic });
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Fragment>
|
||||||
|
<Message isPrimary={false}>
|
||||||
|
{config.useOrdering === 'orderId' ? (
|
||||||
|
<p>You can drag and drop single rows to reorder categories</p>
|
||||||
|
) : (
|
||||||
|
<p>
|
||||||
|
Custom order is disabled. You can change it in the{' '}
|
||||||
|
<Link to="/settings/interface">settings</Link>
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</Message>
|
||||||
|
|
||||||
|
<DragDropContext onDragEnd={dragEndHanlder}>
|
||||||
|
<Droppable droppableId="categories">
|
||||||
|
{(provided) => (
|
||||||
|
<Table
|
||||||
|
headers={['Name', 'Visibility', 'Actions']}
|
||||||
|
innerRef={provided.innerRef}
|
||||||
|
>
|
||||||
|
{localCategories.map((category, index): JSX.Element => {
|
||||||
|
return (
|
||||||
|
<Draggable
|
||||||
|
key={category.id}
|
||||||
|
draggableId={category.id.toString()}
|
||||||
|
index={index}
|
||||||
|
>
|
||||||
|
{(provided, snapshot) => {
|
||||||
|
const style = {
|
||||||
|
border: snapshot.isDragging
|
||||||
|
? '1px solid var(--color-accent)'
|
||||||
|
: 'none',
|
||||||
|
borderRadius: '4px',
|
||||||
|
...provided.draggableProps.style,
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<tr
|
||||||
|
{...provided.draggableProps}
|
||||||
|
{...provided.dragHandleProps}
|
||||||
|
ref={provided.innerRef}
|
||||||
|
style={style}
|
||||||
|
>
|
||||||
|
<td style={{ width: '300px' }}>{category.name}</td>
|
||||||
|
<td style={{ width: '300px' }}>
|
||||||
|
{category.isPublic ? 'Visible' : 'Hidden'}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
{!snapshot.isDragging && (
|
||||||
|
<TableActions
|
||||||
|
entity={category}
|
||||||
|
deleteHandler={deleteCategoryHandler}
|
||||||
|
updateHandler={updateCategoryHandler}
|
||||||
|
pinHanlder={pinCategoryHandler}
|
||||||
|
changeVisibilty={changeCategoryVisibiltyHandler}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</tr>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Draggable>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Table>
|
||||||
|
)}
|
||||||
|
</Droppable>
|
||||||
|
</DragDropContext>
|
||||||
|
</Fragment>
|
||||||
|
);
|
||||||
|
};
|
20
client/src/components/Bookmarks/Table/Table.tsx
Normal file
20
client/src/components/Bookmarks/Table/Table.tsx
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { Category, Bookmark } from '../../../interfaces';
|
||||||
|
import { ContentType } from '../Bookmarks';
|
||||||
|
import { BookmarksTable } from './BookmarksTable';
|
||||||
|
import { CategoryTable } from './CategoryTable';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
contentType: ContentType;
|
||||||
|
openFormForUpdating: (data: Category | Bookmark) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Table = (props: Props): JSX.Element => {
|
||||||
|
const tableEl =
|
||||||
|
props.contentType === ContentType.category ? (
|
||||||
|
<CategoryTable openFormForUpdating={props.openFormForUpdating} />
|
||||||
|
) : (
|
||||||
|
<BookmarksTable openFormForUpdating={props.openFormForUpdating} />
|
||||||
|
);
|
||||||
|
|
||||||
|
return tableEl;
|
||||||
|
};
|
@ -11,7 +11,7 @@ import { actionCreators } from '../../store';
|
|||||||
import { App, Category } from '../../interfaces';
|
import { App, Category } from '../../interfaces';
|
||||||
|
|
||||||
// UI
|
// UI
|
||||||
import { Icon, Container, SectionHeadline, Spinner } from '../UI';
|
import { Icon, Container, SectionHeadline, Spinner, Message } from '../UI';
|
||||||
|
|
||||||
// CSS
|
// CSS
|
||||||
import classes from './Home.module.css';
|
import classes from './Home.module.css';
|
||||||
@ -30,6 +30,7 @@ export const Home = (): JSX.Element => {
|
|||||||
apps: { apps, loading: appsLoading },
|
apps: { apps, loading: appsLoading },
|
||||||
bookmarks: { categories, loading: bookmarksLoading },
|
bookmarks: { categories, loading: bookmarksLoading },
|
||||||
config: { config },
|
config: { config },
|
||||||
|
auth: { isAuthenticated },
|
||||||
} = useSelector((state: State) => state);
|
} = useSelector((state: State) => state);
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@ -100,7 +101,18 @@ export const Home = (): JSX.Element => {
|
|||||||
|
|
||||||
<Header />
|
<Header />
|
||||||
|
|
||||||
{!config.hideApps ? (
|
{!isAuthenticated &&
|
||||||
|
!apps.some((a) => a.isPinned) &&
|
||||||
|
!categories.some((c) => c.isPinned) ? (
|
||||||
|
<Message>
|
||||||
|
Welcome to Flame! Go to <Link to="/settings/app">/settings</Link>,
|
||||||
|
login and start customizing your new homepage
|
||||||
|
</Message>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{!config.hideApps && (isAuthenticated || apps.some((a) => a.isPinned)) ? (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<SectionHeadline title="Applications" link="/applications" />
|
<SectionHeadline title="Applications" link="/applications" />
|
||||||
{appsLoading ? (
|
{appsLoading ? (
|
||||||
@ -119,10 +131,11 @@ export const Home = (): JSX.Element => {
|
|||||||
<div className={classes.HomeSpace}></div>
|
<div className={classes.HomeSpace}></div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
) : (
|
) : (
|
||||||
<div></div>
|
<></>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!config.hideCategories ? (
|
{!config.hideCategories &&
|
||||||
|
(isAuthenticated || categories.some((c) => c.isPinned)) ? (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<SectionHeadline title="Bookmarks" link="/bookmarks" />
|
<SectionHeadline title="Bookmarks" link="/bookmarks" />
|
||||||
{bookmarksLoading ? (
|
{bookmarksLoading ? (
|
||||||
@ -138,11 +151,12 @@ export const Home = (): JSX.Element => {
|
|||||||
}
|
}
|
||||||
totalCategories={categories.length}
|
totalCategories={categories.length}
|
||||||
searching={!!localSearch}
|
searching={!!localSearch}
|
||||||
|
fromHomepage={true}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
) : (
|
) : (
|
||||||
<div></div>
|
<></>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Link to="/settings" className={classes.SettingsButton}>
|
<Link to="/settings" className={classes.SettingsButton}>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { FormEvent, Fragment, useEffect, useState } from 'react';
|
import { FormEvent, Fragment, useEffect, useState, useRef } from 'react';
|
||||||
|
|
||||||
// Redux
|
// Redux
|
||||||
import { useSelector, useDispatch } from 'react-redux';
|
import { useSelector, useDispatch } from 'react-redux';
|
||||||
@ -23,6 +23,12 @@ export const AuthForm = (): JSX.Element => {
|
|||||||
duration: '14d',
|
duration: '14d',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const passwordInputRef = useRef<HTMLInputElement>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
passwordInputRef.current?.focus();
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (token) {
|
if (token) {
|
||||||
const decoded = decodeToken(token);
|
const decoded = decodeToken(token);
|
||||||
@ -52,6 +58,7 @@ export const AuthForm = (): JSX.Element => {
|
|||||||
name="password"
|
name="password"
|
||||||
placeholder="••••••"
|
placeholder="••••••"
|
||||||
autoComplete="current-password"
|
autoComplete="current-password"
|
||||||
|
ref={passwordInputRef}
|
||||||
value={formData.password}
|
value={formData.password}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
setFormData({ ...formData, password: e.target.value })
|
setFormData({ ...formData, password: e.target.value })
|
||||||
|
@ -16,13 +16,14 @@ import { InputGroup, Button, SettingsHeadline } from '../../UI';
|
|||||||
import { otherSettingsTemplate, inputHandler } from '../../../utility';
|
import { otherSettingsTemplate, inputHandler } from '../../../utility';
|
||||||
|
|
||||||
export const UISettings = (): JSX.Element => {
|
export const UISettings = (): JSX.Element => {
|
||||||
const { loading, config } = useSelector((state: State) => state.config);
|
const {
|
||||||
|
config: { loading, config },
|
||||||
|
bookmarks: { categories },
|
||||||
|
} = useSelector((state: State) => state);
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { updateConfig, sortApps, sortCategories } = bindActionCreators(
|
const { updateConfig, sortApps, sortCategories, sortBookmarks } =
|
||||||
actionCreators,
|
bindActionCreators(actionCreators, dispatch);
|
||||||
dispatch
|
|
||||||
);
|
|
||||||
|
|
||||||
// Initial state
|
// Initial state
|
||||||
const [formData, setFormData] = useState<OtherSettingsForm>(
|
const [formData, setFormData] = useState<OtherSettingsForm>(
|
||||||
@ -46,9 +47,15 @@ export const UISettings = (): JSX.Element => {
|
|||||||
// Update local page title
|
// Update local page title
|
||||||
document.title = formData.customTitle;
|
document.title = formData.customTitle;
|
||||||
|
|
||||||
// Sort apps and categories with new settings
|
// Sort entities with new settings
|
||||||
|
if (formData.useOrdering !== config.useOrdering) {
|
||||||
sortApps();
|
sortApps();
|
||||||
sortCategories();
|
sortCategories();
|
||||||
|
|
||||||
|
for (let { id } of categories) {
|
||||||
|
sortBookmarks(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Input handler
|
// Input handler
|
||||||
@ -85,7 +92,9 @@ export const UISettings = (): JSX.Element => {
|
|||||||
<SettingsHeadline text="Header" />
|
<SettingsHeadline text="Header" />
|
||||||
{/* HIDE HEADER */}
|
{/* HIDE HEADER */}
|
||||||
<InputGroup>
|
<InputGroup>
|
||||||
<label htmlFor="hideHeader">Hide greetings</label>
|
<label htmlFor="hideHeader">
|
||||||
|
Hide headline (greetings and weather)
|
||||||
|
</label>
|
||||||
<select
|
<select
|
||||||
id="hideHeader"
|
id="hideHeader"
|
||||||
name="hideHeader"
|
name="hideHeader"
|
||||||
|
@ -1,17 +1,13 @@
|
|||||||
.TableActions {
|
.message {
|
||||||
display: flex;
|
color: var(--color-primary);
|
||||||
align-items: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.TableAction {
|
.message a {
|
||||||
width: 22px;
|
color: var(--color-accent);
|
||||||
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.TableAction:hover {
|
.messageCenter {
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.Message {
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -20,10 +16,11 @@
|
|||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Message a {
|
.messageCenter a,
|
||||||
|
.messageCenter span {
|
||||||
color: var(--color-accent);
|
color: var(--color-accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
.Message a:hover {
|
.messageCenter a:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
14
client/src/components/UI/Text/Message/Message.tsx
Normal file
14
client/src/components/UI/Text/Message/Message.tsx
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { ReactNode } from 'react';
|
||||||
|
|
||||||
|
import classes from './Message.module.css';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
children: ReactNode;
|
||||||
|
isPrimary?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Message = ({ children, isPrimary = true }: Props): JSX.Element => {
|
||||||
|
const style = isPrimary ? classes.message : classes.messageCenter;
|
||||||
|
|
||||||
|
return <p className={style}>{children}</p>;
|
||||||
|
};
|
@ -12,3 +12,4 @@ export * from './Forms/InputGroup/InputGroup';
|
|||||||
export * from './Forms/ModalForm/ModalForm';
|
export * from './Forms/ModalForm/ModalForm';
|
||||||
export * from './Buttons/ActionButton/ActionButton';
|
export * from './Buttons/ActionButton/ActionButton';
|
||||||
export * from './Buttons/Button/Button';
|
export * from './Buttons/Button/Button';
|
||||||
|
export * from './Text/Message/Message';
|
||||||
|
@ -71,7 +71,7 @@ export const WeatherWidget = (): JSX.Element => {
|
|||||||
{config.isCelsius ? (
|
{config.isCelsius ? (
|
||||||
<span>{weather.tempC}°C</span>
|
<span>{weather.tempC}°C</span>
|
||||||
) : (
|
) : (
|
||||||
<span>{weather.tempF}°F</span>
|
<span>{Math.round(weather.tempF)}°F</span>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* ADDITIONAL DATA */}
|
{/* ADDITIONAL DATA */}
|
||||||
|
@ -8,4 +8,6 @@ export interface NewBookmark {
|
|||||||
isPublic: boolean;
|
isPublic: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Bookmark extends Model, NewBookmark {}
|
export interface Bookmark extends Model, NewBookmark {
|
||||||
|
orderId: number;
|
||||||
|
}
|
||||||
|
@ -7,6 +7,7 @@ import {
|
|||||||
GetAppsAction,
|
GetAppsAction,
|
||||||
PinAppAction,
|
PinAppAction,
|
||||||
ReorderAppsAction,
|
ReorderAppsAction,
|
||||||
|
SetEditAppAction,
|
||||||
SortAppsAction,
|
SortAppsAction,
|
||||||
UpdateAppAction,
|
UpdateAppAction,
|
||||||
} from '../actions/app';
|
} from '../actions/app';
|
||||||
@ -196,3 +197,11 @@ export const sortApps = () => async (dispatch: Dispatch<SortAppsAction>) => {
|
|||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const setEditApp =
|
||||||
|
(app: App | null) => (dispatch: Dispatch<SetEditAppAction>) => {
|
||||||
|
dispatch({
|
||||||
|
type: ActionType.setEditApp,
|
||||||
|
payload: app,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { Dispatch } from 'redux';
|
import { Dispatch } from 'redux';
|
||||||
|
import { applyAuth } from '../../utility';
|
||||||
|
import { ActionType } from '../action-types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ApiResponse,
|
ApiResponse,
|
||||||
Bookmark,
|
Bookmark,
|
||||||
@ -8,8 +11,7 @@ import {
|
|||||||
NewBookmark,
|
NewBookmark,
|
||||||
NewCategory,
|
NewCategory,
|
||||||
} from '../../interfaces';
|
} from '../../interfaces';
|
||||||
import { applyAuth } from '../../utility';
|
|
||||||
import { ActionType } from '../action-types';
|
|
||||||
import {
|
import {
|
||||||
AddBookmarkAction,
|
AddBookmarkAction,
|
||||||
AddCategoryAction,
|
AddCategoryAction,
|
||||||
@ -17,7 +19,11 @@ import {
|
|||||||
DeleteCategoryAction,
|
DeleteCategoryAction,
|
||||||
GetCategoriesAction,
|
GetCategoriesAction,
|
||||||
PinCategoryAction,
|
PinCategoryAction,
|
||||||
|
ReorderBookmarksAction,
|
||||||
ReorderCategoriesAction,
|
ReorderCategoriesAction,
|
||||||
|
SetEditBookmarkAction,
|
||||||
|
SetEditCategoryAction,
|
||||||
|
SortBookmarksAction,
|
||||||
SortCategoriesAction,
|
SortCategoriesAction,
|
||||||
UpdateBookmarkAction,
|
UpdateBookmarkAction,
|
||||||
UpdateCategoryAction,
|
UpdateCategoryAction,
|
||||||
@ -95,6 +101,8 @@ export const addBookmark =
|
|||||||
type: ActionType.addBookmark,
|
type: ActionType.addBookmark,
|
||||||
payload: res.data.data,
|
payload: res.data.data,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
dispatch<any>(sortBookmarks(res.data.data.categoryId));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
@ -266,6 +274,8 @@ export const updateBookmark =
|
|||||||
payload: res.data.data,
|
payload: res.data.data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dispatch<any>(sortBookmarks(res.data.data.categoryId));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
@ -319,3 +329,73 @@ export const reorderCategories =
|
|||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const setEditCategory =
|
||||||
|
(category: Category | null) =>
|
||||||
|
(dispatch: Dispatch<SetEditCategoryAction>) => {
|
||||||
|
dispatch({
|
||||||
|
type: ActionType.setEditCategory,
|
||||||
|
payload: category,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const setEditBookmark =
|
||||||
|
(bookmark: Bookmark | null) =>
|
||||||
|
(dispatch: Dispatch<SetEditBookmarkAction>) => {
|
||||||
|
dispatch({
|
||||||
|
type: ActionType.setEditBookmark,
|
||||||
|
payload: bookmark,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const reorderBookmarks =
|
||||||
|
(bookmarks: Bookmark[], categoryId: number) =>
|
||||||
|
async (dispatch: Dispatch<ReorderBookmarksAction>) => {
|
||||||
|
interface ReorderQuery {
|
||||||
|
bookmarks: {
|
||||||
|
id: number;
|
||||||
|
orderId: number;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const updateQuery: ReorderQuery = { bookmarks: [] };
|
||||||
|
|
||||||
|
bookmarks.forEach((bookmark, index) =>
|
||||||
|
updateQuery.bookmarks.push({
|
||||||
|
id: bookmark.id,
|
||||||
|
orderId: index + 1,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
await axios.put<ApiResponse<{}>>(
|
||||||
|
'/api/bookmarks/0/reorder',
|
||||||
|
updateQuery,
|
||||||
|
{ headers: applyAuth() }
|
||||||
|
);
|
||||||
|
|
||||||
|
dispatch({
|
||||||
|
type: ActionType.reorderBookmarks,
|
||||||
|
payload: { bookmarks, categoryId },
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const sortBookmarks =
|
||||||
|
(categoryId: number) => async (dispatch: Dispatch<SortBookmarksAction>) => {
|
||||||
|
try {
|
||||||
|
const res = await axios.get<ApiResponse<Config>>('/api/config');
|
||||||
|
|
||||||
|
dispatch({
|
||||||
|
type: ActionType.sortBookmarks,
|
||||||
|
payload: {
|
||||||
|
orderType: res.data.data.useOrdering,
|
||||||
|
categoryId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@ -23,6 +23,7 @@ export enum ActionType {
|
|||||||
updateApp = 'UPDATE_APP',
|
updateApp = 'UPDATE_APP',
|
||||||
reorderApps = 'REORDER_APPS',
|
reorderApps = 'REORDER_APPS',
|
||||||
sortApps = 'SORT_APPS',
|
sortApps = 'SORT_APPS',
|
||||||
|
setEditApp = 'SET_EDIT_APP',
|
||||||
// CATEGORES
|
// CATEGORES
|
||||||
getCategories = 'GET_CATEGORIES',
|
getCategories = 'GET_CATEGORIES',
|
||||||
getCategoriesSuccess = 'GET_CATEGORIES_SUCCESS',
|
getCategoriesSuccess = 'GET_CATEGORIES_SUCCESS',
|
||||||
@ -33,10 +34,14 @@ export enum ActionType {
|
|||||||
updateCategory = 'UPDATE_CATEGORY',
|
updateCategory = 'UPDATE_CATEGORY',
|
||||||
sortCategories = 'SORT_CATEGORIES',
|
sortCategories = 'SORT_CATEGORIES',
|
||||||
reorderCategories = 'REORDER_CATEGORIES',
|
reorderCategories = 'REORDER_CATEGORIES',
|
||||||
|
setEditCategory = 'SET_EDIT_CATEGORY',
|
||||||
// BOOKMARKS
|
// BOOKMARKS
|
||||||
addBookmark = 'ADD_BOOKMARK',
|
addBookmark = 'ADD_BOOKMARK',
|
||||||
deleteBookmark = 'DELETE_BOOKMARK',
|
deleteBookmark = 'DELETE_BOOKMARK',
|
||||||
updateBookmark = 'UPDATE_BOOKMARK',
|
updateBookmark = 'UPDATE_BOOKMARK',
|
||||||
|
setEditBookmark = 'SET_EDIT_BOOKMARK',
|
||||||
|
reorderBookmarks = 'REORDER_BOOKMARKS',
|
||||||
|
sortBookmarks = 'SORT_BOOKMARKS',
|
||||||
// AUTH
|
// AUTH
|
||||||
login = 'LOGIN',
|
login = 'LOGIN',
|
||||||
logout = 'LOGOUT',
|
logout = 'LOGOUT',
|
||||||
|
@ -36,3 +36,8 @@ export interface SortAppsAction {
|
|||||||
type: ActionType.sortApps;
|
type: ActionType.sortApps;
|
||||||
payload: string;
|
payload: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface SetEditAppAction {
|
||||||
|
type: ActionType.setEditApp;
|
||||||
|
payload: App | null;
|
||||||
|
}
|
||||||
|
@ -56,3 +56,29 @@ export interface ReorderCategoriesAction {
|
|||||||
type: ActionType.reorderCategories;
|
type: ActionType.reorderCategories;
|
||||||
payload: Category[];
|
payload: Category[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface SetEditCategoryAction {
|
||||||
|
type: ActionType.setEditCategory;
|
||||||
|
payload: Category | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SetEditBookmarkAction {
|
||||||
|
type: ActionType.setEditBookmark;
|
||||||
|
payload: Bookmark | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ReorderBookmarksAction {
|
||||||
|
type: ActionType.reorderBookmarks;
|
||||||
|
payload: {
|
||||||
|
bookmarks: Bookmark[];
|
||||||
|
categoryId: number;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SortBookmarksAction {
|
||||||
|
type: ActionType.sortBookmarks;
|
||||||
|
payload: {
|
||||||
|
orderType: string;
|
||||||
|
categoryId: number;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
@ -24,6 +24,7 @@ import {
|
|||||||
UpdateAppAction,
|
UpdateAppAction,
|
||||||
ReorderAppsAction,
|
ReorderAppsAction,
|
||||||
SortAppsAction,
|
SortAppsAction,
|
||||||
|
SetEditAppAction,
|
||||||
} from './app';
|
} from './app';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -37,6 +38,10 @@ import {
|
|||||||
AddBookmarkAction,
|
AddBookmarkAction,
|
||||||
DeleteBookmarkAction,
|
DeleteBookmarkAction,
|
||||||
UpdateBookmarkAction,
|
UpdateBookmarkAction,
|
||||||
|
SetEditCategoryAction,
|
||||||
|
SetEditBookmarkAction,
|
||||||
|
ReorderBookmarksAction,
|
||||||
|
SortBookmarksAction,
|
||||||
} from './bookmark';
|
} from './bookmark';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -67,6 +72,7 @@ export type Action =
|
|||||||
| UpdateAppAction
|
| UpdateAppAction
|
||||||
| ReorderAppsAction
|
| ReorderAppsAction
|
||||||
| SortAppsAction
|
| SortAppsAction
|
||||||
|
| SetEditAppAction
|
||||||
// Categories
|
// Categories
|
||||||
| GetCategoriesAction<any>
|
| GetCategoriesAction<any>
|
||||||
| AddCategoryAction
|
| AddCategoryAction
|
||||||
@ -75,10 +81,14 @@ export type Action =
|
|||||||
| UpdateCategoryAction
|
| UpdateCategoryAction
|
||||||
| SortCategoriesAction
|
| SortCategoriesAction
|
||||||
| ReorderCategoriesAction
|
| ReorderCategoriesAction
|
||||||
|
| SetEditCategoryAction
|
||||||
// Bookmarks
|
// Bookmarks
|
||||||
| AddBookmarkAction
|
| AddBookmarkAction
|
||||||
| DeleteBookmarkAction
|
| DeleteBookmarkAction
|
||||||
| UpdateBookmarkAction
|
| UpdateBookmarkAction
|
||||||
|
| SetEditBookmarkAction
|
||||||
|
| ReorderBookmarksAction
|
||||||
|
| SortBookmarksAction
|
||||||
// Auth
|
// Auth
|
||||||
| LoginAction
|
| LoginAction
|
||||||
| LogoutAction
|
| LogoutAction
|
||||||
|
@ -7,12 +7,14 @@ interface AppsState {
|
|||||||
loading: boolean;
|
loading: boolean;
|
||||||
apps: App[];
|
apps: App[];
|
||||||
errors: string | undefined;
|
errors: string | undefined;
|
||||||
|
appInUpdate: App | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const initialState: AppsState = {
|
const initialState: AppsState = {
|
||||||
loading: true,
|
loading: true,
|
||||||
apps: [],
|
apps: [],
|
||||||
errors: undefined,
|
errors: undefined,
|
||||||
|
appInUpdate: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const appsReducer = (
|
export const appsReducer = (
|
||||||
@ -20,71 +22,86 @@ export const appsReducer = (
|
|||||||
action: Action
|
action: Action
|
||||||
): AppsState => {
|
): AppsState => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case ActionType.getApps:
|
case ActionType.getApps: {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
loading: true,
|
loading: true,
|
||||||
errors: undefined,
|
errors: undefined,
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case ActionType.getAppsSuccess:
|
case ActionType.getAppsSuccess: {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
loading: false,
|
loading: false,
|
||||||
apps: action.payload || [],
|
apps: action.payload || [],
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case ActionType.pinApp:
|
case ActionType.pinApp: {
|
||||||
const pinnedAppIdx = state.apps.findIndex(
|
const appIdx = state.apps.findIndex(
|
||||||
(app) => app.id === action.payload.id
|
(app) => app.id === action.payload.id
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
apps: [
|
apps: [
|
||||||
...state.apps.slice(0, pinnedAppIdx),
|
...state.apps.slice(0, appIdx),
|
||||||
action.payload,
|
action.payload,
|
||||||
...state.apps.slice(pinnedAppIdx + 1),
|
...state.apps.slice(appIdx + 1),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case ActionType.addAppSuccess:
|
case ActionType.addAppSuccess: {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
apps: [...state.apps, action.payload],
|
apps: [...state.apps, action.payload],
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case ActionType.deleteApp:
|
case ActionType.deleteApp: {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
apps: [...state.apps].filter((app) => app.id !== action.payload),
|
apps: [...state.apps].filter((app) => app.id !== action.payload),
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case ActionType.updateApp:
|
case ActionType.updateApp: {
|
||||||
const updatedAppIdx = state.apps.findIndex(
|
const appIdx = state.apps.findIndex(
|
||||||
(app) => app.id === action.payload.id
|
(app) => app.id === action.payload.id
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
apps: [
|
apps: [
|
||||||
...state.apps.slice(0, updatedAppIdx),
|
...state.apps.slice(0, appIdx),
|
||||||
action.payload,
|
action.payload,
|
||||||
...state.apps.slice(updatedAppIdx + 1),
|
...state.apps.slice(appIdx + 1),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case ActionType.reorderApps:
|
case ActionType.reorderApps: {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
apps: action.payload,
|
apps: action.payload,
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case ActionType.sortApps:
|
case ActionType.sortApps: {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
apps: sortData<App>(state.apps, action.payload),
|
apps: sortData<App>(state.apps, action.payload),
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
case ActionType.setEditApp: {
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
appInUpdate: action.payload,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
|
@ -22,24 +22,28 @@ export const authReducer = (
|
|||||||
token: action.payload,
|
token: action.payload,
|
||||||
isAuthenticated: true,
|
isAuthenticated: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
case ActionType.logout:
|
case ActionType.logout:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
token: null,
|
token: null,
|
||||||
isAuthenticated: false,
|
isAuthenticated: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
case ActionType.autoLogin:
|
case ActionType.autoLogin:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
token: action.payload,
|
token: action.payload,
|
||||||
isAuthenticated: true,
|
isAuthenticated: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
case ActionType.authError:
|
case ActionType.authError:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
token: null,
|
token: null,
|
||||||
isAuthenticated: false,
|
isAuthenticated: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Category } from '../../interfaces';
|
import { Bookmark, Category } from '../../interfaces';
|
||||||
import { sortData } from '../../utility';
|
import { sortData } from '../../utility';
|
||||||
import { ActionType } from '../action-types';
|
import { ActionType } from '../action-types';
|
||||||
import { Action } from '../actions';
|
import { Action } from '../actions';
|
||||||
@ -7,12 +7,16 @@ interface BookmarksState {
|
|||||||
loading: boolean;
|
loading: boolean;
|
||||||
errors: string | undefined;
|
errors: string | undefined;
|
||||||
categories: Category[];
|
categories: Category[];
|
||||||
|
categoryInEdit: Category | null;
|
||||||
|
bookmarkInEdit: Bookmark | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const initialState: BookmarksState = {
|
const initialState: BookmarksState = {
|
||||||
loading: true,
|
loading: true,
|
||||||
errors: undefined,
|
errors: undefined,
|
||||||
categories: [],
|
categories: [],
|
||||||
|
categoryInEdit: null,
|
||||||
|
bookmarkInEdit: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const bookmarksReducer = (
|
export const bookmarksReducer = (
|
||||||
@ -20,27 +24,181 @@ export const bookmarksReducer = (
|
|||||||
action: Action
|
action: Action
|
||||||
): BookmarksState => {
|
): BookmarksState => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case ActionType.getCategories:
|
case ActionType.getCategories: {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
loading: true,
|
loading: true,
|
||||||
errors: undefined,
|
errors: undefined,
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case ActionType.getCategoriesSuccess:
|
case ActionType.getCategoriesSuccess: {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
loading: false,
|
loading: false,
|
||||||
categories: action.payload,
|
categories: action.payload,
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case ActionType.addCategory:
|
case ActionType.addCategory: {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
categories: [...state.categories, { ...action.payload, bookmarks: [] }],
|
categories: [...state.categories, { ...action.payload, bookmarks: [] }],
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case ActionType.addBookmark:
|
case ActionType.addBookmark: {
|
||||||
|
const categoryIdx = state.categories.findIndex(
|
||||||
|
(category) => category.id === action.payload.categoryId
|
||||||
|
);
|
||||||
|
|
||||||
|
const targetCategory = {
|
||||||
|
...state.categories[categoryIdx],
|
||||||
|
bookmarks: [...state.categories[categoryIdx].bookmarks, action.payload],
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
categories: [
|
||||||
|
...state.categories.slice(0, categoryIdx),
|
||||||
|
targetCategory,
|
||||||
|
...state.categories.slice(categoryIdx + 1),
|
||||||
|
],
|
||||||
|
categoryInEdit: targetCategory,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
case ActionType.pinCategory: {
|
||||||
|
const categoryIdx = state.categories.findIndex(
|
||||||
|
(category) => category.id === action.payload.id
|
||||||
|
);
|
||||||
|
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
categories: [
|
||||||
|
...state.categories.slice(0, categoryIdx),
|
||||||
|
{
|
||||||
|
...action.payload,
|
||||||
|
bookmarks: [...state.categories[categoryIdx].bookmarks],
|
||||||
|
},
|
||||||
|
...state.categories.slice(categoryIdx + 1),
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
case ActionType.deleteCategory: {
|
||||||
|
const categoryIdx = state.categories.findIndex(
|
||||||
|
(category) => category.id === action.payload
|
||||||
|
);
|
||||||
|
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
categories: [
|
||||||
|
...state.categories.slice(0, categoryIdx),
|
||||||
|
...state.categories.slice(categoryIdx + 1),
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
case ActionType.updateCategory: {
|
||||||
|
const categoryIdx = state.categories.findIndex(
|
||||||
|
(category) => category.id === action.payload.id
|
||||||
|
);
|
||||||
|
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
categories: [
|
||||||
|
...state.categories.slice(0, categoryIdx),
|
||||||
|
{
|
||||||
|
...action.payload,
|
||||||
|
bookmarks: [...state.categories[categoryIdx].bookmarks],
|
||||||
|
},
|
||||||
|
...state.categories.slice(categoryIdx + 1),
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
case ActionType.deleteBookmark: {
|
||||||
|
const categoryIdx = state.categories.findIndex(
|
||||||
|
(category) => category.id === action.payload.categoryId
|
||||||
|
);
|
||||||
|
|
||||||
|
const targetCategory = {
|
||||||
|
...state.categories[categoryIdx],
|
||||||
|
bookmarks: state.categories[categoryIdx].bookmarks.filter(
|
||||||
|
(bookmark) => bookmark.id !== action.payload.bookmarkId
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
categories: [
|
||||||
|
...state.categories.slice(0, categoryIdx),
|
||||||
|
targetCategory,
|
||||||
|
...state.categories.slice(categoryIdx + 1),
|
||||||
|
],
|
||||||
|
categoryInEdit: targetCategory,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
case ActionType.updateBookmark: {
|
||||||
|
const categoryIdx = state.categories.findIndex(
|
||||||
|
(category) => category.id === action.payload.categoryId
|
||||||
|
);
|
||||||
|
|
||||||
|
const bookmarkIdx = state.categories[categoryIdx].bookmarks.findIndex(
|
||||||
|
(bookmark) => bookmark.id === action.payload.id
|
||||||
|
);
|
||||||
|
|
||||||
|
const targetCategory = {
|
||||||
|
...state.categories[categoryIdx],
|
||||||
|
bookmarks: [
|
||||||
|
...state.categories[categoryIdx].bookmarks.slice(0, bookmarkIdx),
|
||||||
|
action.payload,
|
||||||
|
...state.categories[categoryIdx].bookmarks.slice(bookmarkIdx + 1),
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
categories: [
|
||||||
|
...state.categories.slice(0, categoryIdx),
|
||||||
|
targetCategory,
|
||||||
|
...state.categories.slice(categoryIdx + 1),
|
||||||
|
],
|
||||||
|
categoryInEdit: targetCategory,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
case ActionType.sortCategories: {
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
categories: sortData<Category>(state.categories, action.payload),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
case ActionType.reorderCategories: {
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
categories: action.payload,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
case ActionType.setEditCategory: {
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
categoryInEdit: action.payload,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
case ActionType.setEditBookmark: {
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
bookmarkInEdit: action.payload,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
case ActionType.reorderBookmarks: {
|
||||||
const categoryIdx = state.categories.findIndex(
|
const categoryIdx = state.categories.findIndex(
|
||||||
(category) => category.id === action.payload.categoryId
|
(category) => category.id === action.payload.categoryId
|
||||||
);
|
);
|
||||||
@ -51,121 +209,36 @@ export const bookmarksReducer = (
|
|||||||
...state.categories.slice(0, categoryIdx),
|
...state.categories.slice(0, categoryIdx),
|
||||||
{
|
{
|
||||||
...state.categories[categoryIdx],
|
...state.categories[categoryIdx],
|
||||||
bookmarks: [
|
bookmarks: action.payload.bookmarks,
|
||||||
...state.categories[categoryIdx].bookmarks,
|
|
||||||
action.payload,
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
...state.categories.slice(categoryIdx + 1),
|
...state.categories.slice(categoryIdx + 1),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case ActionType.pinCategory:
|
case ActionType.sortBookmarks: {
|
||||||
const pinnedCategoryIdx = state.categories.findIndex(
|
const categoryIdx = state.categories.findIndex(
|
||||||
(category) => category.id === action.payload.id
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
categories: [
|
|
||||||
...state.categories.slice(0, pinnedCategoryIdx),
|
|
||||||
{
|
|
||||||
...action.payload,
|
|
||||||
bookmarks: [...state.categories[pinnedCategoryIdx].bookmarks],
|
|
||||||
},
|
|
||||||
...state.categories.slice(pinnedCategoryIdx + 1),
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
case ActionType.deleteCategory:
|
|
||||||
const deletedCategoryIdx = state.categories.findIndex(
|
|
||||||
(category) => category.id === action.payload
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
categories: [
|
|
||||||
...state.categories.slice(0, deletedCategoryIdx),
|
|
||||||
...state.categories.slice(deletedCategoryIdx + 1),
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
case ActionType.updateCategory:
|
|
||||||
const updatedCategoryIdx = state.categories.findIndex(
|
|
||||||
(category) => category.id === action.payload.id
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
categories: [
|
|
||||||
...state.categories.slice(0, updatedCategoryIdx),
|
|
||||||
{
|
|
||||||
...action.payload,
|
|
||||||
bookmarks: [...state.categories[updatedCategoryIdx].bookmarks],
|
|
||||||
},
|
|
||||||
...state.categories.slice(updatedCategoryIdx + 1),
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
case ActionType.deleteBookmark:
|
|
||||||
const categoryInUpdateIdx = state.categories.findIndex(
|
|
||||||
(category) => category.id === action.payload.categoryId
|
(category) => category.id === action.payload.categoryId
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
const sortedBookmarks = sortData<Bookmark>(
|
||||||
...state,
|
state.categories[categoryIdx].bookmarks,
|
||||||
categories: [
|
action.payload.orderType
|
||||||
...state.categories.slice(0, categoryInUpdateIdx),
|
|
||||||
{
|
|
||||||
...state.categories[categoryInUpdateIdx],
|
|
||||||
bookmarks: state.categories[categoryInUpdateIdx].bookmarks.filter(
|
|
||||||
(bookmark) => bookmark.id !== action.payload.bookmarkId
|
|
||||||
),
|
|
||||||
},
|
|
||||||
...state.categories.slice(categoryInUpdateIdx + 1),
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
case ActionType.updateBookmark:
|
|
||||||
const parentCategoryIdx = state.categories.findIndex(
|
|
||||||
(category) => category.id === action.payload.categoryId
|
|
||||||
);
|
);
|
||||||
const updatedBookmarkIdx = state.categories[
|
|
||||||
parentCategoryIdx
|
|
||||||
].bookmarks.findIndex((bookmark) => bookmark.id === action.payload.id);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
categories: [
|
categories: [
|
||||||
...state.categories.slice(0, parentCategoryIdx),
|
...state.categories.slice(0, categoryIdx),
|
||||||
{
|
{
|
||||||
...state.categories[parentCategoryIdx],
|
...state.categories[categoryIdx],
|
||||||
bookmarks: [
|
bookmarks: sortedBookmarks,
|
||||||
...state.categories[parentCategoryIdx].bookmarks.slice(
|
|
||||||
0,
|
|
||||||
updatedBookmarkIdx
|
|
||||||
),
|
|
||||||
action.payload,
|
|
||||||
...state.categories[parentCategoryIdx].bookmarks.slice(
|
|
||||||
updatedBookmarkIdx + 1
|
|
||||||
),
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
...state.categories.slice(parentCategoryIdx + 1),
|
...state.categories.slice(categoryIdx + 1),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case ActionType.sortCategories:
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
categories: sortData<Category>(state.categories, action.payload),
|
|
||||||
};
|
|
||||||
|
|
||||||
case ActionType.reorderCategories:
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
categories: action.payload,
|
|
||||||
};
|
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
@ -26,26 +26,31 @@ export const configReducer = (
|
|||||||
loading: false,
|
loading: false,
|
||||||
config: action.payload,
|
config: action.payload,
|
||||||
};
|
};
|
||||||
|
|
||||||
case ActionType.updateConfig:
|
case ActionType.updateConfig:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
config: action.payload,
|
config: action.payload,
|
||||||
};
|
};
|
||||||
|
|
||||||
case ActionType.fetchQueries:
|
case ActionType.fetchQueries:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
customQueries: action.payload,
|
customQueries: action.payload,
|
||||||
};
|
};
|
||||||
|
|
||||||
case ActionType.addQuery:
|
case ActionType.addQuery:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
customQueries: [...state.customQueries, action.payload],
|
customQueries: [...state.customQueries, action.payload],
|
||||||
};
|
};
|
||||||
|
|
||||||
case ActionType.deleteQuery:
|
case ActionType.deleteQuery:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
customQueries: action.payload,
|
customQueries: action.payload,
|
||||||
};
|
};
|
||||||
|
|
||||||
case ActionType.updateQuery:
|
case ActionType.updateQuery:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
|
@ -29,6 +29,7 @@ export const notificationReducer = (
|
|||||||
],
|
],
|
||||||
idCounter: state.idCounter + 1,
|
idCounter: state.idCounter + 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
case ActionType.clearNotification:
|
case ActionType.clearNotification:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
|
@ -24,6 +24,7 @@ export const themeReducer = (
|
|||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case ActionType.setTheme:
|
case ActionType.setTheme:
|
||||||
return { theme: action.payload };
|
return { theme: action.payload };
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
@ -13,4 +13,5 @@ export const bookmarkTemplate: Bookmark = {
|
|||||||
id: -1,
|
id: -1,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
updatedAt: new Date(),
|
updatedAt: new Date(),
|
||||||
|
orderId: 0,
|
||||||
};
|
};
|
||||||
|
@ -13,7 +13,7 @@ export const isUrl = (data: string): boolean => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const isImage = (data: string): boolean => {
|
export const isImage = (data: string): boolean => {
|
||||||
const regex = /.(jpeg|jpg|png)$/i;
|
const regex = /.(jpeg|jpg|png|ico)$/i;
|
||||||
|
|
||||||
return regex.test(data);
|
return regex.test(data);
|
||||||
};
|
};
|
||||||
|
@ -28,17 +28,15 @@ const getAllApps = asyncWrapper(async (req, res, next) => {
|
|||||||
// apps visibility
|
// apps visibility
|
||||||
const where = req.isAuthenticated ? {} : { isPublic: true };
|
const where = req.isAuthenticated ? {} : { isPublic: true };
|
||||||
|
|
||||||
if (orderType == 'name') {
|
const order =
|
||||||
|
orderType == 'name'
|
||||||
|
? [[Sequelize.fn('lower', Sequelize.col('name')), 'ASC']]
|
||||||
|
: [[orderType, 'ASC']];
|
||||||
|
|
||||||
apps = await App.findAll({
|
apps = await App.findAll({
|
||||||
order: [[Sequelize.fn('lower', Sequelize.col('name')), 'ASC']],
|
order,
|
||||||
where,
|
where,
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
apps = await App.findAll({
|
|
||||||
order: [[orderType, 'ASC']],
|
|
||||||
where,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
// Set header to fetch containers info every time
|
// Set header to fetch containers info every time
|
||||||
|
@ -1,16 +1,24 @@
|
|||||||
const asyncWrapper = require('../../middleware/asyncWrapper');
|
const asyncWrapper = require('../../middleware/asyncWrapper');
|
||||||
const Bookmark = require('../../models/Bookmark');
|
const Bookmark = require('../../models/Bookmark');
|
||||||
const { Sequelize } = require('sequelize');
|
const { Sequelize } = require('sequelize');
|
||||||
|
const loadConfig = require('../../utils/loadConfig');
|
||||||
|
|
||||||
// @desc Get all bookmarks
|
// @desc Get all bookmarks
|
||||||
// @route GET /api/bookmarks
|
// @route GET /api/bookmarks
|
||||||
// @access Public
|
// @access Public
|
||||||
const getAllBookmarks = asyncWrapper(async (req, res, next) => {
|
const getAllBookmarks = asyncWrapper(async (req, res, next) => {
|
||||||
|
const { useOrdering: orderType } = await loadConfig();
|
||||||
|
|
||||||
// bookmarks visibility
|
// bookmarks visibility
|
||||||
const where = req.isAuthenticated ? {} : { isPublic: true };
|
const where = req.isAuthenticated ? {} : { isPublic: true };
|
||||||
|
|
||||||
|
const order =
|
||||||
|
orderType == 'name'
|
||||||
|
? [[Sequelize.fn('lower', Sequelize.col('name')), 'ASC']]
|
||||||
|
: [[orderType, 'ASC']];
|
||||||
|
|
||||||
const bookmarks = await Bookmark.findAll({
|
const bookmarks = await Bookmark.findAll({
|
||||||
order: [[Sequelize.fn('lower', Sequelize.col('name')), 'ASC']],
|
order,
|
||||||
where,
|
where,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -4,4 +4,5 @@ module.exports = {
|
|||||||
getSingleBookmark: require('./getSingleBookmark'),
|
getSingleBookmark: require('./getSingleBookmark'),
|
||||||
updateBookmark: require('./updateBookmark'),
|
updateBookmark: require('./updateBookmark'),
|
||||||
deleteBookmark: require('./deleteBookmark'),
|
deleteBookmark: require('./deleteBookmark'),
|
||||||
|
reorderBookmarks: require('./reorderBookmarks'),
|
||||||
};
|
};
|
||||||
|
23
controllers/bookmarks/reorderBookmarks.js
Normal file
23
controllers/bookmarks/reorderBookmarks.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
const asyncWrapper = require('../../middleware/asyncWrapper');
|
||||||
|
const Bookmark = require('../../models/Bookmark');
|
||||||
|
|
||||||
|
// @desc Reorder bookmarks
|
||||||
|
// @route PUT /api/bookmarks/0/reorder
|
||||||
|
// @access Public
|
||||||
|
const reorderBookmarks = asyncWrapper(async (req, res, next) => {
|
||||||
|
req.body.bookmarks.forEach(async ({ id, orderId }) => {
|
||||||
|
await Bookmark.update(
|
||||||
|
{ orderId },
|
||||||
|
{
|
||||||
|
where: { id },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
res.status(200).json({
|
||||||
|
success: true,
|
||||||
|
data: {},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = reorderBookmarks;
|
@ -16,29 +16,27 @@ const getAllCategories = asyncWrapper(async (req, res, next) => {
|
|||||||
// categories visibility
|
// categories visibility
|
||||||
const where = req.isAuthenticated ? {} : { isPublic: true };
|
const where = req.isAuthenticated ? {} : { isPublic: true };
|
||||||
|
|
||||||
if (orderType == 'name') {
|
const order =
|
||||||
categories = await Category.findAll({
|
orderType == 'name'
|
||||||
|
? [
|
||||||
|
[Sequelize.fn('lower', Sequelize.col('Category.name')), 'ASC'],
|
||||||
|
[Sequelize.fn('lower', Sequelize.col('bookmarks.name')), 'ASC'],
|
||||||
|
]
|
||||||
|
: [
|
||||||
|
[orderType, 'ASC'],
|
||||||
|
[{ model: Bookmark, as: 'bookmarks' }, orderType, 'ASC'],
|
||||||
|
];
|
||||||
|
|
||||||
|
categories = categories = await Category.findAll({
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
model: Bookmark,
|
model: Bookmark,
|
||||||
as: 'bookmarks',
|
as: 'bookmarks',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
order: [[Sequelize.fn('lower', Sequelize.col('Category.name')), 'ASC']],
|
order,
|
||||||
where,
|
where,
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
categories = await Category.findAll({
|
|
||||||
include: [
|
|
||||||
{
|
|
||||||
model: Bookmark,
|
|
||||||
as: 'bookmarks',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
order: [[orderType, 'ASC']],
|
|
||||||
where,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (req.isAuthenticated) {
|
if (req.isAuthenticated) {
|
||||||
output = categories;
|
output = categories;
|
||||||
|
@ -2,13 +2,22 @@ const asyncWrapper = require('../../middleware/asyncWrapper');
|
|||||||
const ErrorResponse = require('../../utils/ErrorResponse');
|
const ErrorResponse = require('../../utils/ErrorResponse');
|
||||||
const Category = require('../../models/Category');
|
const Category = require('../../models/Category');
|
||||||
const Bookmark = require('../../models/Bookmark');
|
const Bookmark = require('../../models/Bookmark');
|
||||||
|
const { Sequelize } = require('sequelize');
|
||||||
|
const loadConfig = require('../../utils/loadConfig');
|
||||||
|
|
||||||
// @desc Get single category
|
// @desc Get single category
|
||||||
// @route GET /api/categories/:id
|
// @route GET /api/categories/:id
|
||||||
// @access Public
|
// @access Public
|
||||||
const getSingleCategory = asyncWrapper(async (req, res, next) => {
|
const getSingleCategory = asyncWrapper(async (req, res, next) => {
|
||||||
|
const { useOrdering: orderType } = await loadConfig();
|
||||||
|
|
||||||
const visibility = req.isAuthenticated ? {} : { isPublic: true };
|
const visibility = req.isAuthenticated ? {} : { isPublic: true };
|
||||||
|
|
||||||
|
const order =
|
||||||
|
orderType == 'name'
|
||||||
|
? [[Sequelize.fn('lower', Sequelize.col('bookmarks.name')), 'ASC']]
|
||||||
|
: [[{ model: Bookmark, as: 'bookmarks' }, orderType, 'ASC']];
|
||||||
|
|
||||||
const category = await Category.findOne({
|
const category = await Category.findOne({
|
||||||
where: { id: req.params.id, ...visibility },
|
where: { id: req.params.id, ...visibility },
|
||||||
include: [
|
include: [
|
||||||
@ -18,6 +27,7 @@ const getSingleCategory = asyncWrapper(async (req, res, next) => {
|
|||||||
where: visibility,
|
where: visibility,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
order,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!category) {
|
if (!category) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
const asyncWrapper = require('../../middleware/asyncWrapper');
|
const asyncWrapper = require('../../middleware/asyncWrapper');
|
||||||
const Category = require('../../models/Category');
|
const Category = require('../../models/Category');
|
||||||
|
|
||||||
// @desc Reorder categories
|
// @desc Reorder categories
|
||||||
// @route PUT /api/categories/0/reorder
|
// @route PUT /api/categories/0/reorder
|
||||||
// @access Public
|
// @access Public
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
const { DataTypes } = require('sequelize');
|
const { DataTypes } = require('sequelize');
|
||||||
const { INTEGER, FLOAT } = DataTypes;
|
const { INTEGER, FLOAT } = DataTypes;
|
||||||
const loadConfig = require('../../utils/loadConfig');
|
|
||||||
const getExternalWeather = require('../../utils/getExternalWeather');
|
|
||||||
|
|
||||||
const up = async (query) => {
|
const up = async (query) => {
|
||||||
await query.addColumn('weather', 'humidity', {
|
await query.addColumn('weather', 'humidity', {
|
||||||
@ -15,12 +13,6 @@ const up = async (query) => {
|
|||||||
await query.addColumn('weather', 'windM', {
|
await query.addColumn('weather', 'windM', {
|
||||||
type: FLOAT,
|
type: FLOAT,
|
||||||
});
|
});
|
||||||
|
|
||||||
const { WEATHER_API_KEY: secret } = await loadConfig();
|
|
||||||
|
|
||||||
if (secret) {
|
|
||||||
await getExternalWeather();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const down = async (query) => {
|
const down = async (query) => {
|
||||||
|
19
db/migrations/04_bookmarks-order.js
Normal file
19
db/migrations/04_bookmarks-order.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
const { DataTypes } = require('sequelize');
|
||||||
|
const { INTEGER } = DataTypes;
|
||||||
|
|
||||||
|
const up = async (query) => {
|
||||||
|
await query.addColumn('bookmarks', 'orderId', {
|
||||||
|
type: INTEGER,
|
||||||
|
allowNull: true,
|
||||||
|
defaultValue: null,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const down = async (query) => {
|
||||||
|
await query.removeColumn('bookmarks', 'orderId');
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
up,
|
||||||
|
down,
|
||||||
|
};
|
@ -14,7 +14,7 @@ const storage = multer.diskStorage({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const supportedTypes = ['jpg', 'jpeg', 'png', 'svg', 'svg+xml'];
|
const supportedTypes = ['jpg', 'jpeg', 'png', 'svg', 'svg+xml', 'x-icon'];
|
||||||
|
|
||||||
const fileFilter = (req, file, cb) => {
|
const fileFilter = (req, file, cb) => {
|
||||||
if (supportedTypes.includes(file.mimetype.split('/')[1])) {
|
if (supportedTypes.includes(file.mimetype.split('/')[1])) {
|
||||||
|
@ -25,6 +25,11 @@ const Bookmark = sequelize.define(
|
|||||||
allowNull: true,
|
allowNull: true,
|
||||||
defaultValue: 1,
|
defaultValue: 1,
|
||||||
},
|
},
|
||||||
|
orderId: {
|
||||||
|
type: DataTypes.INTEGER,
|
||||||
|
allowNull: true,
|
||||||
|
defaultValue: null,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tableName: 'bookmarks',
|
tableName: 'bookmarks',
|
||||||
|
443
package-lock.json
generated
443
package-lock.json
generated
@ -5,13 +5,13 @@
|
|||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
|
"name": "flame",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@kubernetes/client-node": "^0.15.1",
|
"@kubernetes/client-node": "^0.15.1",
|
||||||
"@types/express": "^4.17.13",
|
"@types/express": "^4.17.13",
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.24.0",
|
||||||
"colors": "^1.4.0",
|
|
||||||
"concurrently": "^6.3.0",
|
"concurrently": "^6.3.0",
|
||||||
"docker-secret": "^1.2.3",
|
"docker-secret": "^1.2.3",
|
||||||
"dotenv": "^10.0.0",
|
"dotenv": "^10.0.0",
|
||||||
@ -132,6 +132,18 @@
|
|||||||
"integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==",
|
"integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8.3.0"
|
"node": ">=8.3.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"bufferutil": "^4.0.1",
|
||||||
|
"utf-8-validate": "^5.0.2"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"bufferutil": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"utf-8-validate": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@panva/asn1.js": {
|
"node_modules/@panva/asn1.js": {
|
||||||
@ -377,6 +389,10 @@
|
|||||||
"fast-json-stable-stringify": "^2.0.0",
|
"fast-json-stable-stringify": "^2.0.0",
|
||||||
"json-schema-traverse": "^0.4.1",
|
"json-schema-traverse": "^0.4.1",
|
||||||
"uri-js": "^4.2.2"
|
"uri-js": "^4.2.2"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/epoberezkin"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ansi-align": {
|
"node_modules/ansi-align": {
|
||||||
@ -388,6 +404,14 @@
|
|||||||
"string-width": "^4.1.0"
|
"string-width": "^4.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/ansi-regex": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
|
||||||
|
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/ansi-styles": {
|
"node_modules/ansi-styles": {
|
||||||
"version": "4.3.0",
|
"version": "4.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||||
@ -397,6 +421,9 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/any-promise": {
|
"node_modules/any-promise": {
|
||||||
@ -564,6 +591,9 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/brace-expansion": {
|
"node_modules/brace-expansion": {
|
||||||
@ -682,6 +712,9 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/cacheable-request/node_modules/lowercase-keys": {
|
"node_modules/cacheable-request/node_modules/lowercase-keys": {
|
||||||
@ -700,6 +733,9 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"function-bind": "^1.1.1",
|
"function-bind": "^1.1.1",
|
||||||
"get-intrinsic": "^1.0.2"
|
"get-intrinsic": "^1.0.2"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/camelcase": {
|
"node_modules/camelcase": {
|
||||||
@ -709,6 +745,9 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/caseless": {
|
"node_modules/caseless": {
|
||||||
@ -720,20 +759,21 @@
|
|||||||
"version": "4.1.2",
|
"version": "4.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ansi-styles": "^4.1.0",
|
"ansi-styles": "^4.1.0",
|
||||||
"supports-color": "^7.1.0"
|
"supports-color": "^7.1.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/chalk/node_modules/supports-color": {
|
"node_modules/chalk/node_modules/supports-color": {
|
||||||
"version": "7.2.0",
|
"version": "7.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"has-flag": "^4.0.0"
|
"has-flag": "^4.0.0"
|
||||||
},
|
},
|
||||||
@ -788,6 +828,9 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/cliui": {
|
"node_modules/cliui": {
|
||||||
@ -851,14 +894,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
|
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
|
||||||
},
|
},
|
||||||
"node_modules/colors": {
|
|
||||||
"version": "1.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
|
|
||||||
"integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.1.90"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/combined-stream": {
|
"node_modules/combined-stream": {
|
||||||
"version": "1.0.8",
|
"version": "1.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
@ -910,29 +945,6 @@
|
|||||||
"node": ">=10.0.0"
|
"node": ">=10.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/concurrently/node_modules/chalk": {
|
|
||||||
"version": "4.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
|
||||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
|
||||||
"dependencies": {
|
|
||||||
"ansi-styles": "^4.1.0",
|
|
||||||
"supports-color": "^7.1.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/concurrently/node_modules/chalk/node_modules/supports-color": {
|
|
||||||
"version": "7.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
|
||||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
|
||||||
"dependencies": {
|
|
||||||
"has-flag": "^4.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/configstore": {
|
"node_modules/configstore": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz",
|
||||||
@ -1057,6 +1069,10 @@
|
|||||||
"integrity": "sha512-ovYRFnTrbGPD4nqaEqescPEv1mNwvt+UTqI3Ay9SzNtey9NZnYu6E2qCcBBgJ6/2VF1zGGygpyTDITqpQQ5e+w==",
|
"integrity": "sha512-ovYRFnTrbGPD4nqaEqescPEv1mNwvt+UTqI3Ay9SzNtey9NZnYu6E2qCcBBgJ6/2VF1zGGygpyTDITqpQQ5e+w==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.11"
|
"node": ">=0.11"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/date-fns"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/debug": {
|
"node_modules/debug": {
|
||||||
@ -1298,6 +1314,9 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sindresorhus/execa?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/execa/node_modules/get-stream": {
|
"node_modules/execa/node_modules/get-stream": {
|
||||||
@ -1306,6 +1325,9 @@
|
|||||||
"integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
|
"integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/express": {
|
"node_modules/express": {
|
||||||
@ -1404,8 +1426,19 @@
|
|||||||
"version": "1.14.5",
|
"version": "1.14.5",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz",
|
||||||
"integrity": "sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==",
|
"integrity": "sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "individual",
|
||||||
|
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||||
|
}
|
||||||
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=4.0"
|
"node": ">=4.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"debug": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/forever-agent": {
|
"node_modules/forever-agent": {
|
||||||
@ -1463,6 +1496,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||||
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"hasInstallScript": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
"darwin"
|
"darwin"
|
||||||
@ -1565,6 +1599,9 @@
|
|||||||
"function-bind": "^1.1.1",
|
"function-bind": "^1.1.1",
|
||||||
"has": "^1.0.3",
|
"has": "^1.0.3",
|
||||||
"has-symbols": "^1.0.1"
|
"has-symbols": "^1.0.1"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/get-stream": {
|
"node_modules/get-stream": {
|
||||||
@ -1601,6 +1638,9 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "*"
|
"node": "*"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/glob-parent": {
|
"node_modules/glob-parent": {
|
||||||
@ -1625,6 +1665,9 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/global-dirs/node_modules/ini": {
|
"node_modules/global-dirs/node_modules/ini": {
|
||||||
@ -1676,6 +1719,7 @@
|
|||||||
"version": "5.1.5",
|
"version": "5.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz",
|
||||||
"integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==",
|
"integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==",
|
||||||
|
"deprecated": "this library is no longer supported",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ajv": "^6.12.3",
|
"ajv": "^6.12.3",
|
||||||
"har-schema": "^2.0.0"
|
"har-schema": "^2.0.0"
|
||||||
@ -1709,6 +1753,9 @@
|
|||||||
"integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==",
|
"integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.4"
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/has-unicode": {
|
"node_modules/has-unicode": {
|
||||||
@ -1903,6 +1950,9 @@
|
|||||||
"integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==",
|
"integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"has": "^1.0.3"
|
"has": "^1.0.3"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/is-extglob": {
|
"node_modules/is-extglob": {
|
||||||
@ -1945,6 +1995,9 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/is-nan": {
|
"node_modules/is-nan": {
|
||||||
@ -1957,6 +2010,9 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.4"
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/is-npm": {
|
"node_modules/is-npm": {
|
||||||
@ -1966,6 +2022,9 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/is-number": {
|
"node_modules/is-number": {
|
||||||
@ -2001,6 +2060,9 @@
|
|||||||
"integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
|
"integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/is-typedarray": {
|
"node_modules/is-typedarray": {
|
||||||
@ -2027,7 +2089,10 @@
|
|||||||
"node_modules/isomorphic-ws": {
|
"node_modules/isomorphic-ws": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz",
|
||||||
"integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w=="
|
"integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==",
|
||||||
|
"peerDependencies": {
|
||||||
|
"ws": "*"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"node_modules/isstream": {
|
"node_modules/isstream": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.2",
|
||||||
@ -2043,6 +2108,9 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.13.0 < 13 || >=13.7.0"
|
"node": ">=10.13.0 < 13 || >=13.7.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/panva"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/js-yaml": {
|
"node_modules/js-yaml": {
|
||||||
@ -2068,9 +2136,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/json-schema": {
|
"node_modules/json-schema": {
|
||||||
"version": "0.2.3",
|
"version": "0.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",
|
||||||
"integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
|
"integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA=="
|
||||||
},
|
},
|
||||||
"node_modules/json-schema-traverse": {
|
"node_modules/json-schema-traverse": {
|
||||||
"version": "0.4.1",
|
"version": "0.4.1",
|
||||||
@ -2117,17 +2185,17 @@
|
|||||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
||||||
},
|
},
|
||||||
"node_modules/jsprim": {
|
"node_modules/jsprim": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz",
|
||||||
"integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
|
"integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==",
|
||||||
"engines": [
|
|
||||||
"node >=0.6.0"
|
|
||||||
],
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"assert-plus": "1.0.0",
|
"assert-plus": "1.0.0",
|
||||||
"extsprintf": "1.3.0",
|
"extsprintf": "1.3.0",
|
||||||
"json-schema": "0.2.3",
|
"json-schema": "0.4.0",
|
||||||
"verror": "1.10.0"
|
"verror": "1.10.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.6.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/jwa": {
|
"node_modules/jwa": {
|
||||||
@ -2253,6 +2321,9 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/make-dir/node_modules/semver": {
|
"node_modules/make-dir/node_modules/semver": {
|
||||||
@ -2525,6 +2596,7 @@
|
|||||||
"version": "0.11.0",
|
"version": "0.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.11.0.tgz",
|
"resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.11.0.tgz",
|
||||||
"integrity": "sha512-TwWAOZb0j7e9eGaf9esRx3ZcLaE5tQ2lvYy1pb5IAaG1a2e2Kv5Lms1Y4hpj+ciXJRofIxxlt5haeQ/2ANeE0Q==",
|
"integrity": "sha512-TwWAOZb0j7e9eGaf9esRx3ZcLaE5tQ2lvYy1pb5IAaG1a2e2Kv5Lms1Y4hpj+ciXJRofIxxlt5haeQ/2ANeE0Q==",
|
||||||
|
"deprecated": "Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"detect-libc": "^1.0.2",
|
"detect-libc": "^1.0.2",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
@ -2553,18 +2625,37 @@
|
|||||||
"nopt": "bin/nopt.js"
|
"nopt": "bin/nopt.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/node-pre-gyp/node_modules/safe-buffer": {
|
||||||
|
"version": "5.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||||
|
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/feross"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "patreon",
|
||||||
|
"url": "https://www.patreon.com/feross"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "consulting",
|
||||||
|
"url": "https://feross.org/support"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"node_modules/node-pre-gyp/node_modules/tar": {
|
"node_modules/node-pre-gyp/node_modules/tar": {
|
||||||
"version": "4.4.13",
|
"version": "4.4.19",
|
||||||
"resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz",
|
"resolved": "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz",
|
||||||
"integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==",
|
"integrity": "sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chownr": "^1.1.1",
|
"chownr": "^1.1.4",
|
||||||
"fs-minipass": "^1.2.5",
|
"fs-minipass": "^1.2.7",
|
||||||
"minipass": "^2.8.6",
|
"minipass": "^2.9.0",
|
||||||
"minizlib": "^1.2.1",
|
"minizlib": "^1.3.3",
|
||||||
"mkdirp": "^0.5.0",
|
"mkdirp": "^0.5.5",
|
||||||
"safe-buffer": "^5.1.2",
|
"safe-buffer": "^5.2.1",
|
||||||
"yallist": "^3.0.3"
|
"yallist": "^3.1.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=4.5"
|
"node": ">=4.5"
|
||||||
@ -2593,6 +2684,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.14.tgz",
|
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.14.tgz",
|
||||||
"integrity": "sha512-frcpDx+PviKEQRSYzwhckuO2zoHcBYLHI754RE9z5h1RGtrngerc04mLpQQCPWBkH/2ObrX7We9YiwVSYZpFJQ==",
|
"integrity": "sha512-frcpDx+PviKEQRSYzwhckuO2zoHcBYLHI754RE9z5h1RGtrngerc04mLpQQCPWBkH/2ObrX7We9YiwVSYZpFJQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chokidar": "^3.2.2",
|
"chokidar": "^3.2.2",
|
||||||
"debug": "^3.2.6",
|
"debug": "^3.2.6",
|
||||||
@ -2610,6 +2702,10 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8.10.0"
|
"node": ">=8.10.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/nodemon"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/nodemon/node_modules/debug": {
|
"node_modules/nodemon/node_modules/debug": {
|
||||||
@ -2658,6 +2754,9 @@
|
|||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"nopt": "bin/nopt.js"
|
"nopt": "bin/nopt.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/normalize-path": {
|
"node_modules/normalize-path": {
|
||||||
@ -2799,6 +2898,9 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/openid-client": {
|
"node_modules/openid-client": {
|
||||||
@ -2816,6 +2918,9 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^10.19.0 || >=12.0.0 < 13 || >=13.7.0 < 14 || >= 14.2.0"
|
"node": "^10.19.0 || >=12.0.0 < 13 || >=13.7.0 < 14 || >= 14.2.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/panva"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/openid-client/node_modules/@sindresorhus/is": {
|
"node_modules/openid-client/node_modules/@sindresorhus/is": {
|
||||||
@ -2824,6 +2929,9 @@
|
|||||||
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==",
|
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sindresorhus/is?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/openid-client/node_modules/@szmarczak/http-timer": {
|
"node_modules/openid-client/node_modules/@szmarczak/http-timer": {
|
||||||
@ -2863,6 +2971,9 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/openid-client/node_modules/defer-to-connect": {
|
"node_modules/openid-client/node_modules/defer-to-connect": {
|
||||||
@ -2882,6 +2993,9 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/openid-client/node_modules/got": {
|
"node_modules/openid-client/node_modules/got": {
|
||||||
@ -2903,6 +3017,9 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.19.0"
|
"node": ">=10.19.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sindresorhus/got?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/openid-client/node_modules/json-buffer": {
|
"node_modules/openid-client/node_modules/json-buffer": {
|
||||||
@ -2932,6 +3049,9 @@
|
|||||||
"integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==",
|
"integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/openid-client/node_modules/normalize-url": {
|
"node_modules/openid-client/node_modules/normalize-url": {
|
||||||
@ -2940,6 +3060,9 @@
|
|||||||
"integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==",
|
"integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/openid-client/node_modules/p-cancelable": {
|
"node_modules/openid-client/node_modules/p-cancelable": {
|
||||||
@ -3062,6 +3185,9 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8.6"
|
"node": ">=8.6"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/jonschlinkert"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/prepend-http": {
|
"node_modules/prepend-http": {
|
||||||
@ -3144,6 +3270,9 @@
|
|||||||
"integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==",
|
"integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/range-parser": {
|
"node_modules/range-parser": {
|
||||||
@ -3247,6 +3376,7 @@
|
|||||||
"version": "2.88.2",
|
"version": "2.88.2",
|
||||||
"resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
|
"resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
|
||||||
"integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==",
|
"integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==",
|
||||||
|
"deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"aws-sign2": "~0.7.0",
|
"aws-sign2": "~0.7.0",
|
||||||
"aws4": "^1.8.0",
|
"aws4": "^1.8.0",
|
||||||
@ -3285,6 +3415,7 @@
|
|||||||
"version": "3.4.0",
|
"version": "3.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
|
||||||
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
|
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
|
||||||
|
"deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.",
|
||||||
"bin": {
|
"bin": {
|
||||||
"uuid": "bin/uuid"
|
"uuid": "bin/uuid"
|
||||||
}
|
}
|
||||||
@ -3304,6 +3435,9 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"is-core-module": "^2.2.0",
|
"is-core-module": "^2.2.0",
|
||||||
"path-parse": "^1.0.6"
|
"path-parse": "^1.0.6"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/resolve-alpn": {
|
"node_modules/resolve-alpn": {
|
||||||
@ -3448,6 +3582,26 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.0.0"
|
"node": ">=10.0.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"mariadb": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"mysql2": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"pg": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"pg-hstore": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"sqlite3": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"tedious": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/sequelize-pool": {
|
"node_modules/sequelize-pool": {
|
||||||
@ -3467,6 +3621,11 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.0"
|
"node": ">=6.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"supports-color": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/sequelize/node_modules/ms": {
|
"node_modules/sequelize/node_modules/ms": {
|
||||||
@ -3566,12 +3725,21 @@
|
|||||||
"version": "5.0.2",
|
"version": "5.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.0.2.tgz",
|
||||||
"integrity": "sha512-1SdTNo+BVU211Xj1csWa8lV6KM0CtucDwRyA0VHl91wEH1Mgh7RxUpI4rVvG7OhHrzCSGaVyW5g8vKvlrk9DJA==",
|
"integrity": "sha512-1SdTNo+BVU211Xj1csWa8lV6KM0CtucDwRyA0VHl91wEH1Mgh7RxUpI4rVvG7OhHrzCSGaVyW5g8vKvlrk9DJA==",
|
||||||
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"node-addon-api": "^3.0.0",
|
"node-addon-api": "^3.0.0",
|
||||||
"node-pre-gyp": "^0.11.0"
|
"node-pre-gyp": "^0.11.0"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"node-gyp": "3.x"
|
"node-gyp": "3.x"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"node-gyp": "3.x"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"node-gyp": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/sshpk": {
|
"node_modules/sshpk": {
|
||||||
@ -3589,6 +3757,11 @@
|
|||||||
"safer-buffer": "^2.0.2",
|
"safer-buffer": "^2.0.2",
|
||||||
"tweetnacl": "~0.14.0"
|
"tweetnacl": "~0.14.0"
|
||||||
},
|
},
|
||||||
|
"bin": {
|
||||||
|
"sshpk-conv": "bin/sshpk-conv",
|
||||||
|
"sshpk-sign": "bin/sshpk-sign",
|
||||||
|
"sshpk-verify": "bin/sshpk-verify"
|
||||||
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
@ -3670,6 +3843,17 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/strip-ansi": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
|
||||||
|
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": "^3.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/strip-final-newline": {
|
"node_modules/strip-final-newline": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
|
||||||
@ -3695,12 +3879,16 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/supports-color?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/tar": {
|
"node_modules/tar": {
|
||||||
"version": "2.2.2",
|
"version": "2.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz",
|
||||||
"integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==",
|
"integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==",
|
||||||
|
"deprecated": "This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"block-stream": "*",
|
"block-stream": "*",
|
||||||
@ -3736,6 +3924,9 @@
|
|||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"rimraf": "bin.js"
|
"rimraf": "bin.js"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/to-readable-stream": {
|
"node_modules/to-readable-stream": {
|
||||||
@ -3832,6 +4023,9 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/type-is": {
|
"node_modules/type-is": {
|
||||||
@ -3925,6 +4119,9 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/yeoman/update-notifier?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/update-notifier/node_modules/semver": {
|
"node_modules/update-notifier/node_modules/semver": {
|
||||||
@ -4032,14 +4229,6 @@
|
|||||||
"string-width": "^1.0.2 || 2"
|
"string-width": "^1.0.2 || 2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/wide-align/node_modules/ansi-regex": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
|
|
||||||
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/wide-align/node_modules/string-width": {
|
"node_modules/wide-align/node_modules/string-width": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
|
||||||
@ -4052,17 +4241,6 @@
|
|||||||
"node": ">=4"
|
"node": ">=4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/wide-align/node_modules/strip-ansi": {
|
|
||||||
"version": "4.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
|
|
||||||
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
|
|
||||||
"dependencies": {
|
|
||||||
"ansi-regex": "^3.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/widest-line": {
|
"node_modules/widest-line": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz",
|
||||||
@ -4094,6 +4272,9 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/wrap-ansi/node_modules/ansi-regex": {
|
"node_modules/wrap-ansi/node_modules/ansi-regex": {
|
||||||
@ -4138,6 +4319,18 @@
|
|||||||
"integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==",
|
"integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.0.0"
|
"node": ">=10.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"bufferutil": "^4.0.1",
|
||||||
|
"utf-8-validate": "^5.0.2"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"bufferutil": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"utf-8-validate": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/xdg-basedir": {
|
"node_modules/xdg-basedir": {
|
||||||
@ -4277,7 +4470,8 @@
|
|||||||
"ws": {
|
"ws": {
|
||||||
"version": "7.5.5",
|
"version": "7.5.5",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz",
|
||||||
"integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w=="
|
"integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==",
|
||||||
|
"requires": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4519,6 +4713,11 @@
|
|||||||
"string-width": "^4.1.0"
|
"string-width": "^4.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ansi-regex": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
|
||||||
|
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg="
|
||||||
|
},
|
||||||
"ansi-styles": {
|
"ansi-styles": {
|
||||||
"version": "4.3.0",
|
"version": "4.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||||
@ -4804,7 +5003,6 @@
|
|||||||
"version": "4.1.2",
|
"version": "4.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"ansi-styles": "^4.1.0",
|
"ansi-styles": "^4.1.0",
|
||||||
"supports-color": "^7.1.0"
|
"supports-color": "^7.1.0"
|
||||||
@ -4814,7 +5012,6 @@
|
|||||||
"version": "7.2.0",
|
"version": "7.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"has-flag": "^4.0.0"
|
"has-flag": "^4.0.0"
|
||||||
}
|
}
|
||||||
@ -4910,11 +5107,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
|
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
|
||||||
},
|
},
|
||||||
"colors": {
|
|
||||||
"version": "1.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
|
|
||||||
"integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA=="
|
|
||||||
},
|
|
||||||
"combined-stream": {
|
"combined-stream": {
|
||||||
"version": "1.0.8",
|
"version": "1.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
@ -4952,27 +5144,6 @@
|
|||||||
"supports-color": "^8.1.0",
|
"supports-color": "^8.1.0",
|
||||||
"tree-kill": "^1.2.2",
|
"tree-kill": "^1.2.2",
|
||||||
"yargs": "^16.2.0"
|
"yargs": "^16.2.0"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"chalk": {
|
|
||||||
"version": "4.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
|
||||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
|
||||||
"requires": {
|
|
||||||
"ansi-styles": "^4.1.0",
|
|
||||||
"supports-color": "^7.1.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"supports-color": {
|
|
||||||
"version": "7.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
|
||||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
|
||||||
"requires": {
|
|
||||||
"has-flag": "^4.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"configstore": {
|
"configstore": {
|
||||||
@ -5838,7 +6009,8 @@
|
|||||||
"isomorphic-ws": {
|
"isomorphic-ws": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz",
|
||||||
"integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w=="
|
"integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==",
|
||||||
|
"requires": {}
|
||||||
},
|
},
|
||||||
"isstream": {
|
"isstream": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.2",
|
||||||
@ -5873,9 +6045,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"json-schema": {
|
"json-schema": {
|
||||||
"version": "0.2.3",
|
"version": "0.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",
|
||||||
"integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
|
"integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA=="
|
||||||
},
|
},
|
||||||
"json-schema-traverse": {
|
"json-schema-traverse": {
|
||||||
"version": "0.4.1",
|
"version": "0.4.1",
|
||||||
@ -5917,13 +6089,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"jsprim": {
|
"jsprim": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz",
|
||||||
"integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
|
"integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"assert-plus": "1.0.0",
|
"assert-plus": "1.0.0",
|
||||||
"extsprintf": "1.3.0",
|
"extsprintf": "1.3.0",
|
||||||
"json-schema": "0.2.3",
|
"json-schema": "0.4.0",
|
||||||
"verror": "1.10.0"
|
"verror": "1.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -6274,18 +6446,23 @@
|
|||||||
"osenv": "^0.1.4"
|
"osenv": "^0.1.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"safe-buffer": {
|
||||||
|
"version": "5.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||||
|
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
|
||||||
|
},
|
||||||
"tar": {
|
"tar": {
|
||||||
"version": "4.4.13",
|
"version": "4.4.19",
|
||||||
"resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz",
|
"resolved": "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz",
|
||||||
"integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==",
|
"integrity": "sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"chownr": "^1.1.1",
|
"chownr": "^1.1.4",
|
||||||
"fs-minipass": "^1.2.5",
|
"fs-minipass": "^1.2.7",
|
||||||
"minipass": "^2.8.6",
|
"minipass": "^2.9.0",
|
||||||
"minizlib": "^1.2.1",
|
"minizlib": "^1.3.3",
|
||||||
"mkdirp": "^0.5.0",
|
"mkdirp": "^0.5.5",
|
||||||
"safe-buffer": "^5.1.2",
|
"safe-buffer": "^5.2.1",
|
||||||
"yallist": "^3.0.3"
|
"yallist": "^3.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"yallist": {
|
"yallist": {
|
||||||
@ -7167,6 +7344,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"strip-ansi": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
|
||||||
|
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
|
||||||
|
"requires": {
|
||||||
|
"ansi-regex": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"strip-final-newline": {
|
"strip-final-newline": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
|
||||||
@ -7452,11 +7637,6 @@
|
|||||||
"string-width": "^1.0.2 || 2"
|
"string-width": "^1.0.2 || 2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ansi-regex": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
|
|
||||||
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg="
|
|
||||||
},
|
|
||||||
"string-width": {
|
"string-width": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
|
||||||
@ -7465,14 +7645,6 @@
|
|||||||
"is-fullwidth-code-point": "^2.0.0",
|
"is-fullwidth-code-point": "^2.0.0",
|
||||||
"strip-ansi": "^4.0.0"
|
"strip-ansi": "^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"strip-ansi": {
|
|
||||||
"version": "4.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
|
|
||||||
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
|
|
||||||
"requires": {
|
|
||||||
"ansi-regex": "^3.0.0"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -7538,7 +7710,8 @@
|
|||||||
"ws": {
|
"ws": {
|
||||||
"version": "8.2.3",
|
"version": "8.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz",
|
||||||
"integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA=="
|
"integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==",
|
||||||
|
"requires": {}
|
||||||
},
|
},
|
||||||
"xdg-basedir": {
|
"xdg-basedir": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
"@kubernetes/client-node": "^0.15.1",
|
"@kubernetes/client-node": "^0.15.1",
|
||||||
"@types/express": "^4.17.13",
|
"@types/express": "^4.17.13",
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.24.0",
|
||||||
"colors": "^1.4.0",
|
|
||||||
"concurrently": "^6.3.0",
|
"concurrently": "^6.3.0",
|
||||||
"docker-secret": "^1.2.3",
|
"docker-secret": "^1.2.3",
|
||||||
"dotenv": "^10.0.0",
|
"dotenv": "^10.0.0",
|
||||||
|
@ -10,6 +10,7 @@ const {
|
|||||||
getSingleBookmark,
|
getSingleBookmark,
|
||||||
updateBookmark,
|
updateBookmark,
|
||||||
deleteBookmark,
|
deleteBookmark,
|
||||||
|
reorderBookmarks,
|
||||||
} = require('../controllers/bookmarks');
|
} = require('../controllers/bookmarks');
|
||||||
|
|
||||||
router
|
router
|
||||||
@ -23,4 +24,6 @@ router
|
|||||||
.put(auth, requireAuth, upload, updateBookmark)
|
.put(auth, requireAuth, upload, updateBookmark)
|
||||||
.delete(auth, requireAuth, deleteBookmark);
|
.delete(auth, requireAuth, deleteBookmark);
|
||||||
|
|
||||||
|
router.route('/0/reorder').put(auth, requireAuth, reorderBookmarks);
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
|
Loading…
Reference in New Issue
Block a user