Skip to content

Commit

Permalink
feat(state): change state file names
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichel committed Jan 29, 2021
1 parent fb2b95b commit f76c4ea
Show file tree
Hide file tree
Showing 19 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</template>

<script>
import { useLoadingContext } from '@/state/loadingState';
import { useLoadingContext } from '@/state/loading';
// Components
import BIMDataSpinner from "@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataSpinner.js";
import PlatformHeader from '@/components/platform-header/PlatformHeader';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<script>
import { ref } from 'vue';
import { useGlobalState } from '@/state/globalState';
import { useGlobalState } from '@/state/global';
export default {
setup() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/recent-spaces-list/RecentSpacesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<script>
import { ref, watchEffect } from 'vue';
import { useSpacesState } from '@/state/spacesState';
import { useSpaces } from '@/state/spaces';
// Components
import SpaceCard from '@/components/space-card/SpaceCard';
Expand All @@ -21,7 +21,7 @@ export default {
SpaceCard
},
setup() {
const { spaces } = useSpacesState();
const { spaces } = useSpaces();
const recentSpaces = ref([]);
Expand Down
6 changes: 3 additions & 3 deletions src/components/space-action-menu/SpaceActionMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@

<script>
import { ref } from 'vue';
import { createLoadingContext } from '@/state/loadingState'
import { useSpacesState } from '@/state/spacesState';
import { createLoadingContext } from '@/state/loading'
import { useSpaces } from '@/state/spaces';
// Components
import BIMDataButton from '@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataButton.js';
import BIMDataIcon from '@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataIcon.js';
Expand All @@ -82,7 +82,7 @@ export default {
}
},
setup(props) {
const { removeSpaceImage } = useSpacesState();
const { removeSpaceImage } = useSpaces();
const loading = createLoadingContext(`space-action-${props.space.id}`);
Expand Down
4 changes: 2 additions & 2 deletions src/components/space-creation-card/SpaceCreationCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<script>
import { onMounted, reactive, ref } from 'vue';
import { useSpacesState } from '@/state/spacesState';
import { useSpaces } from '@/state/spaces';
// Components
import BIMDataCard from '@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataCard.js';
import BIMDataButton from '@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataButton.js';
Expand All @@ -52,7 +52,7 @@ export default {
'close'
],
setup(props, { emit }) {
const { createSpace: create } = useSpacesState();
const { createSpace: create } = useSpaces();
const loading = ref(false);
const nameInput = ref(null);
Expand Down
6 changes: 3 additions & 3 deletions src/components/space-delete-guard/SpaceDeleteGuard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
</template>

<script>
import { useLoadingContext } from '@/state/loadingState';
import { useSpacesState } from '@/state/spacesState';
import { useLoadingContext } from '@/state/loading';
import { useSpaces } from '@/state/spaces';
// Components
import BIMDataButton from '@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataButton.js';
import BIMDataIcon from '@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataIcon.js';
Expand All @@ -41,7 +41,7 @@ export default {
'close'
],
setup(props, { emit }) {
const { deleteSpace } = useSpacesState();
const { deleteSpace } = useSpaces();
const loading = useLoadingContext(`space-action-${props.space.id}`);
Expand Down
8 changes: 4 additions & 4 deletions src/components/space-image-input/SpaceImageInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
import Uppy from '@uppy/core';
import XHRUpload from '@uppy/xhr-upload';
import { ref } from 'vue';
import { useGlobalState } from '@/state/globalState';
import { useLoadingContext } from '@/state/loadingState';
import { useSpacesState } from '@/state/spacesState';
import { useGlobalState } from '@/state/global';
import { useLoadingContext } from '@/state/loading';
import { useSpaces } from '@/state/spaces';
// Components
import BIMDataButton from '@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataButton.js';
Expand All @@ -35,7 +35,7 @@ export default {
],
setup(props, { emit }) {
const { user } = useGlobalState();
const { softUpdateSpace } = useSpacesState();
const { softUpdateSpace } = useSpaces();
const loading = useLoadingContext(`space-action-${props.space.id}`);
Expand Down
6 changes: 3 additions & 3 deletions src/components/space-update-form/SpaceUpdateForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

<script>
import { onMounted, ref } from 'vue';
import { useLoadingContext } from '@/state/loadingState';
import { useSpacesState } from '@/state/spacesState';
import { useLoadingContext } from '@/state/loading';
import { useSpaces } from '@/state/spaces';
// Components
import BIMDataButton from '@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataButton.js';
import BIMDataIcon from '@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataIcon.js';
Expand All @@ -48,7 +48,7 @@ export default {
'error',
],
setup(props, { emit }) {
const { updateSpace } = useSpacesState();
const { updateSpace } = useSpaces();
const loading = useLoadingContext(`space-action-${props.space.id}`);
Expand Down
2 changes: 1 addition & 1 deletion src/components/user-menu/UserMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<script>
import { computed, ref } from 'vue';
import { useGlobalState } from '@/state/globalState';
import { useGlobalState } from '@/state/global';
// Components
import BIMDataButton from '@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataButton.js';
import BIMDataIcon from '@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataIcon.js';
Expand Down
2 changes: 1 addition & 1 deletion src/router/guards.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useGlobalState } from '@/state/globalState';
import { useGlobalState } from '@/state/global';

const authGuard = async (to, from, next) => {
const { isAuthenticated, authenticate } = useGlobalState();
Expand Down
14 changes: 7 additions & 7 deletions src/router/resolvers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useLoadingContext } from '@/state/loadingState';
import { useProjectsState } from '@/state/projectsState';
import { useSpacesState } from '@/state/spacesState';
import { useLoadingContext } from '@/state/loading';
import { useProjects } from '@/state/projects';
import { useSpaces } from '@/state/spaces';

const createViewResolver = (resolver) => {
return (route) => {
Expand All @@ -13,17 +13,17 @@ const createViewResolver = (resolver) => {
};

const dashboardResolver = createViewResolver(
() => useSpacesState().fetchSpaces()
() => useSpaces().fetchSpaces()
);

const spacesResolver = createViewResolver(
() => useSpacesState().fetchSpaces()
() => useSpaces().fetchSpaces()
);

const projectsResolver = createViewResolver(
(route) => {
const { currentSpace, fetchSpaces, selectSpace } = useSpacesState();
const { fetchProjects } = useProjectsState();
const { currentSpace, fetchSpaces, selectSpace } = useSpaces();
const { fetchProjects } = useProjects();

return fetchSpaces()
.then(() => selectSpace(+route.params.spaceID))
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/state/projectsState.js → src/state/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const selectProject = (id) => {
return state.currentProject;
};

export function useProjectsState() {
export function useProjects() {
const readonlyState = readonly(state);
return {
...toRefs(readonlyState),
Expand Down
2 changes: 1 addition & 1 deletion src/state/spacesState.js → src/state/spaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const selectSpace = (id) => {
return state.currentSpace;
};

export function useSpacesState() {
export function useSpaces() {
const readonlyState = readonly(state);
return {
...toRefs(readonlyState),
Expand Down
4 changes: 2 additions & 2 deletions src/views/dashboard/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<script>
import { ref, watchEffect } from 'vue';
import { useRouter } from 'vue-router';
import { useSpacesState } from '@/state/spacesState';
import { useSpaces } from '@/state/spaces';
// Components
import DashboardButtonTile from '@/components/dashboard-button-tile/DashboardButtonTile';
import DashboardInfoTile from '@/components/dashboard-info-tile/DashboardInfoTile';
Expand All @@ -39,7 +39,7 @@ export default {
},
setup() {
const router = useRouter();
const { spaces } = useSpacesState();
const { spaces } = useSpaces();
const nbSpaces = ref(0);
watchEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/views/oidc-callback/OidcCallback.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script>
import { onMounted } from 'vue';
import { useRouter } from 'vue-router';
import { useGlobalState } from '@/state/globalState';
import { useGlobalState } from '@/state/global';
// Components
import BIMDataBigSpinner from '@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataBigSpinner.js';
Expand Down
4 changes: 2 additions & 2 deletions src/views/projects/Projects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</template>

<script>
import { useProjectsState } from '@/state/projectsState';
import { useProjects } from '@/state/projects';
// Components
import GoBackButton from '@/components/go-back-button/GoBackButton';
import ProjectCard from '@/components/project-card/ProjectCard';
Expand All @@ -39,7 +39,7 @@ export default {
ProjectCreationCard,
},
setup() {
const { projects } = useProjectsState();
const { projects } = useProjects();
return {
// References
Expand Down
4 changes: 2 additions & 2 deletions src/views/spaces/Spaces.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<script>
import { ref, watchEffect } from 'vue';
import { useSpacesState } from '@/state/spacesState';
import { useSpaces } from '@/state/spaces';
// Components
import BIMDataButton from '@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataButton.js';
import BIMDataIcon from '@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataIcon.js';
Expand All @@ -60,7 +60,7 @@ export default {
SpaceCreationCard,
},
setup() {
const { spaces } = useSpacesState();
const { spaces } = useSpaces();
const displayedSpaces = ref([]);
watchEffect(
Expand Down

0 comments on commit f76c4ea

Please sign in to comment.