Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5d4aaea

Browse files
Refornat files using prettier
1 parent 90321fa commit 5d4aaea

File tree

30 files changed

+124
-130
lines changed

30 files changed

+124
-130
lines changed

‎GhostUI/ClientApp/src/api/auth.service.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { AxiosResponse } from "axios";
2-
import { BaseService } from "./base.service";
3-
import { ICredentials, IAuthUser } from "@/store/modules/auth";
1+
import { AxiosResponse } from 'axios';
2+
import { BaseService } from './base.service';
3+
import { ICredentials, IAuthUser } from '@/store/modules/auth';
44

55
/**
66
* Auth API abstraction layer communication via Axios (typescript singleton pattern)
@@ -13,16 +13,16 @@ class AuthService extends BaseService {
1313
}
1414

1515
public static get Instance(): AuthService {
16-
return (this._authService || (this._authService = new this("Auth")));
16+
return this._authService || (this._authService = new this('Auth'));
1717
}
1818

1919
public async logout(): Promise<AxiosResponse> {
20-
return await this.$http.post("Logout");
20+
return await this.$http.post('Logout');
2121
}
2222

2323
public async login(userName: string, password: string, rememberMe: boolean): Promise<IAuthUser> {
2424
const credentials: ICredentials = { userName, password, rememberMe };
25-
const { data } = await this.$http.post<IAuthUser>("Login", credentials);
25+
const { data } = await this.$http.post<IAuthUser>('Login', credentials);
2626
return data;
2727
}
2828
}

‎GhostUI/ClientApp/src/api/base.service.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import axios, { AxiosInstance } from "axios";
1+
import axios, { AxiosInstance } from 'axios';
22

33
/**
44
* Service API base class - configures default settings/error handling for inheriting class

‎GhostUI/ClientApp/src/api/sample.service.ts‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { AxiosRequestConfig } from "axios";
2-
import { BaseService } from "./base.service";
3-
import { IWeatherForecast } from "@/store/modules/weather-forecasts";
1+
import { AxiosRequestConfig } from 'axios';
2+
import { BaseService } from './base.service';
3+
import { IWeatherForecast } from '@/store/modules/weather-forecasts';
44

55
/**
66
* SampleData API abstraction layer communication via Axios (typescript singleton pattern)
@@ -13,7 +13,7 @@ class SampleService extends BaseService {
1313
}
1414

1515
public static get Instance(): SampleService {
16-
return (this._sampleService || (this._sampleService = new this("SampleData")));
16+
return this._sampleService || (this._sampleService = new this('SampleData'));
1717
}
1818

1919
public async getWeatherForecastsAsync(startDateIndex: number): Promise<IWeatherForecast[]> {
@@ -22,7 +22,8 @@ class SampleService extends BaseService {
2222
startDateIndex,
2323
},
2424
};
25-
const { data } = await this.$http.get<IWeatherForecast[]>("GetWeatherForecasts", config);
25+
26+
const { data } = await this.$http.get<IWeatherForecast[]>('GetWeatherForecasts', config);
2627
return data;
2728
}
2829
}

‎GhostUI/ClientApp/src/api/signalR.service.ts‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { EventBus } from "@/event-bus";
2-
import { HubConnection, HubConnectionBuilder, HubConnectionState } from "@aspnet/signalr";
1+
import { EventBus } from '@/event-bus';
2+
import { HubConnection, HubConnectionBuilder, HubConnectionState } from '@aspnet/signalr';
33

44
/**
55
* SignalR hub defaults
66
*/
77
const _signalrConfig = Object.freeze({
88
CONNECTION_DELAY: 0,
99
HUB_MESSAGE_DELAY: 3000,
10-
BASE_URL: "/hubs/users",
11-
HUB_MESSAGE_TITLE: "SignalR",
12-
LOGIN_USER_EVENT: "UserLogin",
13-
LOGOUT_USER_EVENT: "UserLogout",
14-
CLOSE_EVENT: "CloseAllConnections"
10+
BASE_URL: '/hubs/users',
11+
HUB_MESSAGE_TITLE: 'SignalR',
12+
LOGIN_USER_EVENT: 'UserLogin',
13+
LOGOUT_USER_EVENT: 'UserLogout',
14+
CLOSE_EVENT: 'CloseAllConnections'
1515
});
1616

1717
/**
@@ -31,7 +31,7 @@ class SignalRService {
3131
}
3232

3333
public startConnection(): void {
34-
if (this._hubConnection.state === HubConnectionState.Connected) {
34+
if (this._hubConnection.state === HubConnectionState.Connected) {
3535
return;
3636
}
3737

@@ -52,7 +52,7 @@ class SignalRService {
5252
this._hubConnection.on(_signalrConfig.LOGIN_USER_EVENT, () => {
5353
setTimeout(() => {
5454
EventBus.$snotify.info(
55-
"A user has logged in",
55+
'A user has logged in',
5656
_signalrConfig.HUB_MESSAGE_TITLE
5757
);
5858
}, _signalrConfig.HUB_MESSAGE_DELAY);
@@ -61,7 +61,7 @@ class SignalRService {
6161
this._hubConnection.on(_signalrConfig.LOGOUT_USER_EVENT, () => {
6262
setTimeout(() => {
6363
EventBus.$snotify.info(
64-
"A user has logged out",
64+
'A user has logged out',
6565
_signalrConfig.HUB_MESSAGE_TITLE
6666
);
6767
}, _signalrConfig.HUB_MESSAGE_DELAY);

‎GhostUI/ClientApp/src/components/Authenticator.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default class Authenticator extends Vue {
2323
].includes(this.authStatus);
2424
}
2525
26-
@Watch("authStatus")
26+
@Watch('authStatus')
2727
public onStatusChange(newAuthStatus: AuthStatus): void {
2828
if ([AuthStatusEnum.FAIL, AuthStatusEnum.SUCCESS].includes(newAuthStatus)) {
2929
setTimeout(() => {

‎GhostUI/ClientApp/src/components/Navbar.vue‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,11 @@ export default class Navbar extends Vue {
4141
return AuthModule.isAuthenticated;
4242
}
4343
44-
public navRoutes: Route[] = Object.keys(RoutesConfig)
45-
.reduce((acc: Route[], key: string) => {
46-
const route = RoutesConfig[key];
47-
route.meta.showInNav && acc.push(route);
48-
return acc;
49-
}, []);
44+
public navRoutes: Route[] = Object.keys(RoutesConfig).reduce((acc: Route[], key: string) => {
45+
const route = RoutesConfig[key];
46+
route.meta.showInNav && acc.push(route);
47+
return acc;
48+
}, []);
5049
}
5150
</script>
5251

‎GhostUI/ClientApp/src/components/Settings.vue‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@
5353
<script lang="ts">
5454
import { Component, Vue } from "vue-property-decorator";
5555
import { AuthModule } from "@/store/modules/auth";
56-
import { RoutesConfig } from "@/config/routes.config";
56+
import { Route, RoutesConfig } from "@/config/routes.config";
5757
import { nugetUrlConfig, UrlConfig } from "@/config/constants";
5858
5959
@Component
6060
export default class Settings extends Vue {
6161
public open: boolean = false;
62-
public readonly nugetUrls: UrlConfig = nugetUrlConfig;
63-
public readonly routesConfig: RoutesConfig = RoutesConfig;
62+
public readonly nugetUrls: Record<string, string> = nugetUrlConfig;
63+
public readonly routesConfig: Record<string, Route> = RoutesConfig;
6464
6565
get isAuthenticated(): boolean {
6666
return AuthModule.isAuthenticated;

‎GhostUI/ClientApp/src/components/VCheckbox.render.tsx‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ const StyledCheckIcon = styled.i`
9797

9898
@Component
9999
export default class VCheckBox extends Vue {
100-
@Prop({ default: undefined }) public readonly id: string;
101-
@Prop({ default: undefined }) public readonly name: string;
102-
@Prop({ default: undefined }) public readonly label: string;
103-
@Prop({ default: false }) public readonly checked: boolean;
104-
@Prop({ default: false }) public readonly disabled: boolean;
105-
@Prop({ default: false }) public readonly readOnly: boolean;
100+
@Prop({ default: undefined }) public readonly id: string;
101+
@Prop({ default: undefined }) public readonly name: string;
102+
@Prop({ default: undefined }) public readonly label: string;
103+
@Prop({ default: false }) public readonly checked: boolean;
104+
@Prop({ default: false }) public readonly disabled: boolean;
105+
@Prop({ default: false }) public readonly readOnly: boolean;
106106

107107
public render(): VNode {
108108
return (
@@ -124,6 +124,6 @@ export default class VCheckBox extends Vue {
124124
}
125125

126126
public handleOnChange(event: Event): void {
127-
this.$emit('checked', !!(event.target as HTMLInputElement).checked);
127+
this.$emit('checked', (event.target as HTMLInputElement).checked);
128128
}
129129
}

‎GhostUI/ClientApp/src/components/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ export {
1313
AppFooter,
1414
VCheckbox,
1515
VDropdown,
16-
Authenticator,
16+
Authenticator
1717
};
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import axios, { AxiosError, AxiosResponse } from "axios";
2-
import { EventBus } from "@/event-bus";
1+
import axios, { AxiosError, AxiosResponse } from 'axios';
2+
import { EventBus } from '@/event-bus';
33

44
export const configureAxiosInterceptors = (): void => {
55
axios.interceptors.response.use(
@@ -16,30 +16,30 @@ export const configureAxiosInterceptors = (): void => {
1616
const handleAxiosError = (error: AxiosError): void => {
1717
// Error Message Object
1818
const message = {
19-
body: "Internal Server Error",
20-
request: "",
19+
body: 'Internal Server Error',
20+
request: '',
2121
status: 500
2222
};
2323

2424
//Setup Error Message
25-
if (typeof error !== "undefined") {
26-
if (error.hasOwnProperty("message")) {
25+
if (typeof error !== 'undefined') {
26+
if (error.hasOwnProperty('message')) {
2727
message.body = error.message;
2828
}
2929
}
3030

31-
if (typeof error.response !== "undefined") {
31+
if (typeof error.response !== 'undefined') {
3232
// Setup Generic Response Messages
3333
if (error.response.status === 401) {
34-
message.body = "UnAuthorized";
34+
message.body = 'UnAuthorized';
3535
} else if (error.response.status === 404) {
36-
message.body = "API Route is Missing or Undefined";
36+
message.body = 'API Route is Missing or Undefined';
3737
} else if (error.response.status === 405) {
38-
message.body = "API Route Method Not Allowed";
38+
message.body = 'API Route Method Not Allowed';
3939
} else if (error.response.status === 422) {
4040
//Validation Message
4141
} else if (error.response.status >= 500) {
42-
message.body = "Internal Server Error";
42+
message.body = 'Internal Server Error';
4343
}
4444

4545
// Assign error status code
@@ -48,13 +48,13 @@ const handleAxiosError = (error: AxiosError): void => {
4848
}
4949

5050
// Try to Use the Response Message
51-
if (error.hasOwnProperty("response") && error.response.hasOwnProperty("data")) {
52-
if (error.response.data.hasOwnProperty("message") && error.response.data.message.length > 0) {
51+
if (error.hasOwnProperty('response') && error.response.hasOwnProperty('data')) {
52+
if (error.response.data.hasOwnProperty('message') && error.response.data.message.length > 0) {
5353
message.body = error.response.data.message;
5454
}
5555
}
5656
}
5757

5858
// Log in console or use Snotify notification (via Global EventBus)
59-
EventBus.$snotify.error(`${message.status} (${message.body})`, "XHR Error");
59+
EventBus.$snotify.error(`${message.status} (${message.body})`, 'XHR Error');
6060
};

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /