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/organizations/shared/utils.js')
-rw-r--r--app/assets/javascripts/organizations/shared/utils.js35
1 files changed, 22 insertions, 13 deletions
diff --git a/app/assets/javascripts/organizations/shared/utils.js b/app/assets/javascripts/organizations/shared/utils.js
index c1aafefc553..fd172f09ec9 100644
--- a/app/assets/javascripts/organizations/shared/utils.js
+++ b/app/assets/javascripts/organizations/shared/utils.js
@@ -2,19 +2,28 @@ import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import { ACTION_EDIT, ACTION_DELETE } from '~/vue_shared/components/list_actions/constants';
export const formatProjects = (projects) =>
- projects.map(({ id, nameWithNamespace, accessLevel, webUrl, ...project }) => ({
- ...project,
- id: getIdFromGraphQLId(id),
- name: nameWithNamespace,
- permissions: {
- projectAccess: {
- accessLevel: accessLevel.integerValue,
- },
- },
- webUrl,
- editPath: `${webUrl}/edit`,
- availableActions: [ACTION_EDIT, ACTION_DELETE],
- }));
+ projects.map(
+ ({
+ id,
+ nameWithNamespace,
+ mergeRequestsAccessLevel,
+ issuesAccessLevel,
+ forkingAccessLevel,
+ webUrl,
+ ...project
+ }) => ({
+ ...project,
+ id: getIdFromGraphQLId(id),
+ name: nameWithNamespace,
+ mergeRequestsAccessLevel: mergeRequestsAccessLevel.stringValue,
+ issuesAccessLevel: issuesAccessLevel.stringValue,
+ forkingAccessLevel: forkingAccessLevel.stringValue,
+ webUrl,
+ isForked: false,
+ editPath: `${webUrl}/edit`,
+ availableActions: [ACTION_EDIT, ACTION_DELETE],
+ }),
+ );
export const formatGroups = (groups) =>
groups.map(({ id, webUrl, ...group }) => ({