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-19 12:09:08 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-19 12:09:08 +0300
commit3fbfc0075a306ad85c70c006b978a2e96bd4283a (patch)
tree077f6cf9013638b21a1242355d2fd13069533f73 /app
parent224d2fe16768ee5b270d894a5ed47101bf454d04 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/images/auth_buttons/gitlab_64.pngbin2070 -> 1622 bytes
-rw-r--r--app/assets/javascripts/ide/components/ide_side_bar.vue6
-rw-r--r--app/assets/javascripts/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row.vue1
-rw-r--r--app/controllers/pwa_controller.rb3
-rw-r--r--app/helpers/tooling/visual_review_helper.rb26
-rw-r--r--app/presenters/project_presenter.rb17
-rw-r--r--app/views/layouts/_head.html.haml1
-rw-r--r--app/views/layouts/_visual_review.html.haml1
-rw-r--r--app/views/layouts/application.html.haml1
-rw-r--r--app/views/pwa/manifest.json.erb27
-rw-r--r--app/views/shared/notes/_edit_form.html.haml2
11 files changed, 67 insertions, 18 deletions
diff --git a/app/assets/images/auth_buttons/gitlab_64.png b/app/assets/images/auth_buttons/gitlab_64.png
index f675678dc9d..860f9c1be9b 100644
--- a/app/assets/images/auth_buttons/gitlab_64.png
+++ b/app/assets/images/auth_buttons/gitlab_64.png
Binary files differ
diff --git a/app/assets/javascripts/ide/components/ide_side_bar.vue b/app/assets/javascripts/ide/components/ide_side_bar.vue
index c3d6494692a..f32d35bf774 100644
--- a/app/assets/javascripts/ide/components/ide_side_bar.vue
+++ b/app/assets/javascripts/ide/components/ide_side_bar.vue
@@ -1,5 +1,5 @@
<script>
-import { GlDeprecatedSkeletonLoading as GlSkeletonLoading } from '@gitlab/ui';
+import { GlSkeletonLoader } from '@gitlab/ui';
import { mapState, mapGetters } from 'vuex';
import { SIDEBAR_INIT_WIDTH, leftSidebarViews } from '../constants';
import ActivityBar from './activity_bar.vue';
@@ -10,7 +10,7 @@ import ResizablePanel from './resizable_panel.vue';
export default {
components: {
- GlSkeletonLoading,
+ GlSkeletonLoader,
ResizablePanel,
ActivityBar,
IdeTree,
@@ -38,7 +38,7 @@ export default {
<template v-if="loading">
<div class="multi-file-commit-panel-inner" data-testid="ide-side-bar-inner">
<div v-for="n in 3" :key="n" class="multi-file-loading-container">
- <gl-skeleton-loading />
+ <gl-skeleton-loader />
</div>
</div>
</template>
diff --git a/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row.vue b/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row.vue
index 9176210eb22..acf810257e6 100644
--- a/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row.vue
+++ b/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row.vue
@@ -132,6 +132,7 @@ export default {
<div
v-gl-tooltip="{ title: tag.name }"
data-testid="name"
+ data-qa-selector="tag_name_content"
class="gl-text-overflow-ellipsis gl-overflow-hidden gl-white-space-nowrap"
:class="mobileClasses"
>
diff --git a/app/controllers/pwa_controller.rb b/app/controllers/pwa_controller.rb
index ea14dfb27b3..2345182a624 100644
--- a/app/controllers/pwa_controller.rb
+++ b/app/controllers/pwa_controller.rb
@@ -7,6 +7,9 @@ class PwaController < ApplicationController # rubocop:disable Gitlab/NamespacedC
skip_before_action :authenticate_user!
+ def manifest
+ end
+
def offline
end
end
diff --git a/app/helpers/tooling/visual_review_helper.rb b/app/helpers/tooling/visual_review_helper.rb
new file mode 100644
index 00000000000..da6eb3ec434
--- /dev/null
+++ b/app/helpers/tooling/visual_review_helper.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+module Tooling
+ module VisualReviewHelper
+ # Since we only use the visual review toolbar for the gitlab project,
+ # we can hardcode the project ID and project path for now.
+ #
+ # If we need to extend the review apps to other applications in the future,
+ # we should create REVIEW_APPS_PROJECT_ID and REVIEW_APPS_PROJECT_PATH
+ # environment variables (mapped to CI_PROJECT_ID and CI_PROJECT_PATH respectively),
+ # as well as setting `data-require-auth` according to the project visibility.
+ GITLAB_INSTANCE_URL = 'https://gitlab.com'
+ GITLAB_ORG_GITLAB_PROJECT_ID = '278964'
+ GITLAB_ORG_GITLAB_PROJECT_PATH = 'gitlab-org/gitlab'
+
+ def visual_review_toolbar_options
+ { 'data-merge-request-id': "#{ENV['REVIEW_APPS_MERGE_REQUEST_IID']}",
+ 'data-mr-url': "#{GITLAB_INSTANCE_URL}",
+ 'data-project-id': "#{GITLAB_ORG_GITLAB_PROJECT_ID}",
+ 'data-project-path': "#{GITLAB_ORG_GITLAB_PROJECT_PATH}",
+ 'data-require-auth': false,
+ 'id': 'review-app-toolbar-script',
+ 'src': 'https://gitlab.com/assets/webpack/visual_review_toolbar.js' }
+ end
+ end
+end
diff --git a/app/presenters/project_presenter.rb b/app/presenters/project_presenter.rb
index af1b254c46f..84aec19cba0 100644
--- a/app/presenters/project_presenter.rb
+++ b/app/presenters/project_presenter.rb
@@ -28,7 +28,6 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
commits_anchor_data,
branches_anchor_data,
tags_anchor_data,
- files_anchor_data,
storage_anchor_data,
releases_anchor_data
].compact.select(&:is_link)
@@ -161,26 +160,16 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
can_current_user_push_to_branch?(default_branch)
end
- def files_anchor_data
- AnchorData.new(true,
- statistic_icon('doc-code') +
- _('%{strong_start}%{human_size}%{strong_end} Files').html_safe % {
- human_size: storage_counter(statistics.total_repository_size),
- strong_start: '<strong class="project-stat-value">'.html_safe,
- strong_end: '</strong>'.html_safe
- },
- empty_repo? ? nil : project_tree_path(project))
- end
-
def storage_anchor_data
+ can_show_quota = can?(current_user, :admin_project, project) && !empty_repo?
AnchorData.new(true,
statistic_icon('disk') +
- _('%{strong_start}%{human_size}%{strong_end} Storage').html_safe % {
+ _('%{strong_start}%{human_size}%{strong_end} Project Storage').html_safe % {
human_size: storage_counter(statistics.storage_size),
strong_start: '<strong class="project-stat-value">'.html_safe,
strong_end: '</strong>'.html_safe
},
- empty_repo? ? nil : project_tree_path(project))
+ can_show_quota ? project_usage_quotas_path(project) : nil)
end
def releases_anchor_data
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml
index 55c66454d0b..84eb2706929 100644
--- a/app/views/layouts/_head.html.haml
+++ b/app/views/layouts/_head.html.haml
@@ -68,6 +68,7 @@
%meta{ name: "description", content: page_description }
+ %link{ rel: 'manifest', href: manifest_path(format: :json) }
%meta{ name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1' }
%meta{ name: 'theme-color', content: user_theme_primary_color }
diff --git a/app/views/layouts/_visual_review.html.haml b/app/views/layouts/_visual_review.html.haml
new file mode 100644
index 00000000000..73da841964a
--- /dev/null
+++ b/app/views/layouts/_visual_review.html.haml
@@ -0,0 +1 @@
+= javascript_tag "", visual_review_toolbar_options
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index bdab5d7ea07..455d18a5ae8 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -8,6 +8,7 @@
%body{ class: body_classes, data: body_data }
= render "layouts/init_auto_complete" if @gfm_form
= render "layouts/init_client_detection_flags"
+ = render "layouts/visual_review" if ENV['REVIEW_APPS_ENABLED']
= render 'peek/bar'
= header_message
= render partial: "layouts/header/default", locals: { project: @project, group: @group }
diff --git a/app/views/pwa/manifest.json.erb b/app/views/pwa/manifest.json.erb
new file mode 100644
index 00000000000..557a39ee157
--- /dev/null
+++ b/app/views/pwa/manifest.json.erb
@@ -0,0 +1,27 @@
+{
+ "name": "GitLab",
+ "short_name": "GitLab",
+ "description": "<%= _("The complete DevOps platform. One application with endless possibilities. Organizations rely on GitLab’s source code management, CI/CD, security, and more to deliver software rapidly.") %>",
+ "start_url": "<%= explore_projects_path %>",
+ "scope": "<%= root_path %>",
+ "display": "browser",
+ "orientation": "any",
+ "background_color": "#fff",
+ "theme_color": "<%= user_theme_primary_color %>",
+ "icons": [{
+ "src": "<%= Gitlab::Utils.append_path(Gitlab.config.gitlab.relative_url_root, '/-/pwa-icons/logo-192.png') %>",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "<%= Gitlab::Utils.append_path(Gitlab.config.gitlab.relative_url_root, '/-/pwa-icons/logo-512.png') %>",
+ "sizes": "512x512",
+ "type": "image/png"
+ },
+ {
+ "src": "<%= Gitlab::Utils.append_path(Gitlab.config.gitlab.relative_url_root, '/-/pwa-icons/maskable-logo.png') %>",
+ "sizes": "512x512",
+ "type": "image/png",
+ "purpose": "maskable"
+ }]
+}
diff --git a/app/views/shared/notes/_edit_form.html.haml b/app/views/shared/notes/_edit_form.html.haml
index 63c895a5a03..b41ed8f63e4 100644
--- a/app/views/shared/notes/_edit_form.html.haml
+++ b/app/views/shared/notes/_edit_form.html.haml
@@ -9,6 +9,6 @@
.note-form-actions.clearfix
.settings-message.note-edit-warning.js-finish-edit-warning
= _("Finish editing this message first!")
- = submit_tag _('Save comment'), class: 'gl-button btn btn-success js-comment-save-button', data: { qa_selector: 'save_comment_button' }
+ = submit_tag _('Save comment'), class: 'gl-button btn btn-confirm js-comment-save-button', data: { qa_selector: 'save_comment_button' }
%button.btn.gl-button.btn-cancel.note-edit-cancel{ type: 'button' }
= _("Cancel")