Skip to content
Snippets Groups Projects
Commit 82fa8a3d authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 232655bf
No related branches found
No related tags found
No related merge requests found
Showing
with 256 additions and 35 deletions
Loading
Loading
@@ -10,6 +10,11 @@ import {
} from '@gitlab/ui';
 
import httpStatusCodes from '~/lib/utils/http_status';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import projectQuery from '../queries/project_boards.query.graphql';
import groupQuery from '../queries/group_boards.query.graphql';
import boardsStore from '../stores/boards_store';
import BoardForm from './board_form.vue';
 
Loading
Loading
@@ -88,8 +93,9 @@ export default {
},
data() {
return {
loading: true,
hasScrollFade: false,
loadingBoards: 0,
loadingRecentBoards: false,
scrollFadeInitialized: false,
boards: [],
recentBoards: [],
Loading
Loading
@@ -102,6 +108,12 @@ export default {
};
},
computed: {
parentType() {
return this.groupId ? 'group' : 'project';
},
loading() {
return this.loadingRecentBoards && this.loadingBoards;
},
currentPage() {
return this.state.currentPage;
},
Loading
Loading
@@ -147,49 +159,71 @@ export default {
return;
}
 
const recentBoardsPromise = new Promise((resolve, reject) =>
boardsStore
.recentBoards()
.then(resolve)
.catch(err => {
/**
* If user is unauthorized we'd still want to resolve the
* request to display all boards.
*/
if (err.response.status === httpStatusCodes.UNAUTHORIZED) {
resolve({ data: [] }); // recent boards are empty
return;
}
reject(err);
}),
);
this.$apollo.addSmartQuery('boards', {
variables() {
return { fullPath: this.state.endpoints.fullPath };
},
query() {
return this.groupId ? groupQuery : projectQuery;
},
loadingKey: 'loadingBoards',
update(data) {
if (!data?.[this.parentType]) {
return [];
}
return data[this.parentType].boards.edges.map(({ node }) => ({
id: getIdFromGraphQLId(node.id),
name: node.name,
}));
},
});
 
Promise.all([boardsStore.allBoards(), recentBoardsPromise])
.then(([allBoards, recentBoards]) => [allBoards.data, recentBoards.data])
.then(([allBoardsJson, recentBoardsJson]) => {
this.loading = false;
this.boards = allBoardsJson;
this.recentBoards = recentBoardsJson;
this.loadingRecentBoards = true;
boardsStore
.recentBoards()
.then(res => {
this.recentBoards = res.data;
})
.catch(err => {
/**
* If user is unauthorized we'd still want to resolve the
* request to display all boards.
*/
if (err?.response?.status === httpStatusCodes.UNAUTHORIZED) {
this.recentBoards = []; // recent boards are empty
return;
}
throw err;
})
.then(() => this.$nextTick()) // Wait for boards list in DOM
.then(() => {
this.setScrollFade();
})
.catch(() => {
this.loading = false;
.catch(() => {})
.finally(() => {
this.loadingRecentBoards = false;
});
},
isScrolledUp() {
const { content } = this.$refs;
if (!content) {
return false;
}
const currentPosition = this.contentClientHeight + content.scrollTop;
 
return content && currentPosition < this.maxPosition;
return currentPosition < this.maxPosition;
},
initScrollFade() {
this.scrollFadeInitialized = true;
const { content } = this.$refs;
 
if (!content) {
return;
}
this.scrollFadeInitialized = true;
this.contentClientHeight = content.clientHeight;
this.maxPosition = content.scrollHeight;
},
Loading
Loading
Loading
Loading
@@ -98,6 +98,7 @@ export default () => {
listsEndpoint: this.listsEndpoint,
bulkUpdatePath: this.bulkUpdatePath,
boardId: this.boardId,
fullPath: $boardApp.dataset.fullPath,
});
boardsStore.rootPath = this.boardsEndpoint;
 
Loading
Loading
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import { parseBoolean } from '~/lib/utils/common_utils';
import BoardsSelector from '~/boards/components/boards_selector.vue';
 
Vue.use(VueApollo);
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
});
export default () => {
const boardsSwitcherElement = document.getElementById('js-multiple-boards-switcher');
return new Vue({
Loading
Loading
@@ -9,6 +17,7 @@ export default () => {
components: {
BoardsSelector,
},
apolloProvider,
data() {
const { dataset } = boardsSwitcherElement;
 
Loading
Loading
fragment BoardFragment on Board {
id,
name
}
#import "ee_else_ce/boards/queries/board.fragment.graphql"
query group_boards($fullPath: ID!) {
group(fullPath: $fullPath) {
boards {
edges {
node {
...BoardFragment
}
}
}
}
}
#import "ee_else_ce/boards/queries/board.fragment.graphql"
query project_boards($fullPath: ID!) {
project(fullPath: $fullPath) {
boards {
edges {
node {
...BoardFragment
}
}
}
}
}
Loading
Loading
@@ -45,7 +45,14 @@ const boardsStore = {
},
multiSelect: { list: [] },
 
setEndpoints({ boardsEndpoint, listsEndpoint, bulkUpdatePath, boardId, recentBoardsEndpoint }) {
setEndpoints({
boardsEndpoint,
listsEndpoint,
bulkUpdatePath,
boardId,
recentBoardsEndpoint,
fullPath,
}) {
const listsEndpointGenerate = `${listsEndpoint}/generate.json`;
this.state.endpoints = {
boardsEndpoint,
Loading
Loading
@@ -53,6 +60,7 @@ const boardsStore = {
listsEndpoint,
listsEndpointGenerate,
bulkUpdatePath,
fullPath,
recentBoardsEndpoint: `${recentBoardsEndpoint}.json`,
};
},
Loading
Loading
@@ -542,10 +550,6 @@ const boardsStore = {
return axios.post(endpoint);
},
 
allBoards() {
return axios.get(this.generateBoardsPath());
},
recentBoards() {
return axios.get(this.state.endpoints.recentBoardsEndpoint);
},
Loading
Loading
Loading
Loading
@@ -165,6 +165,16 @@ export default {
showContainerRegistryPublicNote() {
return this.visibilityLevel === visibilityOptions.PUBLIC;
},
repositoryHelpText() {
if (this.visibilityLevel === visibilityOptions.PRIVATE) {
return s__('ProjectSettings|View and edit files in this project');
}
return s__(
'ProjectSettings|View and edit files in this project. Non-project members will only have read access',
);
},
},
 
watch: {
Loading
Loading
@@ -225,6 +235,7 @@ export default {
<div>
<div class="project-visibility-setting">
<project-setting-row
ref="project-visibility-settings"
:help-path="visibilityHelpPath"
:label="s__('ProjectSettings|Project visibility')"
>
Loading
Loading
@@ -270,6 +281,7 @@ export default {
</div>
<div :class="{ 'highlight-changes': highlightChangesClass }" class="project-feature-settings">
<project-setting-row
ref="issues-settings"
:label="s__('ProjectSettings|Issues')"
:help-text="s__('ProjectSettings|Lightweight issue tracking system for this project')"
>
Loading
Loading
@@ -280,8 +292,9 @@ export default {
/>
</project-setting-row>
<project-setting-row
ref="repository-settings"
:label="s__('ProjectSettings|Repository')"
:help-text="s__('ProjectSettings|View and edit files in this project')"
:help-text="repositoryHelpText"
>
<project-feature-setting
v-model="repositoryAccessLevel"
Loading
Loading
@@ -291,6 +304,7 @@ export default {
</project-setting-row>
<div class="project-feature-setting-group">
<project-setting-row
ref="merge-request-settings"
:label="s__('ProjectSettings|Merge requests')"
:help-text="s__('ProjectSettings|Submit changes to be merged upstream')"
>
Loading
Loading
@@ -302,6 +316,7 @@ export default {
/>
</project-setting-row>
<project-setting-row
ref="fork-settings"
:label="s__('ProjectSettings|Forks')"
:help-text="
s__('ProjectSettings|Allow users to make copies of your repository to a new project')
Loading
Loading
@@ -315,6 +330,7 @@ export default {
/>
</project-setting-row>
<project-setting-row
ref="pipeline-settings"
:label="s__('ProjectSettings|Pipelines')"
:help-text="s__('ProjectSettings|Build, test, and deploy your changes')"
>
Loading
Loading
@@ -327,6 +343,7 @@ export default {
</project-setting-row>
<project-setting-row
v-if="registryAvailable"
ref="container-registry-settings"
:help-path="registryHelpPath"
:label="s__('ProjectSettings|Container registry')"
:help-text="
Loading
Loading
@@ -348,6 +365,7 @@ export default {
</project-setting-row>
<project-setting-row
v-if="lfsAvailable"
ref="git-lfs-settings"
:help-path="lfsHelpPath"
:label="s__('ProjectSettings|Git Large File Storage')"
:help-text="
Loading
Loading
@@ -362,6 +380,7 @@ export default {
</project-setting-row>
<project-setting-row
v-if="packagesAvailable"
ref="package-settings"
:help-path="packagesHelpPath"
:label="s__('ProjectSettings|Packages')"
:help-text="
Loading
Loading
@@ -376,6 +395,7 @@ export default {
</project-setting-row>
</div>
<project-setting-row
ref="wiki-settings"
:label="s__('ProjectSettings|Wiki')"
:help-text="s__('ProjectSettings|Pages for project documentation')"
>
Loading
Loading
@@ -386,6 +406,7 @@ export default {
/>
</project-setting-row>
<project-setting-row
ref="snippet-settings"
:label="s__('ProjectSettings|Snippets')"
:help-text="s__('ProjectSettings|Share code pastes with others out of Git repository')"
>
Loading
Loading
@@ -397,6 +418,7 @@ export default {
</project-setting-row>
<project-setting-row
v-if="pagesAvailable && pagesAccessControlEnabled"
ref="pages-settings"
:help-path="pagesHelpPath"
:label="s__('ProjectSettings|Pages')"
:help-text="
Loading
Loading
@@ -410,7 +432,7 @@ export default {
/>
</project-setting-row>
</div>
<project-setting-row v-if="canDisableEmails" class="mb-3">
<project-setting-row v-if="canDisableEmails" ref="email-settings" class="mb-3">
<label class="js-emails-disabled">
<input :value="emailsDisabled" type="hidden" name="project[emails_disabled]" />
<input v-model="emailsDisabled" type="checkbox" />
Loading
Loading
<script>
import { GlFormInput } from '@gitlab/ui';
import MarkdownField from '~/vue_shared/components/markdown/field.vue';
import setupCollapsibleInputs from '~/snippet/collapsible_input';
export default {
components: {
GlFormInput,
MarkdownField,
},
props: {
description: {
type: String,
default: '',
required: false,
},
markdownPreviewPath: {
type: String,
required: true,
},
markdownDocsPath: {
type: String,
required: true,
},
},
data() {
return {
text: this.description,
};
},
mounted() {
setupCollapsibleInputs();
},
};
</script>
<template>
<div class="form-group js-description-input">
<label>{{ s__('Snippets|Description (optional)') }}</label>
<div class="js-collapsible-input">
<div class="js-collapsed" :class="{ 'd-none': text }">
<gl-form-input
class="form-control"
:placeholder="
s__(
'Snippets|Optionally add a description about what your snippet does or how to use it…',
)
"
data-qa-selector="description_placeholder"
/>
</div>
<markdown-field
class="js-expanded"
:class="{ 'd-none': !text }"
:markdown-preview-path="markdownPreviewPath"
:markdown-docs-path="markdownDocsPath"
>
<textarea
id="snippet-description"
slot="textarea"
v-model="text"
class="note-textarea js-gfm-input js-autosize markdown-area
qa-description-textarea"
dir="auto"
data-supports-quick-actions="false"
:aria-label="__('Description')"
:placeholder="__('Write a comment or drag your files here…')"
>
</textarea>
</markdown-field>
</div>
</div>
</template>
Loading
Loading
@@ -212,6 +212,8 @@ export default {
return new MRWidgetService(this.getServiceEndpoints(store));
},
checkStatus(cb, isRebased) {
if (document.visibilityState !== 'visible') return Promise.resolve();
return this.service
.checkStatus()
.then(({ data }) => {
Loading
Loading
Loading
Loading
@@ -13,6 +13,7 @@ module BoardsHelper
disabled: (!can?(current_user, :create_non_backlog_issues, board)).to_s,
issue_link_base: build_issue_link_base,
root_path: root_path,
full_path: full_path,
bulk_update_path: @bulk_issues_path,
default_avatar: image_path(default_avatar),
time_tracking_limit_to_hours: Gitlab::CurrentSettings.time_tracking_limit_to_hours.to_s,
Loading
Loading
@@ -20,6 +21,14 @@ module BoardsHelper
}
end
 
def full_path
if board.group_board?
@group.full_path
else
@project.full_path
end
end
def build_issue_link_base
if board.group_board?
"#{group_path(@board.group)}/:project_path/issues"
Loading
Loading
Loading
Loading
@@ -313,6 +313,7 @@ class ProjectPolicy < BasePolicy
enable :daily_statistics
enable :admin_operations
enable :read_deploy_token
enable :create_deploy_token
end
 
rule { (mirror_available & can?(:admin_project)) | admin }.enable :admin_remote_mirror
Loading
Loading
---
title: Update project's permission settings description to reflect actual permissions
merge_request: 25523
author:
type: other
---
title: Added Blob Description Edit component in Vue
merge_request: 26762
author:
type: added
---
title: Update charts documentation and common_metrics.yml to enable data formatting
merge_request: 26048
author:
type: added
---
title: Optimize event counters query performance in usage data
merge_request: 26444
author:
type: performance
---
title: Add api endpoint to create deploy tokens
merge_request: 25270
author:
type: added
---
title: Enable client-side GRPC keepalive for Gitaly
merge_request: 26536
author:
type: changed
---
title: Replace undefined severity with unknown severity for vulnerabilities
merge_request: 26305
author:
type: other
Loading
Loading
@@ -59,5 +59,7 @@ Rails.application.configure do
config.active_record.migration_error = false
config.active_record.verbose_query_logs = false
config.action_view.cache_template_loading = true
config.middleware.delete BetterErrors::Middleware
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment