Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unused code and restructure configuration #39

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
18 changes: 0 additions & 18 deletions client/.releaserc.js

This file was deleted.

5 changes: 0 additions & 5 deletions client/babel.config.json

This file was deleted.

2 changes: 1 addition & 1 deletion client/src/Annotation/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useEffect, useState } from "react"
import SetupPage from "../SetupPage";
import { useSettings } from "../SettingsProvider";
import {setIn} from "seamless-immutable"
import config from '../../config.js';
import config from '../config.js';

const extractRelevantProps = (region) => ({
cls: region.cls,
Expand Down
2 changes: 1 addition & 1 deletion client/src/ClassSelectionMenu/ClassSelectionMenu.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { render, fireEvent , screen} from '@testing-library/react';
import { render, fireEvent } from '@testing-library/react';
import '@testing-library/jest-dom';
import ClassSelectionMenu from './index';

Expand Down
1 change: 0 additions & 1 deletion client/src/ConfigurationTask/ConfigurationTask.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,5 @@ jest.mock('react-i18next', () => ({

// Simulate completing the form
fireEvent.click(screen.getByTestId('complete-button'));
// Add assertions to verify completion behavior based on YourComponent logic
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,5 @@ describe('ConfigureImageClassification', () => {

// Simulate completing the form
fireEvent.click(screen.getByTestId('complete-button'));
// Add assertions to verify completion behavior based on YourComponent logic
});
});
2 changes: 1 addition & 1 deletion client/src/FilesListMenu/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from "react"
import React, { useState } from "react"
import { styled } from "@mui/material/styles"
import { createTheme, ThemeProvider } from "@mui/material/styles"
import Box from "@mui/material/Box"
Expand Down
2 changes: 1 addition & 1 deletion client/src/ImageUpload/ImageUpload.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import axios from 'axios'
import ImageUpload from './index'
import { useSnackbar } from '../SnackbarContext'

jest.mock('../../config.js', () => ({
jest.mock('../config.js', () => ({
DEMO_SITE_URL: "https://annotate-docs.dwaste.live/",
VITE_SERVER_URL: "http://localhost:5000",
UPLOAD_LIMIT: 5,
Expand Down
2 changes: 1 addition & 1 deletion client/src/ImageUpload/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import DeleteIcon from '@mui/icons-material/Delete';
import axios from 'axios';
import { useSnackbar } from '../SnackbarContext';
import { useTranslation } from "react-i18next"
import config from '../../config.js';
import config from '../config.js';

const ImageUpload = ({ onImageUpload }) => {
const { t } = useTranslation();
Expand Down
4 changes: 2 additions & 2 deletions client/src/SetupPage/SetupPage.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { render, screen, fireEvent } from '@testing-library/react';
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom';
import { SetupPage } from './index';
import { useSettings } from '../SettingsProvider';
Expand All @@ -11,7 +11,7 @@ jest.mock('react-i18next', () => ({
}),
}));

jest.mock('../../config.js', () => ({
jest.mock('../config.js', () => ({
DEMO_SITE_URL: "https://annotate-docs.dwaste.live/",
VITE_SERVER_URL: "http://localhost:5000",
}));
Expand Down
2 changes: 1 addition & 1 deletion client/src/SetupPage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { useSettings } from "../SettingsProvider";
import { useTranslation } from "react-i18next"
import { Info } from '@mui/icons-material';
import NoteSection from "../NoteSection";
import config from '../../config.js'; //importing demo site config from client/config.js
import config from '../config.js';

const Container = styled("div")({
marginTop: "2rem",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion client/src/utils/get-data-from-server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from 'axios'
import config from '../../config.js'
import config from '../config.js'
export const getImages = () => {

const promise = axios.get(`${config.VITE_SERVER_URL}/imagesInfo`)
Expand Down
2 changes: 1 addition & 1 deletion client/src/utils/send-data-to-server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from 'axios'
import config from '../../config.js'
import config from '../config.js'

export const getImageData = (activeImage) => {
let imageData = {}
Expand Down
2 changes: 1 addition & 1 deletion client/src/workspace/DownloadButton/DownloadButton.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jest.mock('../../SnackbarContext/index.jsx', () => ({
}),
}));

jest.mock('../../../config.js', () => ({
jest.mock('../../config.js', () => ({
DEMO_SITE_URL: "https://annotate-docs.dwaste.live/",
VITE_SERVER_URL: "http://localhost:5000",
}));
Expand Down
2 changes: 1 addition & 1 deletion client/src/workspace/Header/Header.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { render, screen, fireEvent } from "@testing-library/react";
import Header from "./index";
import '@testing-library/jest-dom';

jest.mock('../../../config.js', () => ({
jest.mock('../../config.js', () => ({
DEMO_SITE_URL: "https://annotate-docs.dwaste.live/",
VITE_SERVER_URL: "http://localhost:5000",
}));
Expand Down
4 changes: 2 additions & 2 deletions client/src/workspace/Workspace/Workspace.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { render, screen, fireEvent } from '@testing-library/react'
import { render, screen } from '@testing-library/react'
import '@testing-library/jest-dom'
import Workplace from './index' // Replace with the actual file name
import { createTheme, ThemeProvider } from '@mui/material/styles'
Expand All @@ -11,7 +11,7 @@ jest.mock('react-use', () => ({
useMeasure: () => [jest.fn(), { height: 500 }],
}))

jest.mock('../../../config.js', () => ({
jest.mock('../../config.js', () => ({
DEMO_SITE_URL: "https://annotate-docs.dwaste.live/",
VITE_SERVER_URL: "http://localhost:5000",
}));
Expand Down
1 change: 0 additions & 1 deletion client/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { defineConfig } from 'vite'
import { resolve } from 'path'
import react from '@vitejs/plugin-react'
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import markdownRawPlugin from 'vite-raw-plugin';
Expand Down
8 changes: 0 additions & 8 deletions server/app.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
from crypt import methods
import dbm
from email import header
from urllib import response
from urllib.robotparser import RequestRate
from wsgiref import headers
from flask import Flask, jsonify, request, url_for,send_from_directory,send_file
from flask_cors import CORS, cross_origin
from db.db_handler import Module
import numpy as np
from io import BytesIO
import pandas as pd
import requests
Expand All @@ -16,7 +9,6 @@
import os
import traceback
import shutil
from dotenv import load_dotenv

app = Flask(__name__)
app.config.from_object("config")
Expand Down
Loading