summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-05-16 11:25:50 +0100
committerFilipa Lacerda <filipa@gitlab.com>2018-05-16 11:25:50 +0100
commita55da0a95a7d38caed4070006f611e9eaea3e387 (patch)
treed0771c25194dfce8bb17eb02a0e820d415ae9bc0 /app
parent3593b83a0279bab40f8ba97dc339b32c56f6e0df (diff)
parent75f94fc39bedbc635bd4bc52cdf145d1e81752dd (diff)
downloadgitlab-ce-a55da0a95a7d38caed4070006f611e9eaea3e387.tar.gz
[ci skip] Merge branch 'master' into 46381-dropdown-mr-widget
* master: (31 commits) Remove docker pull prefix from registry clipboard feature Document the 3h timeout for GitLab.com shared Runners Fix bug with long strings in issue boards Fix setting Gitlab metrics content types Add documentation for bulk editing of issues and merge requests Remove authentication for readonly endpoints in issues API Improve testing best practices guidelines Add a unique and not null constraint on the project_features.project_id column fix typos Frontend Guide, development_process.md Add index on runner_type for ci_runners Update docs describing `fast_spec_helper` best practices Display help text below auto devops domain with nip.io domain name (#45561) Add CHANGELOG Does not log failed sign-in attempts when database is in read-only mode Simplified priority, performance impact should be severity Ref contains oid check done by Gitaly code example formatting more typos typo in `endpoint` clarify that the function export should be default ...
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/registry/components/collapsible_container.vue7
-rw-r--r--app/assets/javascripts/registry/components/table_registry.vue6
-rw-r--r--app/assets/stylesheets/framework/mixins.scss12
-rw-r--r--app/assets/stylesheets/pages/boards.scss8
-rw-r--r--app/helpers/auto_devops_helper.rb9
-rw-r--r--app/models/project.rb1
-rw-r--r--app/models/user.rb3
-rw-r--r--app/views/projects/settings/ci_cd/_autodevops_form.html.haml4
8 files changed, 35 insertions, 15 deletions
diff --git a/app/assets/javascripts/registry/components/collapsible_container.vue b/app/assets/javascripts/registry/components/collapsible_container.vue
index a03180e80e6..2ce43ef0125 100644
--- a/app/assets/javascripts/registry/components/collapsible_container.vue
+++ b/app/assets/javascripts/registry/components/collapsible_container.vue
@@ -28,11 +28,6 @@
isOpen: false,
};
},
- computed: {
- clipboardText() {
- return `docker pull ${this.repo.location}`;
- },
- },
methods: {
...mapActions([
'fetchRepos',
@@ -84,7 +79,7 @@
<clipboard-button
v-if="repo.location"
- :text="clipboardText"
+ :text="repo.location"
:title="repo.location"
css-class="btn-default btn-transparent btn-clipboard"
/>
diff --git a/app/assets/javascripts/registry/components/table_registry.vue b/app/assets/javascripts/registry/components/table_registry.vue
index a2227b2f554..673b1db6769 100644
--- a/app/assets/javascripts/registry/components/table_registry.vue
+++ b/app/assets/javascripts/registry/components/table_registry.vue
@@ -56,10 +56,6 @@
.catch(() => this.showError(errorMessagesTypes.FETCH_REGISTRY));
},
- clipboardText(text) {
- return `docker pull ${text}`;
- },
-
showError(message) {
Flash(errorMessages[message]);
},
@@ -89,7 +85,7 @@
<clipboard-button
v-if="item.location"
:title="item.location"
- :text="clipboardText(item.location)"
+ :text="item.location"
css-class="btn-default btn-transparent btn-clipboard"
/>
</td>
diff --git a/app/assets/stylesheets/framework/mixins.scss b/app/assets/stylesheets/framework/mixins.scss
index 9ff24ebc127..0ea0b65b95f 100644
--- a/app/assets/stylesheets/framework/mixins.scss
+++ b/app/assets/stylesheets/framework/mixins.scss
@@ -210,3 +210,15 @@
margin-left: -$size;
}
}
+
+/*
+ * Mixin that fixes wrapping issues with long strings (e.g. URLs)
+ *
+ * Note: the width needs to be set for it to work in Firefox
+ */
+@mixin overflow-break-word {
+ overflow-wrap: break-word;
+ word-wrap: break-word;
+ word-break: break-word;
+ max-width: 100%;
+}
diff --git a/app/assets/stylesheets/pages/boards.scss b/app/assets/stylesheets/pages/boards.scss
index 681242f8d85..011d38532b4 100644
--- a/app/assets/stylesheets/pages/boards.scss
+++ b/app/assets/stylesheets/pages/boards.scss
@@ -284,6 +284,9 @@
box-shadow: 0 1px 2px $issue-boards-card-shadow;
list-style: none;
+ // as a fallback, hide overflow content so that dragging and dropping still works
+ overflow: hidden;
+
&:not(:last-child) {
margin-bottom: 5px;
}
@@ -310,14 +313,13 @@
}
.card-title {
+ @include overflow-break-word();
margin: 0 30px 0 0;
font-size: 1em;
line-height: inherit;
a {
color: $gl-text-color;
- word-wrap: break-word;
- word-break: break-word;
margin-right: 2px;
}
}
@@ -462,8 +464,8 @@
}
.issuable-header-text {
+ @include overflow-break-word();
padding-right: 35px;
- word-break: break-word;
> strong {
font-weight: $gl-font-weight-bold;
diff --git a/app/helpers/auto_devops_helper.rb b/app/helpers/auto_devops_helper.rb
index 16451993e93..7b076728685 100644
--- a/app/helpers/auto_devops_helper.rb
+++ b/app/helpers/auto_devops_helper.rb
@@ -24,6 +24,15 @@ module AutoDevopsHelper
end
end
+ def cluster_ingress_ip(project)
+ project
+ .cluster_ingresses
+ .where("external_ip is not null")
+ .limit(1)
+ .pluck(:external_ip)
+ .first
+ end
+
private
def missing_auto_devops_domain?(project)
diff --git a/app/models/project.rb b/app/models/project.rb
index 32d34f5e9b8..534a0e630af 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -217,6 +217,7 @@ class Project < ActiveRecord::Base
has_one :cluster_project, class_name: 'Clusters::Project'
has_many :clusters, through: :cluster_project, class_name: 'Clusters::Cluster'
+ has_many :cluster_ingresses, through: :clusters, source: :application_ingress, class_name: 'Clusters::Applications::Ingress'
# Container repositories need to remove data from the container registry,
# which is not managed by the DB. Hence we're still using dependent: :destroy
diff --git a/app/models/user.rb b/app/models/user.rb
index dfef065f094..173ab38e20c 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1097,8 +1097,11 @@ class User < ActiveRecord::Base
# <https://github.com/plataformatec/devise/blob/v4.0.0/lib/devise/models/lockable.rb#L92>
#
def increment_failed_attempts!
+ return if ::Gitlab::Database.read_only?
+
self.failed_attempts ||= 0
self.failed_attempts += 1
+
if attempts_exceeded?
lock_access! unless access_locked?
else
diff --git a/app/views/projects/settings/ci_cd/_autodevops_form.html.haml b/app/views/projects/settings/ci_cd/_autodevops_form.html.haml
index 71e77dae69e..8cb6c446e18 100644
--- a/app/views/projects/settings/ci_cd/_autodevops_form.html.haml
+++ b/app/views/projects/settings/ci_cd/_autodevops_form.html.haml
@@ -35,7 +35,9 @@
= _('Domain')
= form.text_field :domain, class: 'form-control', placeholder: 'domain.com'
.help-block
- = s_('CICD|You need to specify a domain if you want to use Auto Review Apps and Auto Deploy stages.')
+ = s_('CICD|A domain is required to use Auto Review Apps and Auto Deploy Stages.')
+ - if cluster_ingress_ip = cluster_ingress_ip(@project)
+ = s_('%{nip_domain} can be used as an alternative to a custom domain.').html_safe % { nip_domain: "<code>#{cluster_ingress_ip}.nip.io</code>".html_safe }
= link_to icon('question-circle'), help_page_path('topics/autodevops/index.md', anchor: 'auto-devops-base-domain'), target: '_blank'
= f.submit 'Save changes', class: "btn btn-success prepend-top-15"