Skip to content

Commit

Permalink
Merge pull request #451 from ditrit/improvement/git_composable
Browse files Browse the repository at this point in the history
Improvement: Create Git composable
  • Loading branch information
Zorin95670 authored Nov 22, 2023
2 parents 9fb1e86 + 99278ab commit 64dbcbf
Show file tree
Hide file tree
Showing 44 changed files with 825 additions and 748 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Work with [githubator-plugin](https://github.com/ditrit/githubator-plugin/tree/0.3.0) version 0.3.0.
* Improve performance on git add.
* Replace OIDC authentication by Leto-Modelizer-Api, see [this issue](https://github.com/ditrit/leto-modelizer/issues/425).
* Separating git-related functions into a dedicated composable.

### Fixed

Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/RoundTrips/TextEditor.feature
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ Feature: Test roundtrip of the application: text editor

When I set on '[data-cy="rename-file-form"] [data-cy="name-input"]' text 'infra-rename'
And I click on '[data-cy="rename-file-form"] [data-cy="submit-button"]'
And I wait 2 seconds
Then I expect 'positive' toast to appear with text 'Folder is renamed.'
And I expect '[data-cy="file-explorer"] [data-cy="folder_infra-rename"]' exists
And I expect '[data-cy="file-explorer"] [data-cy="folder_infra"]' not exists
Expand Down
3 changes: 2 additions & 1 deletion src/components/FileExplorer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ import GitEvent from 'src/composables/events/GitEvent';
import FileExplorerActionButton from 'src/components/FileExplorerActionButton.vue';
import FileName from 'src/components/FileName.vue';
import { getTree, updateFileInformation } from 'src/composables/FileExplorer';
import { getProjectFiles, getStatus } from 'src/composables/Project';
import { getProjectFiles } from 'src/composables/Project';
import { getStatus } from 'src/composables/Git';
import { FileInformation } from 'leto-modelizer-plugin-core';
import FileStatus from 'src/models/git/FileStatus';
import { useRoute } from 'vue-router';
Expand Down
6 changes: 2 additions & 4 deletions src/components/NavigationBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,8 @@ import { useI18n } from 'vue-i18n';
import ModelizerSettingsMenu from 'components/menu/ModelizerSettingsMenu.vue';
import FileEvent from 'src/composables/events/FileEvent';
import { Notify } from 'quasar';
import {
getProjectById,
gitGlobalUpload,
} from 'src/composables/Project';
import { getProjectById } from 'src/composables/Project';
import { gitGlobalUpload } from 'src/composables/Git';
import GitEvent from 'src/composables/events/GitEvent';
import { useRoute, useRouter } from 'vue-router';
Expand Down
2 changes: 1 addition & 1 deletion src/components/card/GitBranchCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<script setup>
// TODO : Rename file
import { getCurrentBranch } from 'src/composables/Project';
import { getCurrentBranch } from 'src/composables/Git';
import { useRoute } from 'vue-router';
import { onMounted, onUnmounted, ref } from 'vue';
import GitEvent from 'src/composables/events/GitEvent';
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialog/GitCommitDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ import {
ref,
} from 'vue';
import DialogEvent from 'src/composables/events/DialogEvent';
import { getStatus } from 'src/composables/Project';
import { getStatus } from 'src/composables/Git';
import GitCommitForm from 'components/form/GitCommitForm.vue';
import GitEvent from 'src/composables/events/GitEvent';
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialog/GitLogDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
import { onMounted, onUnmounted, ref } from 'vue';
import DefaultDialog from 'components/dialog/DefaultDialog.vue';
import DialogEvent from 'src/composables/events/DialogEvent';
import { gitLog } from 'src/composables/Project';
import { gitLog } from 'src/composables/Git';
const props = defineProps({
projectName: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialog/GitStatusDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ import {
ref,
} from 'vue';
import DialogEvent from 'src/composables/events/DialogEvent';
import { getStatus } from 'src/composables/Project';
import { getStatus } from 'src/composables/Git';
const props = defineProps({
projectName: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/editor/MonacoEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import {
writeProjectFile,
readProjectFile,
exists,
getStatus,
} from 'src/composables/Project';
import { getStatus } from 'src/composables/Git';
import {
onBeforeMount,
onMounted,
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/CreateProjectTemplateForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ import {
isUnique,
} from 'src/composables/QuasarFieldRule';
import {
importProject,
appendProjectFile,
initProject,
getProjects,
} from 'src/composables/Project';
import { importProject } from 'src/composables/Git';
import { getTemplateFileByPath } from 'src/composables/TemplateManager';
import { FileInput } from 'leto-modelizer-plugin-core';
import PluginsCard from 'src/components/card/PluginsCard.vue';
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/GitAddRemoteForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ import {
import {
getProjectById,
saveProject,
gitAddRemote,
} from 'src/composables/Project';
import { gitAddRemote } from 'src/composables/Git';
import GitEvent from 'src/composables/events/GitEvent';
const emit = defineEmits(['project-git:save']);
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/GitCommitForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<script setup>
import { ref } from 'vue';
import { notEmpty } from 'src/composables/QuasarFieldRule';
import { gitCommit } from 'src/composables/Project';
import { gitCommit } from 'src/composables/Git';
import { useI18n } from 'vue-i18n';
import { Notify } from 'quasar';
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/GitNewBranchForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import {
getBranches,
createBranchFrom,
gitCheckout,
} from 'src/composables/Project';
} from 'src/composables/Git';
import { useI18n } from 'vue-i18n';
import { Notify } from 'quasar';
import GitEvent from 'src/composables/events/GitEvent';
Expand Down
3 changes: 2 additions & 1 deletion src/components/form/GitPushForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@

<script setup>
import { ref } from 'vue';
import { getProjectById, gitPush } from 'src/composables/Project';
import { getProjectById } from 'src/composables/Project';
import { gitPush } from 'src/composables/Git';
import { Notify } from 'quasar';
import { useI18n } from 'vue-i18n';
Expand Down
3 changes: 2 additions & 1 deletion src/components/form/GitUpdateForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@

<script setup>
import { ref } from 'vue';
import { getProjectById, gitUpdate } from 'src/composables/Project';
import { getProjectById } from 'src/composables/Project';
import { gitUpdate } from 'src/composables/Git';
import { Notify } from 'quasar';
import { useI18n } from 'vue-i18n';
import GitEvent from 'src/composables/events/GitEvent';
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/ImportProjectForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ import {
isUnique,
} from 'src/composables/QuasarFieldRule';
import {
importProject,
getProjects,
deleteProjectById,
extractProjectName,
} from 'src/composables/Project';
import { importProject } from 'src/composables/Git';
const emit = defineEmits(['project:import']);
Expand Down
3 changes: 2 additions & 1 deletion src/components/form/RenameFileForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
import { useI18n } from 'vue-i18n';
import { onMounted, ref } from 'vue';
import { notEmpty, isValidFileLabel, isUnique } from 'src/composables/QuasarFieldRule';
import { gitRemove, readDir, rename } from 'src/composables/Project';
import { readDir, rename } from 'src/composables/Project';
import { gitRemove } from 'src/composables/Git';
import { Notify } from 'quasar';
import FileEvent from 'src/composables/events/FileEvent';
Expand Down
2 changes: 1 addition & 1 deletion src/components/menu/FileExplorerActionMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

<script setup>
import { computed, ref } from 'vue';
import { getStatus, gitAdd } from 'src/composables/Project';
import { getStatus, gitAdd } from 'src/composables/Git';
import { Notify } from 'quasar';
import { useI18n } from 'vue-i18n';
import DialogEvent from 'src/composables/events/DialogEvent';
Expand Down
2 changes: 1 addition & 1 deletion src/components/menu/GitBranchActionMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<script setup>
import { ref } from 'vue';
import { gitCheckout } from 'src/composables/Project';
import { gitCheckout } from 'src/composables/Git';
import { useRoute } from 'vue-router';
import DialogEvent from 'src/composables/events/DialogEvent';
import GitEvent from 'src/composables/events/GitEvent';
Expand Down
4 changes: 2 additions & 2 deletions src/components/menu/GitBranchMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ import {
ref,
} from 'vue';
import { useRoute } from 'vue-router';
import { getProjectById } from 'src/composables/Project';
import {
getBranches,
gitFetch,
getProjectById,
} from 'src/composables/Project';
} from 'src/composables/Git';
import GitBranchExpandListMenu from 'components/menu/GitBranchExpandListMenu.vue';
import DialogEvent from 'src/composables/events/DialogEvent';
import { searchText } from 'src/composables/Filter';
Expand Down
3 changes: 2 additions & 1 deletion src/components/tab/FileTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ import {
import FileTabHeader from 'src/components/tab/FileTabHeader.vue';
import FileEvent from 'src/composables/events/FileEvent';
import GitEvent from 'src/composables/events/GitEvent';
import { exists, getStatus } from 'src/composables/Project';
import { exists } from 'src/composables/Project';
import { getStatus } from 'src/composables/Git';
const props = defineProps({
projectName: {
Expand Down
Loading

0 comments on commit 64dbcbf

Please sign in to comment.