diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-17 21:09:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-17 21:09:52 +0300 |
commit | 003efb27fc4d7d0571979553c602fccfbf5ad0c2 (patch) | |
tree | 721ec9af57108c73fc5c4c7a06e996800ead367e /app/assets/javascripts/organizations/shared/utils.js | |
parent | 78a5f872de316860ccd7a983c10805bf6c6b771c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/organizations/shared/utils.js')
-rw-r--r-- | app/assets/javascripts/organizations/shared/utils.js | 35 |
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 }) => ({ |