Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/repository/components/tree_content.vue')
-rw-r--r--app/assets/javascripts/repository/components/tree_content.vue17
1 files changed, 8 insertions, 9 deletions
diff --git a/app/assets/javascripts/repository/components/tree_content.vue b/app/assets/javascripts/repository/components/tree_content.vue
index 336237abd8a..794a8a85cc5 100644
--- a/app/assets/javascripts/repository/components/tree_content.vue
+++ b/app/assets/javascripts/repository/components/tree_content.vue
@@ -1,17 +1,14 @@
<script>
import filesQuery from 'shared_queries/repository/files.query.graphql';
-import { deprecatedCreateFlash as createFlash } from '~/flash';
+import createFlash from '~/flash';
import { __ } from '../../locale';
+import { TREE_PAGE_SIZE, TREE_INITIAL_FETCH_COUNT } from '../constants';
import getRefMixin from '../mixins/get_ref';
import projectPathQuery from '../queries/project_path.query.graphql';
import { readmeFile } from '../utils/readme';
import FilePreview from './preview/index.vue';
import FileTable from './table/index.vue';
-const LIMIT = 1000;
-const PAGE_SIZE = 100;
-export const INITIAL_FETCH_COUNT = LIMIT / PAGE_SIZE;
-
export default {
components: {
FileTable,
@@ -47,7 +44,7 @@ export default {
isLoadingFiles: false,
isOverLimit: false,
clickedShowMore: false,
- pageSize: PAGE_SIZE,
+ pageSize: TREE_PAGE_SIZE,
fetchCounter: 0,
};
},
@@ -56,7 +53,7 @@ export default {
return readmeFile(this.entries.blobs);
},
hasShowMore() {
- return !this.clickedShowMore && this.fetchCounter === INITIAL_FETCH_COUNT;
+ return !this.clickedShowMore && this.fetchCounter === TREE_INITIAL_FETCH_COUNT;
},
},
@@ -107,14 +104,16 @@ export default {
if (pageInfo?.hasNextPage) {
this.nextPageCursor = pageInfo.endCursor;
this.fetchCounter += 1;
- if (this.fetchCounter < INITIAL_FETCH_COUNT || this.clickedShowMore) {
+ if (this.fetchCounter < TREE_INITIAL_FETCH_COUNT || this.clickedShowMore) {
this.fetchFiles();
this.clickedShowMore = false;
}
}
})
.catch((error) => {
- createFlash(__('An error occurred while fetching folder content.'));
+ createFlash({
+ message: __('An error occurred while fetching folder content.'),
+ });
throw error;
});
},