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
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-11 06:07:57 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-11 06:07:57 +0300
commitdefc424997d8329613ef3951ab30adf6b3b94f01 (patch)
treeef253b2f77b033e38f7ef8d80b50cf112e9e0d6f /app
parentcb2494484e33a0d3c750625908e8b4dda69ab7b4 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/pipeline_editor/components/file_nav/pipeline_editor_file_nav.vue6
-rw-r--r--app/assets/javascripts/pipeline_editor/components/file_tree/container.vue38
-rw-r--r--app/assets/javascripts/pipeline_editor/components/file_tree/file_item.vue31
-rw-r--r--app/assets/javascripts/pipeline_editor/constants.js1
-rw-r--r--app/assets/javascripts/pipeline_editor/graphql/queries/ci_config.query.graphql6
-rw-r--r--app/assets/javascripts/pipeline_editor/pipeline_editor_home.vue9
-rw-r--r--app/assets/stylesheets/page_bundles/pipeline_editor.scss13
-rw-r--r--app/controllers/concerns/dependency_proxy/group_access.rb4
-rw-r--r--app/controllers/groups/dependency_proxies_controller.rb1
-rw-r--r--app/graphql/queries/burndown_chart/burnup.iteration.query.graphql40
-rw-r--r--app/graphql/queries/burndown_chart/burnup.milestone.query.graphql36
-rw-r--r--app/graphql/queries/burndown_chart/burnup.query.graphql75
-rw-r--r--app/graphql/types/dependency_proxy/group_setting_type.rb2
-rw-r--r--app/graphql/types/dependency_proxy/image_ttl_group_policy_type.rb2
-rw-r--r--app/policies/group_policy.rb2
-rw-r--r--app/views/registrations/welcome/show.html.haml2
-rw-r--r--app/workers/deployments/hooks_worker.rb3
17 files changed, 176 insertions, 95 deletions
diff --git a/app/assets/javascripts/pipeline_editor/components/file_nav/pipeline_editor_file_nav.vue b/app/assets/javascripts/pipeline_editor/components/file_nav/pipeline_editor_file_nav.vue
index 998db653e0c..58df98d0fb7 100644
--- a/app/assets/javascripts/pipeline_editor/components/file_nav/pipeline_editor_file_nav.vue
+++ b/app/assets/javascripts/pipeline_editor/components/file_nav/pipeline_editor_file_nav.vue
@@ -2,7 +2,7 @@
import { GlButton } from '@gitlab/ui';
import getAppStatus from '~/pipeline_editor/graphql/queries/client/app_status.query.graphql';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
-import { EDITOR_APP_STATUS_EMPTY } from '../../constants';
+import { EDITOR_APP_STATUS_EMPTY, EDITOR_APP_STATUS_LOADING } from '../../constants';
import FileTreePopover from '../popovers/file_tree_popover.vue';
import BranchSwitcher from './branch_switcher.vue';
@@ -39,6 +39,9 @@ export default {
},
},
computed: {
+ isAppLoading() {
+ return this.appStatus === EDITOR_APP_STATUS_LOADING;
+ },
showFileTreeToggle() {
return (
this.glFeatures.pipelineEditorFileTree &&
@@ -62,6 +65,7 @@ export default {
icon="file-tree"
data-testid="file-tree-toggle"
:aria-label="__('File Tree')"
+ :loading="isAppLoading"
@click="onFileTreeBtnClick"
/>
<file-tree-popover v-if="showFileTreeToggle" />
diff --git a/app/assets/javascripts/pipeline_editor/components/file_tree/container.vue b/app/assets/javascripts/pipeline_editor/components/file_tree/container.vue
index d1ff70ad518..8bffb281211 100644
--- a/app/assets/javascripts/pipeline_editor/components/file_tree/container.vue
+++ b/app/assets/javascripts/pipeline_editor/components/file_tree/container.vue
@@ -1,6 +1,8 @@
<script>
-import { GlAlert } from '@gitlab/ui';
+import { GlAlert, GlTooltipDirective } from '@gitlab/ui';
import { __, s__ } from '~/locale';
+import FileIcon from '~/vue_shared/components/file_icon.vue';
+import { FILE_TREE_TIP_DISMISSED_KEY } from '../../constants';
import FileItem from './file_item.vue';
const i18n = {
@@ -15,27 +17,55 @@ export default {
i18n,
name: 'PipelineEditorFileTreeContainer',
components: {
+ FileIcon,
FileItem,
GlAlert,
},
+ directives: {
+ GlTooltip: GlTooltipDirective,
+ },
inject: ['ciConfigPath'],
+ props: {
+ includes: {
+ type: Array,
+ required: true,
+ },
+ },
data() {
return {
- showTip: true,
+ canShowTip: localStorage.getItem(FILE_TREE_TIP_DISMISSED_KEY) !== 'true',
};
},
+ computed: {
+ showTip() {
+ return this.includes.length === 0 && this.canShowTip;
+ },
+ },
methods: {
dismissTip() {
- this.showTip = false;
+ this.canShowTip = false;
+ localStorage.setItem(FILE_TREE_TIP_DISMISSED_KEY, 'true');
},
},
};
</script>
<template>
<aside class="file-tree-container gl-mr-5 gl-mb-5">
- <file-item class="gl-mb-3 gl-bg-gray-50" :file-name="ciConfigPath" />
+ <div
+ v-gl-tooltip
+ :title="ciConfigPath"
+ class="gl-bg-gray-50 gl-py-2 gl-px-3 gl-mb-3 gl-rounded-base"
+ >
+ <span class="file-row-name gl-str-truncated" :title="ciConfigPath">
+ <file-icon class="file-row-icon" :file-name="ciConfigPath" />
+ <span data-testid="current-config-filename">{{ ciConfigPath }}</span>
+ </span>
+ </div>
<gl-alert v-if="showTip" variant="tip" :title="$options.i18n.tipTitle" @dismiss="dismissTip">
{{ $options.i18n.tipDescription }}
</gl-alert>
+ <div class="gl-overflow-y-auto">
+ <file-item v-for="file in includes" :key="file.location" :file="file" />
+ </div>
</aside>
</template>
diff --git a/app/assets/javascripts/pipeline_editor/components/file_tree/file_item.vue b/app/assets/javascripts/pipeline_editor/components/file_tree/file_item.vue
index d51a2874c9e..786d483b5b9 100644
--- a/app/assets/javascripts/pipeline_editor/components/file_tree/file_item.vue
+++ b/app/assets/javascripts/pipeline_editor/components/file_tree/file_item.vue
@@ -1,24 +1,45 @@
<script>
+import { GlIcon, GlLink, GlTooltipDirective } from '@gitlab/ui';
import FileIcon from '~/vue_shared/components/file_icon.vue';
export default {
name: 'PipelineEditorFileItem',
components: {
FileIcon,
+ GlIcon,
+ GlLink,
+ },
+ directives: {
+ GlTooltip: GlTooltipDirective,
},
props: {
- fileName: {
- type: String,
+ file: {
+ type: Object,
required: true,
},
},
+ computed: {
+ fileName() {
+ return this.file.location;
+ },
+ filePath() {
+ return this.file.blob || this.file.raw;
+ },
+ },
};
</script>
<template>
- <div class="gl-py-2 gl-px-3 gl-rounded-base">
- <span class="file-row-name" :title="fileName">
+ <gl-link
+ v-gl-tooltip
+ :href="filePath"
+ :title="fileName"
+ target="_blank"
+ class="file-tree-includes-link gl-display-flex gl-justify-content-space-between gl-hover-bg-gray-50 gl-text-body gl-hover-text-gray-900 gl-hover-text-decoration-none gl-py-2 gl-px-3 gl-rounded-base"
+ >
+ <span class="file-row-name gl-str-truncated" :title="fileName">
<file-icon class="file-row-icon" :file-name="fileName" />
<span>{{ fileName }}</span>
</span>
- </div>
+ <gl-icon class="gl-display-none gl-relative gl-text-gray-500" name="external-link" />
+ </gl-link>
</template>
diff --git a/app/assets/javascripts/pipeline_editor/constants.js b/app/assets/javascripts/pipeline_editor/constants.js
index 0484da8641d..ff7c742f588 100644
--- a/app/assets/javascripts/pipeline_editor/constants.js
+++ b/app/assets/javascripts/pipeline_editor/constants.js
@@ -51,6 +51,7 @@ export const SOURCE_EDITOR_DEBOUNCE = 500;
export const FILE_TREE_DISPLAY_KEY = 'pipeline_editor_file_tree_display';
export const FILE_TREE_POPOVER_DISMISSED_KEY = 'pipeline_editor_file_tree_popover_dismissed';
+export const FILE_TREE_TIP_DISMISSED_KEY = 'pipeline_editor_file_tree_tip_dismissed';
export const STARTER_TEMPLATE_NAME = 'Getting-Started';
diff --git a/app/assets/javascripts/pipeline_editor/graphql/queries/ci_config.query.graphql b/app/assets/javascripts/pipeline_editor/graphql/queries/ci_config.query.graphql
index df7de6a1f54..5354ed7c2d5 100644
--- a/app/assets/javascripts/pipeline_editor/graphql/queries/ci_config.query.graphql
+++ b/app/assets/javascripts/pipeline_editor/graphql/queries/ci_config.query.graphql
@@ -3,6 +3,12 @@
query getCiConfigData($projectPath: ID!, $sha: String, $content: String!) {
ciConfig(projectPath: $projectPath, sha: $sha, content: $content) {
errors
+ includes {
+ location
+ type
+ blob
+ raw
+ }
mergedYaml
status
stages {
diff --git a/app/assets/javascripts/pipeline_editor/pipeline_editor_home.vue b/app/assets/javascripts/pipeline_editor/pipeline_editor_home.vue
index f5277fdbcca..59022a91322 100644
--- a/app/assets/javascripts/pipeline_editor/pipeline_editor_home.vue
+++ b/app/assets/javascripts/pipeline_editor/pipeline_editor_home.vue
@@ -73,6 +73,9 @@ export default {
showCommitForm() {
return this.currentTab === CREATE_TAB;
},
+ includesFiles() {
+ return this.ciConfigData?.includes || [];
+ },
isFileTreeVisible() {
return this.showFileTree && this.glFeatures.pipelineEditorFileTree;
},
@@ -136,7 +139,11 @@ export default {
v-on="$listeners"
/>
<div class="gl-display-flex gl-w-full gl-sm-flex-direction-column">
- <pipeline-editor-file-tree v-if="isFileTreeVisible" class="gl-flex-shrink-0" />
+ <pipeline-editor-file-tree
+ v-if="isFileTreeVisible"
+ class="gl-flex-shrink-0"
+ :includes="includesFiles"
+ />
<div class="gl-flex-grow-1 gl-min-w-0">
<pipeline-editor-header
:ci-config-data="ciConfigData"
diff --git a/app/assets/stylesheets/page_bundles/pipeline_editor.scss b/app/assets/stylesheets/page_bundles/pipeline_editor.scss
index 8e4cff2d167..e167052a3e1 100644
--- a/app/assets/stylesheets/page_bundles/pipeline_editor.scss
+++ b/app/assets/stylesheets/page_bundles/pipeline_editor.scss
@@ -7,3 +7,16 @@
width: 300px;
}
}
+
+.file-tree-container > div.gl-overflow-y-auto {
+ max-height: 220px;
+
+ @media (min-width: $breakpoint-md) {
+ max-height: 700px;
+ }
+}
+
+.file-tree-includes-link:hover > svg {
+ @include gl-display-block;
+ top: 2px;
+}
diff --git a/app/controllers/concerns/dependency_proxy/group_access.rb b/app/controllers/concerns/dependency_proxy/group_access.rb
index 44611641529..45392625e45 100644
--- a/app/controllers/concerns/dependency_proxy/group_access.rb
+++ b/app/controllers/concerns/dependency_proxy/group_access.rb
@@ -18,9 +18,5 @@ module DependencyProxy
def authorize_read_dependency_proxy!
access_denied! unless can?(auth_user, :read_dependency_proxy, group)
end
-
- def authorize_admin_dependency_proxy!
- access_denied! unless can?(auth_user, :admin_dependency_proxy, group)
- end
end
end
diff --git a/app/controllers/groups/dependency_proxies_controller.rb b/app/controllers/groups/dependency_proxies_controller.rb
index afa2af0d173..8e134529c34 100644
--- a/app/controllers/groups/dependency_proxies_controller.rb
+++ b/app/controllers/groups/dependency_proxies_controller.rb
@@ -4,7 +4,6 @@ module Groups
class DependencyProxiesController < Groups::ApplicationController
include ::DependencyProxy::GroupAccess
- before_action :authorize_admin_dependency_proxy!, only: :update
before_action :verify_dependency_proxy_enabled!
feature_category :dependency_proxy
diff --git a/app/graphql/queries/burndown_chart/burnup.iteration.query.graphql b/app/graphql/queries/burndown_chart/burnup.iteration.query.graphql
new file mode 100644
index 00000000000..ff50c34ade3
--- /dev/null
+++ b/app/graphql/queries/burndown_chart/burnup.iteration.query.graphql
@@ -0,0 +1,40 @@
+query BurnupTimesSeriesIterationData(
+ $iterationId: IterationID!
+ $weight: Boolean = false
+ $fullPath: String
+) {
+ iteration(id: $iterationId) {
+ __typename
+ id
+ title
+ report(fullPath: $fullPath) {
+ __typename
+ burnupTimeSeries {
+ __typename
+ date
+ completedCount @skip(if: $weight)
+ scopeCount @skip(if: $weight)
+ completedWeight @include(if: $weight)
+ scopeWeight @include(if: $weight)
+ }
+ stats {
+ __typename
+ total {
+ __typename
+ count @skip(if: $weight)
+ weight @include(if: $weight)
+ }
+ complete {
+ __typename
+ count @skip(if: $weight)
+ weight @include(if: $weight)
+ }
+ incomplete {
+ __typename
+ count @skip(if: $weight)
+ weight @include(if: $weight)
+ }
+ }
+ }
+ }
+}
diff --git a/app/graphql/queries/burndown_chart/burnup.milestone.query.graphql b/app/graphql/queries/burndown_chart/burnup.milestone.query.graphql
new file mode 100644
index 00000000000..18e59249500
--- /dev/null
+++ b/app/graphql/queries/burndown_chart/burnup.milestone.query.graphql
@@ -0,0 +1,36 @@
+query BurnupTimesSeriesMilestoneData($milestoneId: MilestoneID!, $weight: Boolean = false) {
+ milestone(id: $milestoneId) {
+ __typename
+ id
+ title
+ report {
+ __typename
+ burnupTimeSeries {
+ __typename
+ date
+ completedCount @skip(if: $weight)
+ scopeCount @skip(if: $weight)
+ completedWeight @include(if: $weight)
+ scopeWeight @include(if: $weight)
+ }
+ stats {
+ __typename
+ total {
+ __typename
+ count @skip(if: $weight)
+ weight @include(if: $weight)
+ }
+ complete {
+ __typename
+ count @skip(if: $weight)
+ weight @include(if: $weight)
+ }
+ incomplete {
+ __typename
+ count @skip(if: $weight)
+ weight @include(if: $weight)
+ }
+ }
+ }
+ }
+}
diff --git a/app/graphql/queries/burndown_chart/burnup.query.graphql b/app/graphql/queries/burndown_chart/burnup.query.graphql
deleted file mode 100644
index 0795645f8b7..00000000000
--- a/app/graphql/queries/burndown_chart/burnup.query.graphql
+++ /dev/null
@@ -1,75 +0,0 @@
-query BurnupTimesSeriesData(
- $id: ID!
- $isIteration: Boolean = false
- $weight: Boolean = false
- $fullPath: String
-) {
- milestone(id: $id) @skip(if: $isIteration) {
- __typename
- id
- title
- report {
- __typename
- burnupTimeSeries {
- __typename
- date
- completedCount @skip(if: $weight)
- scopeCount @skip(if: $weight)
- completedWeight @include(if: $weight)
- scopeWeight @include(if: $weight)
- }
- stats {
- __typename
- total {
- __typename
- count @skip(if: $weight)
- weight @include(if: $weight)
- }
- complete {
- __typename
- count @skip(if: $weight)
- weight @include(if: $weight)
- }
- incomplete {
- __typename
- count @skip(if: $weight)
- weight @include(if: $weight)
- }
- }
- }
- }
- iteration(id: $id) @include(if: $isIteration) {
- __typename
- id
- title
- report(fullPath: $fullPath) {
- __typename
- burnupTimeSeries {
- __typename
- date
- completedCount @skip(if: $weight)
- scopeCount @skip(if: $weight)
- completedWeight @include(if: $weight)
- scopeWeight @include(if: $weight)
- }
- stats {
- __typename
- total {
- __typename
- count @skip(if: $weight)
- weight @include(if: $weight)
- }
- complete {
- __typename
- count @skip(if: $weight)
- weight @include(if: $weight)
- }
- incomplete {
- __typename
- count @skip(if: $weight)
- weight @include(if: $weight)
- }
- }
- }
- }
-}
diff --git a/app/graphql/types/dependency_proxy/group_setting_type.rb b/app/graphql/types/dependency_proxy/group_setting_type.rb
index 8b8b8572aa9..6c6f848d019 100644
--- a/app/graphql/types/dependency_proxy/group_setting_type.rb
+++ b/app/graphql/types/dependency_proxy/group_setting_type.rb
@@ -6,7 +6,7 @@ module Types
description 'Group-level Dependency Proxy settings'
- authorize :read_dependency_proxy
+ authorize :admin_dependency_proxy
field :enabled, GraphQL::Types::Boolean, null: false, description: 'Indicates whether the dependency proxy is enabled for the group.'
end
diff --git a/app/graphql/types/dependency_proxy/image_ttl_group_policy_type.rb b/app/graphql/types/dependency_proxy/image_ttl_group_policy_type.rb
index 9ab7c50998d..b8c178539a0 100644
--- a/app/graphql/types/dependency_proxy/image_ttl_group_policy_type.rb
+++ b/app/graphql/types/dependency_proxy/image_ttl_group_policy_type.rb
@@ -6,7 +6,7 @@ module Types
description 'Group-level Dependency Proxy TTL policy settings'
- authorize :read_dependency_proxy
+ authorize :admin_dependency_proxy
field :created_at, Types::TimeType, null: true, description: 'Timestamp of creation.'
field :enabled, GraphQL::Types::Boolean, null: false, description: 'Indicates whether the policy is enabled or disabled.'
diff --git a/app/policies/group_policy.rb b/app/policies/group_policy.rb
index f6932d30ce2..d397d77bc1a 100644
--- a/app/policies/group_policy.rb
+++ b/app/policies/group_policy.rb
@@ -251,7 +251,7 @@ class GroupPolicy < Namespaces::GroupProjectNamespaceSharedPolicy
rule { dependency_proxy_access_allowed & dependency_proxy_available }
.enable :read_dependency_proxy
- rule { developer & dependency_proxy_available }.policy do
+ rule { maintainer & dependency_proxy_available }.policy do
enable :admin_dependency_proxy
end
diff --git a/app/views/registrations/welcome/show.html.haml b/app/views/registrations/welcome/show.html.haml
index 1f6976d4f38..62499f1a6b6 100644
--- a/app/views/registrations/welcome/show.html.haml
+++ b/app/views/registrations/welcome/show.html.haml
@@ -17,7 +17,7 @@
%p.gl-text-center= html_escape(_('%{gitlab_experience_text}. We won\'t share this information with anyone.')) % { gitlab_experience_text: gitlab_experience_text }
- else
%p.gl-text-center= html_escape(_('%{gitlab_experience_text}. Don\'t worry, this information isn\'t shared outside of your self-managed GitLab instance.')) % { gitlab_experience_text: gitlab_experience_text }
- = gitlab_ui_form_for(current_user, url: users_sign_up_welcome_path, html: { class: 'card gl-w-full! gl-p-5', 'aria-live' => 'assertive' }) do |f|
+ = gitlab_ui_form_for(current_user, url: users_sign_up_welcome_path, html: { class: 'card gl-w-full! gl-p-5 js-users-signup-welcome', 'aria-live' => 'assertive' }) do |f|
.devise-errors
= render 'devise/shared/error_messages', resource: current_user
.row
diff --git a/app/workers/deployments/hooks_worker.rb b/app/workers/deployments/hooks_worker.rb
index 31c57e5c001..608601b4eb9 100644
--- a/app/workers/deployments/hooks_worker.rb
+++ b/app/workers/deployments/hooks_worker.rb
@@ -13,6 +13,9 @@ module Deployments
params = params.with_indifferent_access
if (deploy = Deployment.find_by_id(params[:deployment_id]))
+ log_extra_metadata_on_done(:deployment_project_id, deploy.project.id)
+ log_extra_metadata_on_done(:deployment_id, params[:deployment_id])
+
deploy.execute_hooks(params[:status_changed_at].to_time)
end
end