diff --git a/app/views/groups/edit.html.haml b/app/views/groups/edit.html.haml
index 0e78ce9f6569a6f1f6afad400d7a4904b609ae55..fe5a00e3be9bb524366e94d93261bb5650dfa8e0 100644
--- a/app/views/groups/edit.html.haml
+++ b/app/views/groups/edit.html.haml
@@ -53,4 +53,6 @@
.settings-content
= render 'groups/settings/advanced'
+= render_if_exists 'shared/groups/max_pages_size_setting'
+
= render 'shared/confirm_modal', phrase: @group.path
diff --git a/app/views/groups/settings/_pages_settings.html.haml b/app/views/groups/settings/_pages_settings.html.haml
new file mode 100644
index 0000000000000000000000000000000000000000..9e1932185dafb8392bf1fb0f20b247096fc7d34e
--- /dev/null
+++ b/app/views/groups/settings/_pages_settings.html.haml
@@ -0,0 +1,5 @@
+= form_for @group, html: { multipart: true, class: 'gl-show-field-errors' }, authenticity_token: true do |f|
+ = render_if_exists 'shared/pages/max_pages_size_input', form: f
+
+ .prepend-top-10
+ = f.submit s_('GitLabPages|Save'), class: 'btn btn-success'
diff --git a/app/views/projects/pages/_https_only.html.haml b/app/views/projects/pages/_https_only.html.haml
deleted file mode 100644
index d8c4a5f0a5d9232e3a4f54d291c44e81094e3d69..0000000000000000000000000000000000000000
--- a/app/views/projects/pages/_https_only.html.haml
+++ /dev/null
@@ -1,11 +0,0 @@
-= form_for @project, url: namespace_project_pages_path(@project.namespace.becomes(Namespace), @project), html: { class: 'inline', title: pages_https_only_title } do |f|
- .form-group
- .form-check
- = f.check_box :pages_https_only, class: 'form-check-input', disabled: pages_https_only_disabled?
- = f.label :pages_https_only, class: pages_https_only_label_class do
- %strong
- = s_('GitLabPages|Force HTTPS (requires valid certificates)')
-
- - unless pages_https_only_disabled?
- .prepend-top-10
- = f.submit s_('GitLabPages|Save'), class: 'btn btn-success'
diff --git a/app/views/projects/pages/_pages_settings.html.haml b/app/views/projects/pages/_pages_settings.html.haml
new file mode 100644
index 0000000000000000000000000000000000000000..58eddf630f4708408d26544284b35e602888b1a3
--- /dev/null
+++ b/app/views/projects/pages/_pages_settings.html.haml
@@ -0,0 +1,13 @@
+= form_for @project, url: namespace_project_pages_path(@project.namespace.becomes(Namespace), @project), html: { class: 'inline', title: pages_https_only_title } do |f|
+ - if Gitlab.config.pages.external_http || Gitlab.config.pages.external_https
+ = render_if_exists 'shared/pages/max_pages_size_input', form: f
+
+ .form-group
+ .form-check
+ = f.check_box :pages_https_only, class: 'form-check-input', disabled: pages_https_only_disabled?
+ = f.label :pages_https_only, class: pages_https_only_label_class do
+ %strong
+ = s_('GitLabPages|Force HTTPS (requires valid certificates)')
+
+ .prepend-top-10
+ = f.submit s_('GitLabPages|Save'), class: 'btn btn-success'
diff --git a/app/views/projects/pages/show.html.haml b/app/views/projects/pages/show.html.haml
index 3ec875978495cd9bc024738d4511c481b41a9fe2..8dbe67e153aa2e8ffc49f5bce0947425d94cf4da 100644
--- a/app/views/projects/pages/show.html.haml
+++ b/app/views/projects/pages/show.html.haml
@@ -10,8 +10,8 @@
%p.light
= s_('GitLabPages|With GitLab Pages you can host your static websites on GitLab. Combined with the power of GitLab CI and the help of GitLab Runner you can deploy static pages for your individual projects, your user or your group.')
- - if Gitlab.config.pages.external_https
- = render 'https_only'
+
+ = render 'pages_settings'
%hr.clearfix
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 26ae64d67ff0d187187450df3270fb9974b0ba62..1c8740853f289ce68dce475032a8d1d1fc180845 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -8669,6 +8669,9 @@ msgstr ""
msgid "GitLabPages|Learn how to upload your static site and have it served by GitLab by following the %{link_start}documentation on GitLab Pages%{link_end}."
msgstr ""
+msgid "GitLabPages|Maximum size of pages (MB)"
+msgstr ""
+
msgid "GitLabPages|New Domain"
msgstr ""
@@ -8693,6 +8696,9 @@ msgstr ""
msgid "GitLabPages|Support for domains and certificates is disabled. Ask your system's administrator to enable it."
msgstr ""
+msgid "GitLabPages|The total size of deployed static content will be limited to this size. 0 for unlimited. Leave empty to inherit the global value."
+msgstr ""
+
msgid "GitLabPages|Unverified"
msgstr ""
@@ -16639,6 +16645,9 @@ msgstr ""
msgid "Size limit per repository (MB)"
msgstr ""
+msgid "Size settings for static websites"
+msgstr ""
+
msgid "Skip Trial (Continue with Free Account)"
msgstr ""
@@ -18239,15 +18248,18 @@ msgstr ""
msgid "There was an error fetching cycle analytics stages."
msgstr ""
-msgid "There was an error fetching data for the chart"
+msgid "There was an error fetching data for the selected stage"
msgstr ""
-msgid "There was an error fetching data for the selected stage"
+msgid "There was an error fetching data for the tasks by type chart"
msgstr ""
msgid "There was an error fetching label data for the selected group"
msgstr ""
+msgid "There was an error fetching median data for stages"
+msgstr ""
+
msgid "There was an error fetching the Designs"
msgstr ""
diff --git a/spec/features/projects/pages_spec.rb b/spec/features/projects/pages_spec.rb
index afd1178f7f221013aff3035f7a817b2e9861ae89..c8da87041f9bb1cb027f7b25bc4b462c443b9aaf 100644
--- a/spec/features/projects/pages_spec.rb
+++ b/spec/features/projects/pages_spec.rb
@@ -347,7 +347,7 @@ shared_examples 'pages settings editing' do
visit project_pages_path(project)
expect(page).to have_field(:project_pages_https_only, disabled: true)
- expect(page).not_to have_button('Save')
+ expect(page).to have_button('Save')
end
end
diff --git a/spec/frontend/registry/settings/components/settings_form_spec.js b/spec/frontend/registry/settings/components/settings_form_spec.js
index 6d69b987c7fc4f7362fe705b515e1c261f236549..f93a5b9fb6d6af6b0c824bd88c2808f5d12cbd4f 100644
--- a/spec/frontend/registry/settings/components/settings_form_spec.js
+++ b/spec/frontend/registry/settings/components/settings_form_spec.js
@@ -82,8 +82,13 @@ describe('Settings Form', () => {
it(`${elementName} form element change updated ${modelName} with ${value}`, () => {
const element = findFormElements(elementName, formGroup);
- element.vm.$emit('input', value);
- expect(wrapper.vm[modelName]).toBe(value);
+ const modelUpdateEvent = element.vm.$options.model
+ ? element.vm.$options.model.event
+ : 'input';
+ element.vm.$emit(modelUpdateEvent, value);
+ return wrapper.vm.$nextTick().then(() => {
+ expect(wrapper.vm[modelName]).toBe(value);
+ });
});
});
diff --git a/spec/frontend/repository/components/table/row_spec.js b/spec/frontend/repository/components/table/row_spec.js
index 94fa8b1e36357ff079b838ddf6ff88f004fc2409..92d1fe5c4b0ceac16197988a1550f88b3aa4d5f2 100644
--- a/spec/frontend/repository/components/table/row_spec.js
+++ b/spec/frontend/repository/components/table/row_spec.js
@@ -108,7 +108,9 @@ describe('Repository table row component', () => {
if (pushes) {
expect(visitUrl).not.toHaveBeenCalled();
} else {
- expect(visitUrl).toHaveBeenCalledWith('https://test.com', undefined);
+ const [url, external] = visitUrl.mock.calls[0];
+ expect(url).toBe('https://test.com');
+ expect(external).toBeFalsy();
}
});