Filename,Content index.tsx,"/* eslint-disable react/jsx-filename-extension */ import React from 'react'; import { createRoot } from 'react-dom/client'; import navigationService from '@common/navigation/NavigationService'; import App from './App'; import('./store'); const container = document.getElementById('root'); const root = createRoot(container); root.render(); //@ts-ignore if (module?.hot) { //@ts-ignore module.hot.accept(function (err) { console.log('An error occurred while accepting new version: ', err); }); } window.onpopstate = () => { navigationService.goBack(); }; " App.tsx,"/* eslint-disable import/no-named-as-default */ /* eslint-disable no-useless-constructor */ /* eslint-disable import/no-named-as-default-member */ /* eslint-disable import/extensions */ import React from 'react'; import { Provider } from 'react-redux'; import BasePropTypes from '@common/models/BasePropTypes'; import { routeManager } from '@protolibrary/core'; import storeConfiguration from './store'; import './assets/css/tooltip.css'; import './assets/fonts/style.scss'; import './assets/colors/style.scss'; import './assets/css/main.scss'; import 'prototable/index.css'; import { ThemeApp } from './ThemeApp'; import { ErrorBoundary } from 'react-error-boundary'; import ErrorFallback from '@common/error/ErrorFallback'; import LocalStorage from '@common/storage/Storage'; class App extends React.Component { constructor(props: BasePropTypes) { super(props); } UNSAFE_componentWillMount(): void { routeManager.generateRoutes('', {}, {}, '', {}); LocalStorage.delete('x-app-version'); } render(): React.ReactNode { return ( // eslint-disable-next-line react/jsx-filename-extension { // Reset the state of your app so the error doesn't happen again }} onError={(error, componentStack) => { // Do something with the runtime error }} >
); } } export default App; " ThemeApp.tsx,"import ProtoContextProvider from '@common/hocs/ProtoContext'; import { ConnectedRouter } from '@protolibrary/core'; import React, { useEffect, useState } from 'react'; import AppMain from './AppMain'; import storeConfiguration from './store'; import { DARK_THEME, LIGHT_THEME } from './themes'; import { default as ProtoProvider } from '@protoweb/provider'; import { Route } from 'react-router-dom'; import { useStore } from '@core/states'; import Block from '@protoweb/block'; import NewVersionModal from '@common/modals/NewVersionModal'; import appState from '@core/states/AppState'; interface Props {} export const ThemeApp = (props: Props) => { const { theme, newVersion } = useStore('appState'); const [showModal, setShowModal] = useState(false); useEffect(() => { if (newVersion) { setShowModal(true); } }, [newVersion]); return ( { setShowModal(false); appState.update({ newVersion: false }); }} /> ); }; " store.tsx,"import { configure, addAjaxEnricher, routeReducer } from '@protolibrary/core'; import setupAxiosInterceptors from './core/configuration/axios'; import ajaxEnricher from './core/configuration/enricher'; setupAxiosInterceptors(); addAjaxEnricher(ajaxEnricher); const storeConfiguration = configure({ routing: routeReducer }, []); export default storeConfiguration; " UserCreateUpdate.tsx,"import InputLayout from '@common/components/input-layout'; import PageHeader from '@common/components/page-header'; import RemoteSelect from '@common/components/remote-select'; import navigationService from '@common/navigation/NavigationService'; import { NavigationOperationType } from '@common/navigation/NavigationTypes'; import toastManager from '@common/toast/ToastManager'; import { TextField, Form, Col, Container, Row, Button } from '@protolibrary/components'; import { email, required } from '@protoweb/utils'; import roleService from '@services/RoleService'; import userService, { User } from '@services/UserService'; import { useLocationParams } from '@utils/LocationUtils'; import React, { useEffect, useState } from 'react'; import PasswordInput from '@common/components/password-input'; const UserCreateUpdate = props => { const { operationType, id } = useLocationParams(props); const [data, setData] = useState(null); const refForm = React.useRef(null); const handleOnSubmit = () => { const values = refForm.current.getValues(); if (operationType === NavigationOperationType.CREATE) { const request: User = { userName: values.userName, firstName: values.firstName, lastName: values.lastName, roleIds: values.roleIds, email: values.email, }; userService.post(request, { password: values.password }).then(res => { toastManager.show('success', 'Kullanıcı basariyla olusturuldu'); navigationService.push('/system-management/user-management'); }); } else if (operationType === NavigationOperationType.UPDATE) { const request: User = { id: data?.id, userName: data?.userName, firstName: values.firstName, lastName: values.lastName, email: values.email, roleIds: values.roleIds, }; userService.put(request).then(res => { toastManager.show('success', 'Kullanıcı başarıyla guncellendi'); navigationService.push('/system-management/user-management'); }); } }; useEffect(() => { operationType === NavigationOperationType.UPDATE && userService.get(id).then(res => { setData(res); refForm.current.setValues(res); }); }, []); return (