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 a693cb6

Browse files
general app refactoring; bump node and .NET Core nuget packages
1 parent fb8e6e8 commit a693cb6

File tree

12 files changed

+1337
-203
lines changed

12 files changed

+1337
-203
lines changed

‎GhostUI/ClientApp/.eslintrc.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true
5+
},
6+
extends: [
7+
"plugin:vue/vue3-essential",
8+
"eslint:recommended",
9+
"@vue/typescript/recommended",
10+
"@vue/prettier/@typescript-eslint"
11+
],
12+
parserOptions: {
13+
ecmaVersion: 2020
14+
},
15+
rules: {
16+
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
17+
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
18+
}
19+
};

‎GhostUI/ClientApp/package-lock.json

Lines changed: 1276 additions & 116 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎GhostUI/ClientApp/package.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
"name": "aspnet-core-vue-vuex-playground-template",
33
"version": "0.1.0",
44
"private": true,
5-
"description": "",
6-
"author": "",
75
"license": "MIT",
86
"scripts": {
97
"serve": "vue-cli-service serve",
@@ -13,9 +11,9 @@
1311
"test:unit": "vue-cli-service test:unit"
1412
},
1513
"dependencies": {
16-
"@fortawesome/fontawesome-svg-core": "^1.2.30",
17-
"@fortawesome/free-brands-svg-icons": "^5.14.0",
18-
"@fortawesome/free-solid-svg-icons": "^5.14.0",
14+
"@fortawesome/fontawesome-svg-core": "^1.2.31",
15+
"@fortawesome/free-brands-svg-icons": "^5.15.0",
16+
"@fortawesome/free-solid-svg-icons": "^5.15.0",
1917
"@fortawesome/vue-fontawesome": "^2.0.0",
2018
"@microsoft/signalr": "^3.1.8",
2119
"axios": "^0.20.0",
@@ -33,14 +31,22 @@
3331
"devDependencies": {
3432
"@testing-library/jest-dom": "^5.11.4",
3533
"@types/jest": "^26.0.14",
34+
"@typescript-eslint/eslint-plugin": "^4.3.0",
35+
"@typescript-eslint/parser": "^4.3.0",
3636
"@vue/cli-plugin-babel": "^4.5.6",
3737
"@vue/cli-plugin-e2e-nightwatch": "^4.5.6",
38+
"@vue/cli-plugin-eslint": "^4.5.6",
3839
"@vue/cli-plugin-pwa": "^4.5.6",
3940
"@vue/cli-plugin-typescript": "^4.5.6",
4041
"@vue/cli-plugin-unit-jest": "^4.5.6",
4142
"@vue/cli-service": "^4.5.6",
43+
"@vue/eslint-config-prettier": "^6.0.0",
4244
"@vue/test-utils": "1.1.0",
45+
"eslint": "^7.10.0",
46+
"eslint-plugin-prettier": "^3.1.4",
47+
"eslint-plugin-vue": "^6.2.2",
4348
"node-sass": "^4.14.1",
49+
"prettier": "^2.1.2",
4450
"sass-loader": "^10.0.2",
4551
"ts-jest": "^26.4.1",
4652
"typescript": "^4.0.3",

‎GhostUI/ClientApp/src/App.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<template>
22
<div id="app">
33
<vue-snotify />
4-
<navbar />
5-
<settings />
4+
<Navbar />
5+
<Settings />
66
<transition mode="out-in" :name="$route.meta.transitionName">
77
<router-view />
88
</transition>
9-
<app-footer />
9+
<AppFooter />
1010
</div>
1111
</template>
1212

‎GhostUI/ClientApp/src/main.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ import '@/config/fa.config';
1313
// Execute global Axios configurations (e.g. request interceptors)
1414
AxiosGlobalConfig.setup();
1515

16-
// Install custom plugins
17-
Vue.use(vClickOutside);
18-
19-
// Install npm packages
20-
Vue.use(Snotify, snotifyDefaults);
16+
// Install custom plugins/third-party packages
17+
Vue.use(vClickOutside)
18+
.use(Snotify, snotifyDefaults);
2119

2220
new Vue({
2321
router,

‎GhostUI/ClientApp/src/store/modules/auth/auth.module.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ const initialState: IAuthState = {
1111
status: AuthStatusEnum.NONE
1212
};
1313

14-
const authFailureState: Partial<IAuthState> = {
15-
token: initialState.token,
16-
status: AuthStatusEnum.FAIL
17-
};
18-
1914
@Module({
2015
store,
2116
name: 'auth',
@@ -28,7 +23,7 @@ class Auth extends VuexModule implements IAuthState {
2823
public status: AuthStatusEnum = initialState.status;
2924
public rememberMe: boolean = initialState.rememberMe;
3025

31-
public get isUserNameOrPasswordEmpty(): boolean {
26+
public get isLoginInputValid(): boolean {
3227
return !this.userName || !this.password;
3328
}
3429

@@ -43,7 +38,8 @@ class Auth extends VuexModule implements IAuthState {
4338
return authUser;
4439
} catch (e) {
4540
return {
46-
...authFailureState
41+
token: initialState.token,
42+
status: AuthStatusEnum.FAIL
4743
};
4844
}
4945
}

‎GhostUI/ClientApp/src/views/FetchData/FetchData.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
This component demonstrates fetching data from the server - Start Date Index:
99
<code>{{currentStartDateIndex}}</code>
1010
</h5>
11-
<spinner :isLoading="isLoading" />
12-
<forecast-table :forecasts="forecasts" />
11+
<Spinner :isLoading="isLoading" />
12+
<ForecastTable :forecasts="forecasts" />
1313
<p class="buttons is-pagination-group">
1414
<a class="button is-info" @click="paginateForecastData(-5)">
1515
<font-awesome-icon icon="angle-double-left" size="2x" />
@@ -25,10 +25,10 @@
2525

2626
<script lang="ts">
2727
import { Component, Vue } from "vue-property-decorator";
28-
import { Spinner } from "@/components";
29-
import { isArrayWithLength } from "@/utils";
28+
import { Spinner } from "../../components";
29+
import { isArrayWithLength } from "../../utils";
3030
import { ForecastTable } from "./child-components";
31-
import { WeatherForecastModule, IWeatherForecast } from "@/store/modules/weather-forecasts";
31+
import { WeatherForecastModule, IWeatherForecast } from "../../store/modules/weather-forecasts";
3232
3333
@Component({
3434
components: {

‎GhostUI/ClientApp/src/views/FetchData/child-components/ForecastTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<script lang="ts">
2323
import { Component, Prop, Vue } from "vue-property-decorator";
24-
import { IWeatherForecast } from "@/store/modules/weather-forecasts";
24+
import { IWeatherForecast } from "../../../store/modules/weather-forecasts";
2525
2626
@Component
2727
export default class ForecastTable extends Vue {

‎GhostUI/ClientApp/src/views/Form/Form.vue

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,10 @@
88
<h3 class="title is-4">Counter</h3>
99
<h5 class="subtitle is-5">Use buttons to update count value</h5>
1010
<p class="buttons incrementer-buttons form-control-group">
11-
<button
12-
@click="count = count - 1"
13-
class="button is-light minus"
14-
>
11+
<button @click="count = count - 1" class="button is-light minus">
1512
<font-awesome-icon icon="minus" class="is-danger" />
1613
</button>
17-
<button
18-
@click="count = count + 1"
19-
class="button is-light plus"
20-
>
14+
<button @click="count = count + 1" class="button is-light plus">
2115
<font-awesome-icon icon="plus" class="is-success" />
2216
</button>
2317
</p>
@@ -29,7 +23,7 @@
2923
<h3 class="title is-4">Dropdown</h3>
3024
<h5 class="subtitle is-5">Select options from the dropdown</h5>
3125
<div class="field form-control-group">
32-
<v-dropdown
26+
<VDropdown
3327
labelKey="label"
3428
:options="dropdownOptions"
3529
wrapperClass="normal-width"
@@ -45,7 +39,7 @@
4539
<h3 class="title is-4">Checkbox</h3>
4640
<h5 class="subtitle is-5">Toggle the checkbox</h5>
4741
<div class="field form-control-group">
48-
<v-checkbox
42+
<VCheckbox
4943
:checked="checkboxValue"
5044
@checked="checked => checkboxValue = checked"
5145
/>
@@ -62,9 +56,9 @@
6256

6357
<script lang="ts">
6458
import { Component, Vue } from "vue-property-decorator";
65-
import { VCheckbox, VDropdown } from "@/components";
66-
import { DROPDOWN_TEST_DATA } from "@/config/constants";
67-
import { FormModule, IDropdownOption } from "@/store/modules/form";
59+
import { VCheckbox, VDropdown } from "../../components";
60+
import { DROPDOWN_TEST_DATA } from "../../config/constants";
61+
import { FormModule, IDropdownOption } from "../../store/modules/form";
6862
6963
@Component({
7064
components: {

‎GhostUI/ClientApp/src/views/Login/Login.vue

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,16 @@
1212
src="@/assets/img/based-ghost-main.png"
1313
/>
1414
<form @submit.prevent="handleLogin">
15-
<user-name-input :isInputInvalid="invalidInputs" />
16-
<password-input :isInputInvalid="invalidInputs" />
17-
<remember-me-input />
15+
<UserNameInput :isInputInvalid="invalidInputs" />
16+
<PasswordInput :isInputInvalid="invalidInputs" />
17+
<RememberMeInput />
1818
<button type="submit" class="button is-info is-medium is-fullwidth">
1919
<span>Login</span>
2020
<span class="icon">
2121
<font-awesome-icon icon="sign-in-alt" />
2222
</span>
2323
</button>
24-
<Authenticator
25-
:authStatus="authStatus"
26-
@success="onAuthSuccess"
27-
@fail="onAuthFailure"
28-
/>
24+
<Authenticator :authStatus="authStatus" @success="onAuthSuccess" @fail="onAuthFailure" />
2925
</form>
3026
</div>
3127
</div>
@@ -52,8 +48,8 @@ export default class Login extends Vue {
5248
public invalidInputs: boolean = false;
5349
public authStatus: AuthStatusEnum = AuthStatusEnum.NONE;
5450
55-
get isUserNameOrPasswordEmpty(): boolean {
56-
return AuthModule.isUserNameOrPasswordEmpty;
51+
get isLoginInputValid(): boolean {
52+
return AuthModule.isLoginInputValid;
5753
}
5854
5955
public mounted(): void {
@@ -65,7 +61,7 @@ export default class Login extends Vue {
6561
return;
6662
}
6763
68-
if (this.isUserNameOrPasswordEmpty) {
64+
if (this.isLoginInputValid) {
6965
this.invalidInputs = true;
7066
this.$snotify.error('Enter user name/password', 'Login Error');
7167
return;

0 commit comments

Comments
(0)

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