Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reorganized components #562

Merged
merged 11 commits into from
Oct 11, 2023
2 changes: 1 addition & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue from 'vue';
import Vuetify from 'vuetify';
import { options } from '@/plugins/vuetify';
import { options } from '~plugins/vuetify';
import 'vuetify/dist/vuetify.min.css';
import './storybook.css';

Expand Down
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</template>

<script>
import TheHeader from '@/components/TheHeader.vue';
import TheFooter from '@/components/TheFooter.vue';
import TheHeader from '~core/components/TheHeader.vue';
import TheFooter from '~core/components/TheFooter.vue';

export default {
components: {
Expand Down
arnaut08 marked this conversation as resolved.
Show resolved Hide resolved
File renamed without changes.
File renamed without changes.
File renamed without changes.
arnaut08 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
</template>

<script>
import BaseDialog from '@/components/Global/BaseDialog.vue';
import BaseDialog from '~core/components/BaseDialog.vue';

export default {
name: 'RulesDialog',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
</template>

<script>
import BaseDialog from '@/components/Global/BaseDialog.vue';
import AwardCard from '@/components/AwardCard.vue';
import BaseDialog from '~core/components/BaseDialog.vue';
import AwardCard from '~core/components/AwardCard.vue';

export default {
name: 'StatsScoringDialog',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</template>

<script setup>
import { getPageLinks } from '@/composables/navLink.js';
import { getPageLinks } from '~core/composables/navLink.js';

const pageLinks = getPageLinks();
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
</template>

<script setup>
import { getPageLinks } from '@/composables/navLink.js';
import TheUserMenu from './TheUserMenu.vue';
import { getPageLinks } from '~core/composables/navLink.js';
import TheUserMenu from '~core/components/TheUserMenu.vue';
import { useDisplay } from 'vuetify';

const { mobile } = useDisplay();
Expand Down
File renamed without changes.
arnaut08 marked this conversation as resolved.
Show resolved Hide resolved
File renamed without changes.
arnaut08 marked this conversation as resolved.
Show resolved Hide resolved
File renamed without changes.
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createApp } from 'vue';

import vuetify from '@/plugins/vuetify';
import vuetify from '~plugins/vuetify';
import router from '@/router';
import store from '@/store/store';
import store from '~store/store';
import i18n from '@/i18n';
import { initCuttleGlobals } from '_/utils/config-utils';

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/sails.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import sails from 'sails.io.js';
import socketIoClient from 'socket.io-client';
import { handleInGameEvents } from './sockets/inGameEvents';
import { handleInGameEvents } from '~plugins/sockets/inGameEvents';
import {
handleGameStarted,
handleGameCreated,
handleGameFinished,
handleJoin,
handleLeftGame,
} from './sockets/gameListEvents';
import { handleConnect } from './sockets/connectivityEvents';
} from '~plugins/sockets/gameListEvents';
import { handleConnect } from '~plugins/sockets/connectivityEvents';

export const io = sails(socketIoClient);

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/sockets/connectivityEvents.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import store from '@/store/store.js';
import store from '~store/store.js';
import router from '@/router.js';
import { ROUTE_NAME_GAME, ROUTE_NAME_SPECTATE, ROUTE_NAME_HOME } from '@/router';

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/sockets/gameListEvents.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import store from '@/store/store.js';
import store from '~store/store.js';
import { cloneDeep } from 'lodash';

export function handleGameCreated(evData) {
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/sockets/inGameEvents.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import store from '@/store/store.js';
import store from '~store/store.js';
import router from '@/router.js';
import { ROUTE_NAME_GAME, ROUTE_NAME_SPECTATE, ROUTE_NAME_LOBBY } from '@/router';
import SocketEvent from '../../../types/SocketEvent';
import SocketEvent from '_/types/SocketEvent';

// Handles socket updates of game data
export async function handleInGameEvents(evData) {
Expand Down
28 changes: 10 additions & 18 deletions src/router.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import { createRouter, createWebHashHistory } from 'vue-router';


import HomeView from '@/views/HomeView.vue';
import LoginView from '@/views/LoginView.vue';
import LobbyView from '@/views/LobbyView.vue';
import GameView from '@/views/GameView.vue';
import RulesView from '@/views/RulesView.vue';
import StatsView from '@/views/StatsView.vue';
import store from '@/store/store.js';
import store from '~store/store.js';

export const ROUTE_NAME_GAME = 'Game';
export const ROUTE_NAME_SPECTATE = 'Spectate';
Expand Down Expand Up @@ -40,18 +32,18 @@ const routes = [
{
path: '/',
name: 'Home',
component: HomeView,
component: () => import('@/routes/home/HomeView.vue'),
arnaut08 marked this conversation as resolved.
Show resolved Hide resolved
beforeEnter: mustBeAuthenticated,
},
{
path: '/login',
name: ROUTE_NAME_LOGIN,
component: LoginView,
component: () => import('@/routes/auth/LoginView.vue'),
},
{
path: '/signup',
name: ROUTE_NAME_SIGNUP,
component: LoginView,
component: () => import('@/routes/auth/LoginView.vue'),
},
// This route is just a passthrough to make sure the user is fully logged out before putting
// them on the login screen
Expand All @@ -63,12 +55,12 @@ const routes = [
{
path: '/rules',
name: ROUTE_NAME_RULES,
component: RulesView,
component: () => import('@/routes/rules/RulesView.vue'),
},
{
name: ROUTE_NAME_LOBBY,
path: '/lobby/:gameId',
component: LobbyView,
component: () => import('@/routes/lobby/LobbyView.vue'),
// TODO: Add logic to redirect if a given game does not exist
beforeEnter: mustBeAuthenticated,
meta: {
Expand All @@ -78,7 +70,7 @@ const routes = [
{
name: ROUTE_NAME_GAME,
path: '/game/:gameId',
component: GameView,
component: () => import('@/routes/game/GameView.vue'),
// TODO: Add logic to redirect if a given game does not exist
// mustBeAuthenticated intentionally left off here
// If a user refreshes the relogin modal will fire and allow them to continue playing
Expand All @@ -89,21 +81,21 @@ const routes = [
{
name: ROUTE_NAME_SPECTATE,
path: '/spectate/:gameId',
component: GameView,
component: () => import('@/routes/game/GameView.vue'),
meta: {
hideNavigation: true,
},
},
{
path: '/stats',
name: ROUTE_NAME_STATS,
component: StatsView,
component: () => import('@/routes/stats/StatsView.vue'),
beforeEnter: mustBeAuthenticated,
},
{
path: '/stats/:seasonId',
name: ROUTE_NAME_STATS_SEASON,
component: StatsView,
component: () => import('@/routes/stats/StatsView.vue'),
beforeEnter: mustBeAuthenticated,
},
];
Expand Down
6 changes: 3 additions & 3 deletions src/views/LoginView.vue → src/routes/auth/LoginView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@
import { useI18n } from 'vue-i18n';

import { ROUTE_NAME_LOGIN, ROUTE_NAME_SIGNUP } from '@/router';
import BaseSnackbar from '@/components/Global/BaseSnackbar.vue';
import MarkdownContent from '@/components/Global/MarkdownContent.vue';
import BaseVideo from '../components/Global/BaseVideo.vue';
import BaseSnackbar from '~core/components/BaseSnackbar.vue';
import MarkdownContent from '~core/components/MarkdownContent.vue';
import BaseVideo from '~core/components/BaseVideo.vue';

export default {
name: 'LoginView',
Expand Down
22 changes: 11 additions & 11 deletions src/views/GameView.vue → src/routes/game/GameView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -396,17 +396,17 @@
import { mapGetters, mapState } from 'vuex';

import { ROUTE_NAME_HOME, ROUTE_NAME_SPECTATE } from '@/router';
import GameCard from '@/components/GameView/GameCard.vue';
import GameDialogs from '@/components/GameView/GameDialogs.vue';
import GameMenu from '@/components/GameView/GameMenu.vue';
import GameOverlays from '@/components/GameView/GameOverlays.vue';
import ScoreGoalToolTip from '@/components/GameView/ScoreGoalToolTip.vue';
import GameUnavailableView from '../components/GameView/GameUnavailableView.vue';
import TargetSelectionOverlay from '@/components/GameView/TargetSelectionOverlay.vue';
import ScrapDialog from '@/components/GameView/ScrapDialog.vue';
import UsernameToolTip from '@/components/GameView/UsernameToolTip.vue';
import BaseSnackbar from '@/components/Global/BaseSnackbar.vue';
import SpectatorListMenu from '../components/GameView/SpectatorListMenu.vue';
import BaseSnackbar from '~core/components/BaseSnackbar.vue';
import UsernameToolTip from '~core/components/UsernameToolTip.vue';
import GameCard from '~routes/game/components/GameCard.vue';
import GameDialogs from '~routes/game/components/GameDialogs.vue';
import GameMenu from '~routes/game/components/GameMenu.vue';
import GameOverlays from '~routes/game/components/GameOverlays.vue';
import ScoreGoalToolTip from '~routes/game/components/ScoreGoalToolTip.vue';
import GameUnavailableView from '~routes/game/components/GameUnavailableView.vue';
import TargetSelectionOverlay from '~routes/game/components/TargetSelectionOverlay.vue';
import ScrapDialog from '~routes/game/components/ScrapDialog.vue';
import SpectatorListMenu from '~routes/game/components/SpectatorListMenu.vue';

export default {
name: 'GameView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
</template>

<script>
import BaseDialog from '@/components/Global/BaseDialog.vue';
import GameCard from '@/components/GameView/GameCard.vue';
import GameCardName from '@/components/GameView/GameCardName.vue';
import BaseDialog from '~core/components/BaseDialog.vue';
import GameCard from '~routes/game/components/GameCard.vue';
import GameCardName from '~routes/game/components/GameCardName.vue';

export default {
name: 'CannotCounterDialog',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</template>

<script>
import GameCard from '@/components/GameView/GameCard.vue';
import GameCard from '~routes/game/components/GameCard.vue';
import { orderBy } from 'lodash';

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
</template>

<script>
import GameCard from '@/components/GameView/GameCard.vue';
import BaseDialog from '@/components/Global/BaseDialog.vue';
import GameCard from '~routes/game/components/GameCard.vue';
import BaseDialog from '~core/components/BaseDialog.vue';

export default {
name: 'ChooseTwoDialog',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
</template>

<script>
import BaseDialog from '@/components/Global/BaseDialog.vue';
import GameCard from '@/components/GameView/GameCard.vue';
import GameCardName from '@/components/GameView/GameCardName.vue';
import BaseDialog from '~core/components/BaseDialog.vue';
import GameCard from '~routes/game/components/GameCard.vue';
import GameCardName from '~routes/game/components/GameCardName.vue';

export default {
name: 'ChooseWhetherToCounterDialog',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
</template>

<script>
import ChooseWhetherToCounterDialog from './ChooseWhetherToCounterDialog.vue';
import ChooseTwoDialog from './ChooseTwoDialog.vue';
import ChooseWhetherToCounterDialog from '~routes/game/components/ChooseWhetherToCounterDialog.vue';
import ChooseTwoDialog from '~routes/game/components/ChooseTwoDialog.vue';

export default {
name: 'CounterDialog',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
</template>

<script>
import BaseDialog from '@/components/Global/BaseDialog.vue';
import GameCard from '@/components/GameView/GameCard.vue';
import BaseDialog from '~core/components/BaseDialog.vue';
import GameCard from '~routes/game/components/GameCard.vue';

export default {
name: 'FourDialog',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@
import { mapGetters } from 'vuex';
import { mapState } from 'vuex';

import CannotCounterDialog from '@/components/GameView/CannotCounterDialog.vue';
import CounterDialog from '@/components/GameView/CounterDialog.vue';
import FourDialog from '@/components/GameView/FourDialog.vue';
import GameOverDialog from '@/components/GameView/GameOverDialog.vue';
import ReauthenticateDialog from '@/components/GameView/ReauthenticateDialog.vue';
import SevenDoubleJacksDialog from '@/components/GameView/SevenDoubleJacksDialog.vue';
import ThreeDialog from '@/components/GameView/ThreeDialog.vue';
import OpponentRequestedStalemateDialog from './OpponentRequestedStalemateDialog.vue';
import CannotCounterDialog from '~routes/game/components/CannotCounterDialog.vue';
import CounterDialog from '~routes/game/components/CounterDialog.vue';
import FourDialog from '~routes/game/components/FourDialog.vue';
import GameOverDialog from '~routes/game/components/GameOverDialog.vue';
import ReauthenticateDialog from '~routes/game/components/ReauthenticateDialog.vue';
import SevenDoubleJacksDialog from '~routes/game/components/SevenDoubleJacksDialog.vue';
import ThreeDialog from '~routes/game/components/ThreeDialog.vue';
import OpponentRequestedStalemateDialog from '~routes/game/components/OpponentRequestedStalemateDialog.vue';

export default {
name: 'GameDialogs',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
</template>

<script>
import BaseDialog from '@/components/Global/BaseDialog.vue';
import RulesDialog from '@/components/RulesDialog.vue';
import BaseDialog from '~core/components/BaseDialog.vue';
import RulesDialog from '~core/components/RulesDialog.vue';
export default {
name: 'GameMenu',
components: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@

<script>
import { mapGetters, mapState } from 'vuex';
import BaseDialog from '@/components/Global/BaseDialog.vue';
import GameStatus from '../../../utils/GameStatus.json';
import BaseDialog from '~core/components/BaseDialog.vue';
import GameStatus from '_/utils/GameStatus.json';

export default {
name: 'GameOverDialog',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@
<script>
import { mapGetters, mapState } from 'vuex';

import MoveChoiceOverlay from '@/components/GameView/MoveChoiceOverlay.vue';
import GameCard from '@/components/GameView/GameCard.vue';
import MoveChoiceOverlay from '~routes/game/components/MoveChoiceOverlay.vue';
import GameCard from '~routes/game/components/GameCard.vue';

export default {
name: 'GameOverlays',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
</template>

<script>
import ReauthenticateDialog from '@/components/GameView/ReauthenticateDialog.vue';
import GameUnavailableOverlay from './GameUnavailableOverlay.vue';
import ReauthenticateDialog from '~routes/game/components/ReauthenticateDialog.vue';
import GameUnavailableOverlay from '~routes/game/components/GameUnavailableOverlay.vue';

export default {
name: 'GameUnavailable',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
</template>

<script>
import MoveChoiceCard from '@/components/GameView/MoveChoiceCard.vue';
import GameCard from '@/components/GameView/GameCard.vue';
import MoveChoiceCard from '~routes/game/components/MoveChoiceCard.vue';
import GameCard from '~routes/game/components/GameCard.vue';

export default {
name: 'MoveChoiceOverlay',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</template>

<script>
import BaseDialog from '@/components/Global/BaseDialog.vue';
import BaseDialog from '~core/components/BaseDialog.vue';

export default {
name: 'OpponentRequestedStalemateDialog',
Expand Down
Loading