Skip to content

Commit 86ddeaa

Browse files
committed
Code refactored.
1 parent 4e2a23f commit 86ddeaa

22 files changed

+212
-294
lines changed

reactjs/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
REACT_APP_API_URL="http://www.ryoldash.com/"

reactjs/.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
REACT_APP_API_URL="http://localhost:21021/"

reactjs/.env.production

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
REACT_APP_API_URL="http://www.ryoldash.com/"
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import * as React from 'react';
2+
import { Col, Icon, Layout, Avatar, Menu, Dropdown, Badge } from 'antd';
3+
4+
export interface LayoutHeaderProps {
5+
collapsed?: any;
6+
toggle?: any;
7+
}
8+
9+
const userDropdownMenu = (
10+
<Menu>
11+
<Menu.Item key="2">
12+
<Icon type="logout" />
13+
<span>Logout</span>
14+
</Menu.Item>
15+
</Menu>
16+
);
17+
18+
const languageMenu = (
19+
<Menu>
20+
<Menu.Item key="1">
21+
<span>English</span>
22+
</Menu.Item>
23+
<Menu.Item key="2">
24+
<span>Deutsch</span>
25+
</Menu.Item>
26+
<Menu.Item key="3">
27+
<span>Türkçe</span>
28+
</Menu.Item>
29+
</Menu>
30+
);
31+
32+
export class LayoutHeader extends React.Component<LayoutHeaderProps> {
33+
render() {
34+
return (
35+
<Layout.Header style={{ background: '#fff', minHeight: 83, padding: 0 }}>
36+
<Col style={{ textAlign: 'left' }} span={12}>
37+
<Icon
38+
style={{ marginTop: 10, marginRight: 10, textAlign: 'left' }}
39+
className="trigger"
40+
type={this.props.collapsed ? 'menu-unfold' : 'menu-fold'}
41+
onClick={this.props.toggle}
42+
/>
43+
</Col>
44+
<Col style={{ margin: 15, marginLeft: 10, textAlign: 'right' }}>
45+
<Dropdown overlay={languageMenu} trigger={['click']}>
46+
<Icon style={{ margin: 20 }} type="global" />
47+
</Dropdown>
48+
<Dropdown overlay={userDropdownMenu} trigger={['click']}>
49+
<Badge style={{ margin: 10 }} count={3}>
50+
<Avatar style={{ margin: 10 }} size={48} alt={'profile'} src="https://sametkabay.com/images/smtkby/smtkby240.png" />
51+
</Badge>
52+
</Dropdown>
53+
</Col>
54+
</Layout.Header>
55+
);
56+
}
57+
}
58+
59+
export default LayoutHeader;

reactjs/src/lib/abp.d.ts

Lines changed: 15 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export namespace abp {
1+
declare namespace abp {
22
let appPath: string;
33

44
let pageLoadTime: Date;
@@ -9,7 +9,7 @@
99
enum sides {
1010
TENANT = 1,
1111

12-
HOST = 2
12+
HOST = 2,
1313
}
1414

1515
let isEnabled: boolean;
@@ -126,7 +126,7 @@
126126

127127
Tenant = 2,
128128

129-
User = 4
129+
User = 4,
130130
}
131131
}
132132

@@ -166,12 +166,12 @@
166166
SUCCESS,
167167
WARN,
168168
ERROR,
169-
FATAL
169+
FATAL,
170170
}
171171

172172
enum userNotificationState {
173173
UNREAD,
174-
READ
174+
READ,
175175
}
176176

177177
//TODO: We can extend this interface to define built-in notification types, like ILocalizableMessageNotificationData
@@ -211,22 +211,13 @@
211211

212212
let messageFormatters: any;
213213

214-
function getUserNotificationStateAsString(
215-
userNotificationState: userNotificationState
216-
): string;
214+
function getUserNotificationStateAsString(userNotificationState: userNotificationState): string;
217215

218-
function getUiNotifyFuncBySeverity(
219-
severity: severity
220-
): (message: string, title?: string, options?: any) => void;
216+
function getUiNotifyFuncBySeverity(severity: severity): (message: string, title?: string, options?: any) => void;
221217

222-
function getFormattedMessageFromUserNotification(
223-
userNotification: IUserNotification
224-
): string;
218+
function getFormattedMessageFromUserNotification(userNotification: IUserNotification): string;
225219

226-
function showUiNotifyForUserNotification(
227-
userNotification: IUserNotification,
228-
options?: any
229-
): void;
220+
function showUiNotifyForUserNotification(userNotification: IUserNotification, options?: any): void;
230221
}
231222

232223
namespace log {
@@ -235,7 +226,7 @@
235226
INFO,
236227
WARN,
237228
ERROR,
238-
FATAL
229+
FATAL,
239230
}
240231

241232
let level: levels;
@@ -274,16 +265,9 @@
274265

275266
function error(message: string, title?: string): any;
276267

277-
function confirm(
278-
message: string,
279-
callback?: (result: boolean) => void
280-
): any;
268+
function confirm(message: string, callback?: (result: boolean) => void): any;
281269

282-
function confirm(
283-
message: string,
284-
title?: string,
285-
callback?: (result: boolean) => void
286-
): any;
270+
function confirm(message: string, title?: string, callback?: (result: boolean) => void): any;
287271
}
288272

289273
namespace ui {
@@ -322,18 +306,11 @@
322306

323307
function truncateString(str: string, maxLength: number): string;
324308

325-
function truncateStringWithPostfix(
326-
str: string,
327-
maxLength: number,
328-
postfix?: string
329-
): string;
309+
function truncateStringWithPostfix(str: string, maxLength: number, postfix?: string): string;
330310

331311
function isFunction(obj: any): boolean;
332312

333-
function buildQueryString(
334-
parameterInfos: INameValue[],
335-
includeQuestionMark?: boolean
336-
): string;
313+
function buildQueryString(parameterInfos: INameValue[], includeQuestionMark?: boolean): string;
337314

338315
/**
339316
* Sets a cookie value for given key.
@@ -344,12 +321,7 @@
344321
* @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session.
345322
* @param {string} path (optional)
346323
*/
347-
function setCookieValue(
348-
key: string,
349-
value: string,
350-
expireDate?: Date,
351-
path?: string
352-
): void;
324+
function setCookieValue(key: string, value: string, expireDate?: Date, path?: string): void;
353325

354326
/**
355327
* Gets a cookie with given key.

reactjs/src/lib/appconst.ts

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
import url from './url'
2-
const AppConsts= {
3-
userManagement:{
4-
defaultAdminUserName: 'admin'
5-
},
6-
localization:{
7-
defaultLocalizationSourceName: 'FengCloud'
8-
},
9-
authorization:{
10-
encrptedAuthTokenName: 'enc_auth_token'
11-
},
12-
appBaseUrl: "http://localhost:8080",
13-
remoteServiceBaseUrl:url
14-
}
15-
export default AppConsts
1+
const AppConsts = {
2+
userManagement: {
3+
defaultAdminUserName: 'admin',
4+
},
5+
localization: {
6+
defaultLocalizationSourceName: 'TR',
7+
},
8+
authorization: {
9+
encrptedAuthTokenName: 'enc_auth_token',
10+
},
11+
appBaseUrl: 'http://localhost:8080',
12+
remoteServiceBaseUrl: process.env.REACT_APP_API_URL,
13+
};
14+
export default AppConsts;

reactjs/src/lib/url.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

reactjs/src/model/entityDto.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

reactjs/src/scenes/Layout/components/Header/index.tsx

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)