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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Filename,Content
|
2 |
+
index.tsx,"/* eslint-disable react/jsx-filename-extension */
|
3 |
+
import React from 'react';
|
4 |
+
import { createRoot } from 'react-dom/client';
|
5 |
+
import navigationService from '@common/navigation/NavigationService';
|
6 |
+
import App from './App';
|
7 |
+
import('./store');
|
8 |
+
|
9 |
+
const container = document.getElementById('root');
|
10 |
+
const root = createRoot(container);
|
11 |
+
root.render(<App />);
|
12 |
+
|
13 |
+
//@ts-ignore
|
14 |
+
if (module?.hot) {
|
15 |
+
//@ts-ignore
|
16 |
+
module.hot.accept(function (err) {
|
17 |
+
console.log('An error occurred while accepting new version: ', err);
|
18 |
+
});
|
19 |
+
}
|
20 |
+
|
21 |
+
window.onpopstate = () => {
|
22 |
+
navigationService.goBack();
|
23 |
+
};
|
24 |
+
"
|
25 |
+
App.tsx,"/* eslint-disable import/no-named-as-default */
|
26 |
+
/* eslint-disable no-useless-constructor */
|
27 |
+
/* eslint-disable import/no-named-as-default-member */
|
28 |
+
/* eslint-disable import/extensions */
|
29 |
+
import React from 'react';
|
30 |
+
import { Provider } from 'react-redux';
|
31 |
+
import BasePropTypes from '@common/models/BasePropTypes';
|
32 |
+
import { routeManager } from '@protolibrary/core';
|
33 |
+
import storeConfiguration from './store';
|
34 |
+
import './assets/css/tooltip.css';
|
35 |
+
import './assets/fonts/style.scss';
|
36 |
+
import './assets/colors/style.scss';
|
37 |
+
import './assets/css/main.scss';
|
38 |
+
import 'prototable/index.css';
|
39 |
+
|
40 |
+
import { ThemeApp } from './ThemeApp';
|
41 |
+
import { ErrorBoundary } from 'react-error-boundary';
|
42 |
+
import ErrorFallback from '@common/error/ErrorFallback';
|
43 |
+
import LocalStorage from '@common/storage/Storage';
|
44 |
+
|
45 |
+
class App extends React.Component<BasePropTypes, { theme: any }> {
|
46 |
+
constructor(props: BasePropTypes) {
|
47 |
+
super(props);
|
48 |
+
}
|
49 |
+
|
50 |
+
UNSAFE_componentWillMount(): void {
|
51 |
+
routeManager.generateRoutes('', {}, {}, '', {});
|
52 |
+
LocalStorage.delete('x-app-version');
|
53 |
+
}
|
54 |
+
|
55 |
+
render(): React.ReactNode {
|
56 |
+
return (
|
57 |
+
// eslint-disable-next-line react/jsx-filename-extension
|
58 |
+
|
59 |
+
<ErrorBoundary
|
60 |
+
FallbackComponent={ErrorFallback}
|
61 |
+
onReset={details => {
|
62 |
+
// Reset the state of your app so the error doesn't happen again
|
63 |
+
}}
|
64 |
+
onError={(error, componentStack) => {
|
65 |
+
// Do something with the runtime error
|
66 |
+
}}
|
67 |
+
>
|
68 |
+
<Provider store={storeConfiguration}>
|
69 |
+
<ThemeApp />
|
70 |
+
<div id=""portal-root"" style={{ position: 'relative' }} />
|
71 |
+
</Provider>
|
72 |
+
</ErrorBoundary>
|
73 |
+
);
|
74 |
+
}
|
75 |
+
}
|
76 |
+
|
77 |
+
export default App;
|
78 |
+
"
|
79 |
+
ThemeApp.tsx,"import ProtoContextProvider from '@common/hocs/ProtoContext';
|
80 |
+
import { ConnectedRouter } from '@protolibrary/core';
|
81 |
+
import React, { useEffect, useState } from 'react';
|
82 |
+
import AppMain from './AppMain';
|
83 |
+
import storeConfiguration from './store';
|
84 |
+
import { DARK_THEME, LIGHT_THEME } from './themes';
|
85 |
+
import { default as ProtoProvider } from '@protoweb/provider';
|
86 |
+
import { Route } from 'react-router-dom';
|
87 |
+
import { useStore } from '@core/states';
|
88 |
+
import Block from '@protoweb/block';
|
89 |
+
import NewVersionModal from '@common/modals/NewVersionModal';
|
90 |
+
import appState from '@core/states/AppState';
|
91 |
+
|
92 |
+
interface Props {}
|
93 |
+
|
94 |
+
export const ThemeApp = (props: Props) => {
|
95 |
+
const { theme, newVersion } = useStore('appState');
|
96 |
+
const [showModal, setShowModal] = useState(false);
|
97 |
+
useEffect(() => {
|
98 |
+
if (newVersion) {
|
99 |
+
setShowModal(true);
|
100 |
+
}
|
101 |
+
}, [newVersion]);
|
102 |
+
|
103 |
+
return (
|
104 |
+
<Block
|
105 |
+
className={theme === 'LIGHT' ? 'proto-light-theme' : 'proto-dark-theme'}
|
106 |
+
style={{ flexDirection: 'row', flex: 1, width: '100%', position: 'relative' }}
|
107 |
+
>
|
108 |
+
<ProtoProvider theme={theme === 'LIGHT' ? LIGHT_THEME : DARK_THEME}>
|
109 |
+
<ProtoContextProvider>
|
110 |
+
<ConnectedRouter store={storeConfiguration}>
|
111 |
+
<Route component={AppMain} />
|
112 |
+
</ConnectedRouter>
|
113 |
+
</ProtoContextProvider>
|
114 |
+
</ProtoProvider>
|
115 |
+
<NewVersionModal
|
116 |
+
show={showModal}
|
117 |
+
onClose={() => {
|
118 |
+
setShowModal(false);
|
119 |
+
appState.update({ newVersion: false });
|
120 |
+
}}
|
121 |
+
/>
|
122 |
+
</Block>
|
123 |
+
);
|
124 |
+
};
|
125 |
+
"
|
126 |
+
store.tsx,"import { configure, addAjaxEnricher, routeReducer } from '@protolibrary/core';
|
127 |
+
import setupAxiosInterceptors from './core/configuration/axios';
|
128 |
+
import ajaxEnricher from './core/configuration/enricher';
|
129 |
+
|
130 |
+
setupAxiosInterceptors();
|
131 |
+
addAjaxEnricher(ajaxEnricher);
|
132 |
+
const storeConfiguration = configure({ routing: routeReducer }, []);
|
133 |
+
|
134 |
+
export default storeConfiguration;
|
135 |
+
"
|
136 |
+
UserCreateUpdate.tsx,"import InputLayout from '@common/components/input-layout';
|
137 |
+
import PageHeader from '@common/components/page-header';
|
138 |
+
import RemoteSelect from '@common/components/remote-select';
|
139 |
+
import navigationService from '@common/navigation/NavigationService';
|
140 |
+
import { NavigationOperationType } from '@common/navigation/NavigationTypes';
|
141 |
+
import toastManager from '@common/toast/ToastManager';
|
142 |
+
import { TextField, Form, Col, Container, Row, Button } from '@protolibrary/components';
|
143 |
+
import { email, required } from '@protoweb/utils';
|
144 |
+
import roleService from '@services/RoleService';
|
145 |
+
import userService, { User } from '@services/UserService';
|
146 |
+
import { useLocationParams } from '@utils/LocationUtils';
|
147 |
+
import React, { useEffect, useState } from 'react';
|
148 |
+
import PasswordInput from '@common/components/password-input';
|
149 |
+
|
150 |
+
const UserCreateUpdate = props => {
|
151 |
+
const { operationType, id } = useLocationParams(props);
|
152 |
+
const [data, setData] = useState<User>(null);
|
153 |
+
const refForm = React.useRef(null);
|
154 |
+
|
155 |
+
const handleOnSubmit = () => {
|
156 |
+
const values = refForm.current.getValues();
|
157 |
+
|
158 |
+
if (operationType === NavigationOperationType.CREATE) {
|
159 |
+
const request: User = {
|
160 |
+
userName: values.userName,
|
161 |
+
firstName: values.firstName,
|
162 |
+
lastName: values.lastName,
|
163 |
+
roleIds: values.roleIds,
|
164 |
+
email: values.email,
|
165 |
+
};
|
166 |
+
|
167 |
+
userService.post(request, { password: values.password }).then(res => {
|
168 |
+
toastManager.show('success', 'Kullanıcı basariyla olusturuldu');
|
169 |
+
navigationService.push('/system-management/user-management');
|
170 |
+
});
|
171 |
+
} else if (operationType === NavigationOperationType.UPDATE) {
|
172 |
+
const request: User = {
|
173 |
+
id: data?.id,
|
174 |
+
userName: data?.userName,
|
175 |
+
firstName: values.firstName,
|
176 |
+
lastName: values.lastName,
|
177 |
+
email: values.email,
|
178 |
+
roleIds: values.roleIds,
|
179 |
+
};
|
180 |
+
userService.put(request).then(res => {
|
181 |
+
toastManager.show('success', 'Kullanıcı başarıyla guncellendi');
|
182 |
+
navigationService.push('/system-management/user-management');
|
183 |
+
});
|
184 |
+
}
|
185 |
+
};
|
186 |
+
|
187 |
+
useEffect(() => {
|
188 |
+
operationType === NavigationOperationType.UPDATE &&
|
189 |
+
userService.get(id).then(res => {
|
190 |
+
setData(res);
|
191 |
+
refForm.current.setValues(res);
|
192 |
+
});
|
193 |
+
}, []);
|
194 |
+
|
195 |
+
return (
|
196 |
+
<Container fluid>
|
197 |
+
<Form ref={refForm} onSubmit={handleOnSubmit}>
|
198 |
+
<PageHeader
|
199 |
+
backButton
|
200 |
+
title={
|
201 |
+
operationType === NavigationOperationType.CREATE
|
202 |
+
? 'Kullanıcı Olustur'
|
203 |
+
: 'Kullanıcı Güncelle'
|
204 |
+
}
|
205 |
+
>
|
206 |
+
<Button type=""submit"" text=""Kaydet"" className=""proto-button-secondary"" />
|
207 |
+
</PageHeader>
|
208 |
+
{operationType === NavigationOperationType.CREATE ? (
|
209 |
+
<Row>
|
210 |
+
<Col xs={12} md={12} lg={4} xl={4}>
|
211 |
+
<InputLayout label=""Kullanıcı Adı"">
|
212 |
+
<TextField name=""userName"" validations={[required('')]} />
|
213 |
+
</InputLayout>
|
214 |
+
</Col>
|
215 |
+
<Col xs={12} md={12} lg={4} xl={4}>
|
216 |
+
<InputLayout label=""Parola"">
|
217 |
+
<PasswordInput name=""password"" validations={[required('')]} />
|
218 |
+
</InputLayout>
|
219 |
+
</Col>
|
220 |
+
</Row>
|
221 |
+
) : null}
|
222 |
+
<Row>
|
223 |
+
<Col xs={12} md={12} lg={4} xl={4}>
|
224 |
+
<InputLayout label=""Ad"">
|
225 |
+
<TextField name=""firstName"" validations={[required('')]} />
|
226 |
+
</InputLayout>
|
227 |
+
</Col>
|
228 |
+
<Col xs={12} md={12} lg={4} xl={4}>
|
229 |
+
<InputLayout label=""Soyad"">
|
230 |
+
<TextField name=""lastName"" validations={[required('')]} />
|
231 |
+
</InputLayout>
|
232 |
+
</Col>
|
233 |
+
<Col xs={12} md={12} lg={4} xl={4}>
|
234 |
+
<InputLayout label=""Email"">
|
235 |
+
<TextField name=""email"" validations={[required(''), email('')]} />
|
236 |
+
</InputLayout>
|
237 |
+
</Col>
|
238 |
+
</Row>
|
239 |
+
<Row>
|
240 |
+
<Col xs={12} md={12} lg={4} xl={4}>
|
241 |
+
<InputLayout label=""Yetkili Roller"">
|
242 |
+
<RemoteSelect
|
243 |
+
placeholder=""Seciniz""
|
244 |
+
name=""roleIds""
|
245 |
+
mode=""multi""
|
246 |
+
validations={[required('')]}
|
247 |
+
service={roleService.getList}
|
248 |
+
/>
|
249 |
+
</InputLayout>
|
250 |
+
</Col>
|
251 |
+
</Row>
|
252 |
+
</Form>
|
253 |
+
</Container>
|
254 |
+
);
|
255 |
+
};
|
256 |
+
|
257 |
+
export default UserCreateUpdate;
|
258 |
+
import React from 'react';
|
259 |
+
import BasePropTypes from '@common/models/BasePropTypes';
|
260 |
+
import { Block, BackgroundImage, Label } from '@protolibrary/components';
|
261 |
+
|
262 |
+
import COLORS from '@resources/colors';
|
263 |
+
interface LoginPropTypes extends BasePropTypes {
|
264 |
+
fromCaptcha: boolean;
|
265 |
+
}
|
266 |
+
|
267 |
+
const WelcomePage: React.FC<LoginPropTypes> = () => {
|
268 |
+
return (
|
269 |
+
<BackgroundImage
|
270 |
+
path=""/public/images/login_background.jpg""
|
271 |
+
className=""""
|
272 |
+
style={{
|
273 |
+
backgroundSize: 'cover',
|
274 |
+
justifyContent: 'space-between',
|
275 |
+
display: 'flex',
|
276 |
+
flex: 1,
|
277 |
+
flexDirection: 'row',
|
278 |
+
}}
|
279 |
+
>
|
280 |
+
<Block style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
281 |
+
<Block style={{ padding: 75 }}>
|
282 |
+
<Block style={{ flexDirection: 'row' }}>
|
283 |
+
<Label
|
284 |
+
style={{
|
285 |
+
element: {
|
286 |
+
fontSize: 32,
|
287 |
+
fontWeight: 400,
|
288 |
+
color: COLORS.BLACK,
|
289 |
+
fontFamily: 'Poppins',
|
290 |
+
},
|
291 |
+
}}
|
292 |
+
text=""Proto""
|
293 |
+
/>
|
294 |
+
<Label
|
295 |
+
style={{
|
296 |
+
container: {
|
297 |
+
paddingLeft: 10,
|
298 |
+
},
|
299 |
+
element: {
|
300 |
+
fontSize: 32,
|
301 |
+
fontWeight: 600,
|
302 |
+
color: COLORS.BLACK,
|
303 |
+
fontFamily: 'Poppins',
|
304 |
+
},
|
305 |
+
}}
|
306 |
+
text=""Yazilim""
|
307 |
+
/>
|
308 |
+
</Block>
|
309 |
+
<Label
|
310 |
+
text=""UYGULAMASINA HOŞGELDİNİZ""
|
311 |
+
style={{
|
312 |
+
container: {
|
313 |
+
display: 'flex',
|
314 |
+
justifyContent: 'center',
|
315 |
+
},
|
316 |
+
element: {
|
317 |
+
fontSize: 30,
|
318 |
+
fontWeight: 275,
|
319 |
+
color: COLORS.BLACK,
|
320 |
+
fontFamily: 'Poppins',
|
321 |
+
},
|
322 |
+
}}
|
323 |
+
/>
|
324 |
+
</Block>
|
325 |
+
</Block>
|
326 |
+
</BackgroundImage>
|
327 |
+
);
|
328 |
+
};
|
329 |
+
|
330 |
+
export default WelcomePage;
|
331 |
+
import React from 'react';
|
332 |
+
import { Button, Col, Container, Form, Row } from '@protolibrary/components';
|
333 |
+
import PageHeader from '@common/components/page-header';
|
334 |
+
import InputLayout from '@common/components/input-layout';
|
335 |
+
import PasswordInput from '@common/components/password-input';
|
336 |
+
import { required } from '@protoweb/utils';
|
337 |
+
import userService from '@services/UserService';
|
338 |
+
import toastManager from '@common/toast/ToastManager';
|
339 |
+
import { useLocationParams } from '@utils/LocationUtils';
|
340 |
+
import navigationService from '@common/navigation/NavigationService';
|
341 |
+
|
342 |
+
const ResetPassword = props => {
|
343 |
+
const { id, userName, fullName } = useLocationParams(props);
|
344 |
+
const refForm = React.useRef(null);
|
345 |
+
|
346 |
+
const handleOnSubmit = () => {
|
347 |
+
const values = refForm.current.getValues();
|
348 |
+
userService.resetPassword(id, { newPassword: values.newPassword }).then(_ => {
|
349 |
+
toastManager.show('success', 'Şifre başarıyla sıfırlandı.');
|
350 |
+
navigationService.push('/system-management/user-management');
|
351 |
+
});
|
352 |
+
};
|
353 |
+
|
354 |
+
return (
|
355 |
+
<Container fluid>
|
356 |
+
<Form ref={refForm} onSubmit={handleOnSubmit}>
|
357 |
+
<PageHeader title={`${fullName} (${userName}) Kullanıcı Şifresi Sıfırla`}>
|
358 |
+
<Button type=""submit"" text=""Kaydet"" className=""proto-button-secondary"" />
|
359 |
+
</PageHeader>
|
360 |
+
<Row>
|
361 |
+
<Col xs={12} md={12} lg={4} xl={4}>
|
362 |
+
<InputLayout label=""Yeni Şifre"">
|
363 |
+
<PasswordInput
|
364 |
+
name=""newPassword""
|
365 |
+
placeholder=""Yeni Şifre""
|
366 |
+
validations={[required('')]}
|
367 |
+
/>
|
368 |
+
</InputLayout>
|
369 |
+
</Col>
|
370 |
+
</Row>
|
371 |
+
</Form>
|
372 |
+
</Container>
|
373 |
+
);
|
374 |
+
};
|
375 |
+
|
376 |
+
export default ResetPassword;
|
377 |
+
import InputLayout from '@common/components/input-layout';
|
378 |
+
import PageHeader from '@common/components/page-header';
|
379 |
+
import toastManager from '@common/toast/ToastManager';
|
380 |
+
import { Form, Col, Container, Row, Button } from '@protolibrary/components';
|
381 |
+
import { required } from '@protoweb/utils';
|
382 |
+
import userService, { ChangePasswordData } from '@services/UserService';
|
383 |
+
import React from 'react';
|
384 |
+
import PasswordInput from '@common/components/password-input';
|
385 |
+
|
386 |
+
const ChangePassword = props => {
|
387 |
+
const refForm = React.useRef(null);
|
388 |
+
|
389 |
+
const handleOnSubmit = () => {
|
390 |
+
const values = refForm.current.getValues();
|
391 |
+
const request: ChangePasswordData = {
|
392 |
+
oldPassword: values.oldPassword,
|
393 |
+
newPassword: values.newPassword,
|
394 |
+
newPasswordValidation: values.newPasswordValidation,
|
395 |
+
};
|
396 |
+
|
397 |
+
userService.changePassword(request).then(res => {
|
398 |
+
toastManager.show('success', 'Şifre başarıyla değiştirildi.');
|
399 |
+
});
|
400 |
+
};
|
401 |
+
|
402 |
+
return (
|
403 |
+
<Container fluid>
|
404 |
+
<Form ref={refForm} onSubmit={handleOnSubmit}>
|
405 |
+
<PageHeader title=""Şifre Değiştir"">
|
406 |
+
<Button type=""submit"" text=""Kaydet"" className=""proto-button-secondary"" />
|
407 |
+
</PageHeader>
|
408 |
+
<Row>
|
409 |
+
<Col xs={12} md={12} lg={4} xl={4}>
|
410 |
+
<InputLayout label=""Eski Şifre"">
|
411 |
+
<PasswordInput
|
412 |
+
name=""oldPassword""
|
413 |
+
placeholder=""Eski Şifre""
|
414 |
+
validations={[required('')]}
|
415 |
+
/>
|
416 |
+
</InputLayout>
|
417 |
+
</Col>
|
418 |
+
<Col xs={12} md={12} lg={4} xl={4}>
|
419 |
+
<InputLayout label=""Yeni Şifre"">
|
420 |
+
<PasswordInput
|
421 |
+
name=""newPassword""
|
422 |
+
placeholder=""Yeni Şifre""
|
423 |
+
validations={[required('')]}
|
424 |
+
/>
|
425 |
+
</InputLayout>
|
426 |
+
</Col>
|
427 |
+
<Col xs={12} md={12} lg={4} xl={4}>
|
428 |
+
<InputLayout label=""Yeni Şifre Tekrar"">
|
429 |
+
<PasswordInput
|
430 |
+
name=""newPasswordValidation""
|
431 |
+
placeholder=""Yeni Şifre Tekrar""
|
432 |
+
validations={[required('')]}
|
433 |
+
/>
|
434 |
+
</InputLayout>
|
435 |
+
</Col>
|
436 |
+
</Row>
|
437 |
+
</Form>
|
438 |
+
</Container>
|
439 |
+
);
|
440 |
+
};
|
441 |
+
|
442 |
+
export default ChangePassword;
|
443 |
+
import { Container } from '@protolibrary/components';
|
444 |
+
import React from 'react';
|
445 |
+
import Countdown from '../../components/countdown';
|
446 |
+
|
447 |
+
const DashBoard = () => {
|
448 |
+
return (
|
449 |
+
<Container style={{ backgroundColor: 'transparent' }}>
|
450 |
+
<Container>
|
451 |
+
<Countdown
|
452 |
+
title=""Under Construction""
|
453 |
+
footerText=""We will let you know when it is ready!""
|
454 |
+
timeTillDate=""2024-02-15 00:00:00""
|
455 |
+
/>
|
456 |
+
</Container>
|
457 |
+
</Container>
|
458 |
+
);
|
459 |
+
};
|
460 |
+
|
461 |
+
export default DashBoard;
|
462 |
+
import React from 'react';
|
463 |
+
import BasePropTypes from '@common/models/BasePropTypes';
|
464 |
+
import {
|
465 |
+
Block,
|
466 |
+
Form,
|
467 |
+
Icon,
|
468 |
+
TextField,
|
469 |
+
BackgroundImage,
|
470 |
+
Label,
|
471 |
+
Checkbox,
|
472 |
+
} from '@protolibrary/components';
|
473 |
+
import Button from '@protoweb/button';
|
474 |
+
import authService from '@services/AuthService';
|
475 |
+
import PasswordInput from '@common/components/password-input';
|
476 |
+
import COLORS from '@resources/colors';
|
477 |
+
import { LOGO } from '../../layout/assets/icons';
|
478 |
+
import useLocalization from '@hooks/useLocalization';
|
479 |
+
|
480 |
+
interface LoginPropTypes extends BasePropTypes {
|
481 |
+
fromCaptcha: boolean;
|
482 |
+
}
|
483 |
+
|
484 |
+
const Login: React.FC<LoginPropTypes> = () => {
|
485 |
+
const formRef = React.useRef<any>();
|
486 |
+
const { t } = useLocalization();
|
487 |
+
|
488 |
+
const handleOnSubmit = (_, formValues): void => {
|
489 |
+
let values = { userName: formValues?.userName, password: formValues?.password };
|
490 |
+
authService.login(values, formValues?.rememberMe);
|
491 |
+
};
|
492 |
+
|
493 |
+
const textfieldStyle = () => {
|
494 |
+
return {
|
495 |
+
container: {
|
496 |
+
height: 60,
|
497 |
+
position: 'relative',
|
498 |
+
cursor: 'pointer',
|
499 |
+
},
|
500 |
+
element: {
|
501 |
+
paddingLeft: 20,
|
502 |
+
height: 60,
|
503 |
+
cursor: 'pointer',
|
504 |
+
borderRadius: 8,
|
505 |
+
background: 'white',
|
506 |
+
borderWidth: 1,
|
507 |
+
borderStyle: 'solid',
|
508 |
+
borderColor: COLORS.GRAY,
|
509 |
+
fontSize: 16,
|
510 |
+
},
|
511 |
+
};
|
512 |
+
};
|
513 |
+
|
514 |
+
return (
|
515 |
+
<Block className=""flex-row"">
|
516 |
+
<BackgroundImage
|
517 |
+
path=""/public/images/loginx1.jpg""
|
518 |
+
className=""""
|
519 |
+
style={{
|
520 |
+
backgroundSize: 'cover',
|
521 |
+
justifyContent: 'space-between',
|
522 |
+
display: 'flex',
|
523 |
+
flex: 1,
|
524 |
+
flexDirection: 'row',
|
525 |
+
}}
|
526 |
+
>
|
527 |
+
<Block style={{ flex: 1, justifyContent: 'flex-end' }}></Block>
|
528 |
+
</BackgroundImage>
|
529 |
+
|
530 |
+
<Block className=""login__container"">
|
531 |
+
<Block
|
532 |
+
style={{
|
533 |
+
justifyContent: 'space-between',
|
534 |
+
padding: 30,
|
535 |
+
paddingLeft: 66,
|
536 |
+
paddingRight: 66,
|
537 |
+
paddingTop: 200,
|
538 |
+
display: 'flex',
|
539 |
+
flex: 1,
|
540 |
+
width: 500,
|
541 |
+
margin: 'auto',
|
542 |
+
}}
|
543 |
+
>
|
544 |
+
<Block>
|
545 |
+
<Form onSubmit={handleOnSubmit} ref={formRef}>
|
546 |
+
<Block
|
547 |
+
className=""flex flex-1 justify-content-center""
|
548 |
+
style={{ width: 259, height: 89, marginBottom: 100, fontSize: 48, margin: 'auto' }}
|
549 |
+
>
|
550 |
+
<Icon
|
551 |
+
className=""flex justify-content-center""
|
552 |
+
style={{
|
553 |
+
container: {
|
554 |
+
marginBottom: 39,
|
555 |
+
marginLeft: -30,
|
556 |
+
cursor: 'pointer',
|
557 |
+
width: 280,
|
558 |
+
height: 80,
|
559 |
+
},
|
560 |
+
element: { width: 150, height: 50, cursor: 'pointer' },
|
561 |
+
}}
|
562 |
+
icon={LOGO}
|
563 |
+
/>
|
564 |
+
</Block>
|
565 |
+
<Block style={{ marginBottom: 10 }}>
|
566 |
+
<TextField
|
567 |
+
name=""userName""
|
568 |
+
placeholder={t('login_form_username_placeholder')}
|
569 |
+
style={textfieldStyle()}
|
570 |
+
/>
|
571 |
+
</Block>
|
572 |
+
<Block style={{ marginBottom: 25 }}>
|
573 |
+
<PasswordInput
|
574 |
+
className=""login-password""
|
575 |
+
name=""password""
|
576 |
+
placeholder={t('login_form_password_placeholder')}
|
577 |
+
style={textfieldStyle()}
|
578 |
+
/>
|
579 |
+
</Block>
|
580 |
+
<Block
|
581 |
+
style={{
|
582 |
+
flexDirection: 'row',
|
583 |
+
display: 'flex',
|
584 |
+
alignItems: 'center',
|
585 |
+
marginBottom: 70,
|
586 |
+
}}
|
587 |
+
>
|
588 |
+
<Checkbox name={'rememberMe'} />
|
589 |
+
<Label
|
590 |
+
text={t('login_form_remember_me')}
|
591 |
+
style={{
|
592 |
+
element: {
|
593 |
+
lineHeight: '21px',
|
594 |
+
fontWeight: '400',
|
595 |
+
fontSize: 14,
|
596 |
+
color: '#444444',
|
597 |
+
},
|
598 |
+
}}
|
599 |
+
/>
|
600 |
+
</Block>
|
601 |
+
<Button
|
602 |
+
text={t('login_form_submit')}
|
603 |
+
type=""submit""
|
604 |
+
fullWidth
|
605 |
+
style={{
|
606 |
+
element: {
|
607 |
+
background: COLORS.PRIMARY,
|
608 |
+
minHeight: 60,
|
609 |
+
},
|
610 |
+
container: {
|
611 |
+
border: '1px solid',
|
612 |
+
borderColor: COLORS.WHITE,
|
613 |
+
},
|
614 |
+
text: {
|
615 |
+
color: COLORS.WHITE,
|
616 |
+
fontSize: 20,
|
617 |
+
fontWeight: 600,
|
618 |
+
lineHeight: '28px',
|
619 |
+
},
|
620 |
+
}}
|
621 |
+
/>
|
622 |
+
</Form>
|
623 |
+
</Block>
|
624 |
+
</Block>
|
625 |
+
</Block>
|
626 |
+
</Block>
|
627 |
+
);
|
628 |
+
};
|
629 |
+
|
630 |
+
export default Login;
|
631 |
+
|
632 |
+
"
|
633 |
+
AppMain.tsx,"import ErrorManager from '@common/error/ErrorManager';
|
634 |
+
import * as React from 'react';
|
635 |
+
import { useSelector } from 'react-redux';
|
636 |
+
import { Route, Switch } from 'react-router-dom';
|
637 |
+
import 'react-tippy/dist/tippy.css';
|
638 |
+
import { ToastContainer } from 'react-toastify';
|
639 |
+
import 'react-toastify/dist/ReactToastify.css';
|
640 |
+
import Loader from './components/Loader';
|
641 |
+
import { useStore } from '@core/states';
|
642 |
+
import DashBoard from './pages/authenticated/Dashboard';
|
643 |
+
import OrderPage from './pages/authenticated/order-management';
|
644 |
+
import NewOrderPage from './pages/authenticated/order-management/pages/NewOrder';
|
645 |
+
import Login from './pages/guest/Login';
|
646 |
+
import navigationService from '@common/navigation/NavigationService';
|
647 |
+
import 'primeflex/primeflex.css';
|
648 |
+
import 'react-toastify/dist/ReactToastify.css';
|
649 |
+
import './assets/css/custom.css';
|
650 |
+
import './assets/css/main.scss';
|
651 |
+
import './assets/css/tooltip.css';
|
652 |
+
import GenericModal from '@components/GenericModal';
|
653 |
+
import Layout from './layout';
|
654 |
+
import TaskManagement from './pages/authenticated/task-management';
|
655 |
+
import RoleManagement from './pages/authenticated/role-management';
|
656 |
+
import UserManagement from './pages/authenticated/user-management';
|
657 |
+
import UserCreateUpdate from './pages/authenticated/user-management/pages/UserCreateUpdate';
|
658 |
+
import CreateUpdateTask from './pages/authenticated/task-management/pages/CreateUpdateTask';
|
659 |
+
import CreateUpdateRole from './pages/authenticated/role-management/pages/CreateUpdateRole';
|
660 |
+
import authState from '@core/states/AuthState';
|
661 |
+
import accountService from '@services/Account';
|
662 |
+
import NAVIGATION_PATHS from '@common/navigation/NavigationPaths';
|
663 |
+
import OrderDetail from './pages/authenticated/order-management/pages/OrderDetail';
|
664 |
+
import OrderVehicleDetail from './pages/authenticated/order-management/pages/OrderVehicleDetail';
|
665 |
+
import ChangePassword from './pages/authenticated/user-management/pages/ChangePassword';
|
666 |
+
import ResetPassword from './pages/authenticated/user-management/pages/ResetPassword';
|
667 |
+
import en from 'public/lang/en.json';
|
668 |
+
import tr from 'public/lang/tr.json';
|
669 |
+
import LocalizedStrings from '@localization/LocalizedStrings';
|
670 |
+
import CustomerManagement from './pages/authenticated/customer-management';
|
671 |
+
import CustomerCreateUpdate from './pages/authenticated/customer-management/pages/CustomerCreateUpdate';
|
672 |
+
import ProjectManagement from './pages/authenticated/project-management';
|
673 |
+
import ProjectCreateUpdate from './pages/authenticated/project-management/pages/ProjectCreateUpdate';
|
674 |
+
|
675 |
+
export interface AppMainPropTypes {
|
676 |
+
authenticated: boolean;
|
677 |
+
isLoading: boolean;
|
678 |
+
location: any;
|
679 |
+
}
|
680 |
+
|
681 |
+
function AppMain({ location }: AppMainPropTypes) {
|
682 |
+
const isAuthenticated = useSelector<any, string>(state => state.authState.authenticated);
|
683 |
+
const modalStore = useStore('modalState');
|
684 |
+
const { open, type, closeAction, confirmAction } = modalStore;
|
685 |
+
const { open: loaderOpen } = useStore('loaderState');
|
686 |
+
|
687 |
+
React.useEffect(() => {
|
688 |
+
const lastRoute = sessionStorage.getItem('routePath');
|
689 |
+
accountService.getInfo().then(res => {
|
690 |
+
authState.update({ authenticated: true, roles: res.roles, fullName: res.fullName });
|
691 |
+
let routeParameters = sessionStorage.getItem('routeParameters');
|
692 |
+
|
693 |
+
if (routeParameters && typeof routeParameters === 'string') {
|
694 |
+
routeParameters = JSON.parse(routeParameters);
|
695 |
+
}
|
696 |
+
navigationService.push(
|
697 |
+
lastRoute || NAVIGATION_PATHS.SYSTEM_MANAGEMENT.ORDER.BASE,
|
698 |
+
routeParameters,
|
699 |
+
);
|
700 |
+
});
|
701 |
+
}, [isAuthenticated]);
|
702 |
+
|
703 |
+
React.useEffect(() => {
|
704 |
+
new LocalizedStrings({ EN: en, TR: tr });
|
705 |
+
}, []);
|
706 |
+
|
707 |
+
return (
|
708 |
+
<>
|
709 |
+
{loaderOpen && <Loader />}
|
710 |
+
{open && (
|
711 |
+
<GenericModal type={type} show={open} close={closeAction} confirmAction={confirmAction} />
|
712 |
+
)}
|
713 |
+
{isAuthenticated ? (
|
714 |
+
<Layout>
|
715 |
+
<Switch>
|
716 |
+
<Route exact path=""/dashboard"" component={DashBoard} />
|
717 |
+
<Route
|
718 |
+
exact
|
719 |
+
path={NAVIGATION_PATHS.SYSTEM_MANAGEMENT.ORDER.BASE}
|
720 |
+
component={OrderPage}
|
721 |
+
/>
|
722 |
+
<Route
|
723 |
+
exact
|
724 |
+
path={NAVIGATION_PATHS.SYSTEM_MANAGEMENT.ORDER.DETAIL}
|
725 |
+
component={OrderDetail}
|
726 |
+
/>
|
727 |
+
<Route
|
728 |
+
exact
|
729 |
+
path={NAVIGATION_PATHS.SYSTEM_MANAGEMENT.ORDER.VEHICLE_DETAIL}
|
730 |
+
component={OrderVehicleDetail}
|
731 |
+
/>
|
732 |
+
<Route
|
733 |
+
exact
|
734 |
+
path={NAVIGATION_PATHS.SYSTEM_MANAGEMENT.ORDER.CREATE}
|
735 |
+
component={NewOrderPage}
|
736 |
+
/>
|
737 |
+
<Route
|
738 |
+
exact
|
739 |
+
path={NAVIGATION_PATHS.SYSTEM_MANAGEMENT.TASK_MANAGEMENT.BASE}
|
740 |
+
component={TaskManagement}
|
741 |
+
/>
|
742 |
+
<Route
|
743 |
+
exact
|
744 |
+
path={NAVIGATION_PATHS.SYSTEM_MANAGEMENT.TASK_MANAGEMENT.CREATE_UPDATE}
|
745 |
+
component={CreateUpdateTask}
|
746 |
+
/>
|
747 |
+
<Route
|
748 |
+
exact
|
749 |
+
path={NAVIGATION_PATHS.SYSTEM_MANAGEMENT.USER_MANAGEMENT.BASE}
|
750 |
+
component={UserManagement}
|
751 |
+
/>
|
752 |
+
<Route
|
753 |
+
exact
|
754 |
+
path={NAVIGATION_PATHS.SYSTEM_MANAGEMENT.USER_MANAGEMENT.CREATE_UPDATE}
|
755 |
+
component={UserCreateUpdate}
|
756 |
+
/>
|
757 |
+
<Route
|
758 |
+
exact
|
759 |
+
path={NAVIGATION_PATHS.SYSTEM_MANAGEMENT.USER_MANAGEMENT.CHANGE_PASSWORD}
|
760 |
+
component={ChangePassword}
|
761 |
+
/>
|
762 |
+
<Route
|
763 |
+
exact
|
764 |
+
path={NAVIGATION_PATHS.SYSTEM_MANAGEMENT.USER_MANAGEMENT.RESET_PASSWORD}
|
765 |
+
component={ResetPassword}
|
766 |
+
/>
|
767 |
+
<Route
|
768 |
+
exact
|
769 |
+
path={NAVIGATION_PATHS.SYSTEM_MANAGEMENT.ROLE_MANAGEMENT.BASE}
|
770 |
+
component={RoleManagement}
|
771 |
+
/>
|
772 |
+
<Route
|
773 |
+
exact
|
774 |
+
path={NAVIGATION_PATHS.SYSTEM_MANAGEMENT.ROLE_MANAGEMENT.CREATE_UPDATE}
|
775 |
+
component={CreateUpdateRole}
|
776 |
+
/>
|
777 |
+
<Route
|
778 |
+
exact
|
779 |
+
path={NAVIGATION_PATHS.SYSTEM_MANAGEMENT.CUSTOMER_MANAGEMENT.BASE}
|
780 |
+
component={CustomerManagement}
|
781 |
+
/>
|
782 |
+
<Route
|
783 |
+
exact
|
784 |
+
path={NAVIGATION_PATHS.SYSTEM_MANAGEMENT.CUSTOMER_MANAGEMENT.CREATE_UPDATE}
|
785 |
+
component={CustomerCreateUpdate}
|
786 |
+
/>
|
787 |
+
<Route
|
788 |
+
exact
|
789 |
+
path={NAVIGATION_PATHS.SYSTEM_MANAGEMENT.PROJECT_MANAGEMENT.BASE}
|
790 |
+
component={ProjectManagement}
|
791 |
+
/>
|
792 |
+
<Route
|
793 |
+
exact
|
794 |
+
path={NAVIGATION_PATHS.SYSTEM_MANAGEMENT.PROJECT_MANAGEMENT.CREATE_UPDATE}
|
795 |
+
component={ProjectCreateUpdate}
|
796 |
+
/>
|
797 |
+
</Switch>
|
798 |
+
</Layout>
|
799 |
+
) : (
|
800 |
+
<Switch>
|
801 |
+
<Route exact path=""/"" component={Login} />
|
802 |
+
<Route exact path=""/login"" component={Login} />
|
803 |
+
<Route exact path=""/guest"" component={Login} />
|
804 |
+
</Switch>
|
805 |
+
)}
|
806 |
+
<ToastContainer />
|
807 |
+
<ErrorManager />
|
808 |
+
</>
|
809 |
+
);
|
810 |
+
}
|
811 |
+
|
812 |
+
export default AppMain;
|
813 |
+
"
|