#743 - Fix for storing yaml

This commit is contained in:
Elio Struyf
2024-01-26 16:42:57 +01:00
parent 7240747e86
commit 5f92ad33ff
9 changed files with 31 additions and 72 deletions
@@ -16,20 +16,17 @@ import { EmptyView } from './EmptyView';
import { Container } from './SortableContainer';
import { SortableItem } from './SortableItem';
import { ChevronRightIcon, CircleStackIcon } from '@heroicons/react/24/outline';
import { ToastContainer, toast, Slide } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import { DataType } from '../../../models/DataType';
import { TelemetryEvent } from '../../../constants';
import { NavigationItem } from '../Layout';
import useThemeColors from '../../hooks/useThemeColors';
import * as l10n from '@vscode/l10n';
import { LocalizationKey } from '../../../localization';
import { NavigationType } from '../../models';
export interface IDataViewProps { }
export const DataView: React.FunctionComponent<IDataViewProps> = (
props: React.PropsWithChildren<IDataViewProps>
_: React.PropsWithChildren<IDataViewProps>
) => {
const [selectedData, setSelectedData] = useState<DataFile | null>(null);
const [selectedIndex, setSelectedIndex] = useState<number | null>(null);
@@ -112,15 +109,7 @@ export const DataView: React.FunctionComponent<IDataViewProps> = (
entries: data
});
// Show toast message
toast.success('Updated your data entries', {
position: 'top-right',
autoClose: 2000,
hideProgressBar: true,
closeOnClick: true,
pauseOnHover: false,
transition: Slide
});
Messenger.send(DashboardMessage.showNotification, 'Updated your data entries');
},
[selectedData]
);
@@ -319,8 +308,6 @@ export const DataView: React.FunctionComponent<IDataViewProps> = (
isBacker={settings?.isBacker}
/>
<ToastContainer />
<img className='hidden' src="https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Ffrontmatter.codes%2Fmetrics%2Fdashboards&slug=DataView" alt="DataView metrics" />
</div >
);
@@ -1,7 +1,6 @@
import { PencilIcon, ChevronDownIcon, TrashIcon } from '@heroicons/react/24/outline';
import { PencilIcon, TrashIcon, ChevronUpDownIcon } from '@heroicons/react/24/outline';
import * as React from 'react';
import { SortableHandle, SortableElement } from 'react-sortable-hoc';
import useThemeColors from '../../hooks/useThemeColors';
import { LinkButton } from '../Common/LinkButton';
import { Alert } from '../Modals/Alert';
import * as l10n from '@vscode/l10n';
@@ -16,7 +15,7 @@ export interface ISortableItemProps {
onDeleteItem: (index: number) => void;
}
const DragHandle = SortableHandle(() => <ChevronDownIcon className={`w-6 h-6 cursor-move hover:text-[var(--frontmatter-link-hover)]`} />);
const DragHandle = SortableHandle(() => <ChevronUpDownIcon className={`w-6 h-6 mr-2 cursor-move hover:text-[var(--frontmatter-link-hover)]`} />);
export const SortableItem = SortableElement(
({
@@ -27,7 +26,6 @@ export const SortableItem = SortableElement(
onDeleteItem
}: ISortableItemProps) => {
const [showAlert, setShowAlert] = React.useState(false);
const { getColors } = useThemeColors();
const deleteItemConfirm = () => {
setShowAlert(true);
@@ -37,12 +35,8 @@ export const SortableItem = SortableElement(
<>
<li
data-test={`${selectedIndex}-${crntIndex}`}
className={`sortable_item py-2 px-2 w-full flex justify-between content-center cursor-pointer ${selectedIndex === crntIndex ? getColors(`bg-gray-300 dark:bg-vulcan-300`, `bg-[var(--frontmatter-list-selected-background)] text-[var(--frontmatter-list-selected-text)]`) : ``
} ${getColors(
'hover:bg-gray-200 dark:hover:bg-vulcan-400',
'hover:bg-[var(--frontmatter-list-hover-background)]'
)
}`}
className={`sortable_item py-2 px-2 w-full flex justify-between content-center cursor-pointer ${selectedIndex === crntIndex ? `bg-[var(--frontmatter-list-selected-background)] text-[var(--frontmatter-list-selected-text)]` : ``
} hover:bg-[var(--frontmatter-list-hover-background)]`}
>
<div
className="flex items-center w-full"