Commit bf08a3d1 authored by Radek Ošlejšek's avatar Radek Ošlejšek
Browse files

Merge branch 'Webapp-refactoring' into 'master'

Webapp refactoring

See merge request grp-fidentis/analyst2!270
parents 1399fe7d 0ce75948
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -10,8 +10,7 @@ import { TaskContext } from '../../providers/TaskContextProvider';
import { ProjectsContext } from '../../providers/ProjectsContextProvider';
import ProjectTasks from '../project-view/ProjectTasks';
import TooltipIconButton from '../TooltipIconButton';

import TaskName from './TaskName';
import TaskName from '../task-view/TaskName';

const Header = () => {
	const { task } = useContext(TaskContext);
+7 −2
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ import {
	Select,
	SelectChangeEvent
} from '@mui/material';
import { ChangeEvent, useContext, useEffect } from 'react';
import { ChangeEvent, useContext, useEffect, useMemo } from 'react';
import { useNavigate } from 'react-router-dom';

import { ReactComponent as Silhouette } from '../../assets/images/silhouette.svg';
@@ -53,6 +53,11 @@ const BasicSelect = ({ tasks }: { tasks: Array<Task> }) => {
const PreviewPhoto = ({ fileData, id }: { fileData: string; id: number }) => {
	const { uploadSmallPreviewPhoto, fileSelection } = useContext(FilesContext);

	const canUploadPreviewPhoto = useMemo(
		() => fileSelection.length === 1 && fileSelection[0] === id,
		[fileSelection]
	);

	const handleFileUpload = (event: ChangeEvent<HTMLInputElement>) => {
		const formData = new FormData();
		const files = event.target.files;
@@ -72,7 +77,7 @@ const PreviewPhoto = ({ fileData, id }: { fileData: string; id: number }) => {
		);
	}

	return fileSelection.length === 1 ? (
	return canUploadPreviewPhoto ? (
		<IconButton component="label" sx={{ p: 0 }}>
			<input hidden accept="image/*" type="file" onChange={handleFileUpload} />
			<Silhouette />
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ const DeleteProjectsDialog: FC<DeleteProjectsDialogProps> = ({

	return (
		<Dialog open={open} maxWidth="md" fullWidth>
			<DialogTitle>Delete projects</DialogTitle>
			<DialogTitle>Delete project</DialogTitle>
			<DialogContent dividers>
				<Box component="div" sx={{ height: 600 }}>
					<DataGrid
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ const OpenProjectDialog: FC<OpenProjectDialogProps> = ({ open, onClose }) => {

	return (
		<Dialog open={open} maxWidth="md" fullWidth>
			<DialogTitle>Open projects</DialogTitle>
			<DialogTitle>Open project</DialogTitle>
			<DialogContent dividers>
				<Box component="div" sx={{ height: 600 }}>
					<DataGrid
Loading