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:
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/confirm_modal.js33
-rw-r--r--app/assets/javascripts/editor/editor_lite.js1
-rw-r--r--app/assets/javascripts/vue_shared/components/confirm_modal.vue58
-rw-r--r--app/assets/stylesheets/framework.scss1
-rw-r--r--app/assets/stylesheets/framework/editor-lite.scss5
-rw-r--r--app/controllers/dashboard/projects_controller.rb5
6 files changed, 37 insertions, 66 deletions
diff --git a/app/assets/javascripts/confirm_modal.js b/app/assets/javascripts/confirm_modal.js
index ff29d5fa355..4b4fdf03873 100644
--- a/app/assets/javascripts/confirm_modal.js
+++ b/app/assets/javascripts/confirm_modal.js
@@ -3,40 +3,9 @@ import ConfirmModal from '~/vue_shared/components/confirm_modal.vue';
const mountConfirmModal = () => {
return new Vue({
- data() {
- return {
- path: '',
- method: '',
- modalAttributes: null,
- showModal: false,
- };
- },
- mounted() {
- document.querySelectorAll('.js-confirm-modal-button').forEach(button => {
- button.addEventListener('click', e => {
- e.preventDefault();
-
- this.path = button.dataset.path;
- this.method = button.dataset.method;
- this.modalAttributes = JSON.parse(button.dataset.modalAttributes);
- this.showModal = true;
- });
- });
- },
- methods: {
- dismiss() {
- this.showModal = false;
- },
- },
render(h) {
return h(ConfirmModal, {
- props: {
- path: this.path,
- method: this.method,
- modalAttributes: this.modalAttributes,
- showModal: this.showModal,
- },
- on: { dismiss: this.dismiss },
+ props: { selector: '.js-confirm-modal-button' },
});
},
}).$mount();
diff --git a/app/assets/javascripts/editor/editor_lite.js b/app/assets/javascripts/editor/editor_lite.js
index c2723b1d506..663d14bcfcb 100644
--- a/app/assets/javascripts/editor/editor_lite.js
+++ b/app/assets/javascripts/editor/editor_lite.js
@@ -11,6 +11,7 @@ export default class Editor {
this.instance = null;
this.model = null;
this.options = {
+ extraEditorClassName: 'gl-editor-lite',
...defaultEditorOptions,
...options,
};
diff --git a/app/assets/javascripts/vue_shared/components/confirm_modal.vue b/app/assets/javascripts/vue_shared/components/confirm_modal.vue
index c77827205d6..52ff906ccec 100644
--- a/app/assets/javascripts/vue_shared/components/confirm_modal.vue
+++ b/app/assets/javascripts/vue_shared/components/confirm_modal.vue
@@ -1,49 +1,45 @@
<script>
import { GlModal } from '@gitlab/ui';
import csrf from '~/lib/utils/csrf';
+import { uniqueId } from 'lodash';
export default {
components: {
GlModal,
},
props: {
- modalAttributes: {
- type: Object,
- required: false,
- default: () => {
- return {};
- },
- },
- path: {
- type: String,
- required: false,
- default: '',
- },
- method: {
+ selector: {
type: String,
- required: false,
- default: '',
- },
- showModal: {
- type: Boolean,
- required: false,
- default: false,
+ required: true,
},
},
- watch: {
- showModal(val) {
- if (val) {
- // Wait for v-if to render
- this.$nextTick(() => {
- this.openModal();
- });
- }
- },
+ data() {
+ return {
+ modalId: uniqueId('confirm-modal-'),
+ path: '',
+ method: '',
+ modalAttributes: {},
+ };
+ },
+ mounted() {
+ document.querySelectorAll(this.selector).forEach(button => {
+ button.addEventListener('click', e => {
+ e.preventDefault();
+
+ this.path = button.dataset.path;
+ this.method = button.dataset.method;
+ this.modalAttributes = JSON.parse(button.dataset.modalAttributes);
+ this.openModal();
+ });
+ });
},
methods: {
openModal() {
this.$refs.modal.show();
},
+ closeModal() {
+ this.$refs.modal.hide();
+ },
submitModal() {
this.$refs.form.submit();
},
@@ -54,11 +50,11 @@ export default {
<template>
<gl-modal
- v-if="showModal"
ref="modal"
+ :modal-id="modalId"
v-bind="modalAttributes"
@primary="submitModal"
- @canceled="$emit('dismiss')"
+ @cancel="closeModal"
>
<form ref="form" :action="path" method="post">
<!-- Rails workaround for <form method="delete" />
diff --git a/app/assets/stylesheets/framework.scss b/app/assets/stylesheets/framework.scss
index 9032dd28b80..338a8c5497c 100644
--- a/app/assets/stylesheets/framework.scss
+++ b/app/assets/stylesheets/framework.scss
@@ -70,3 +70,4 @@
@import 'framework/system_messages';
@import "framework/spinner";
@import 'framework/card';
+@import 'framework/editor-lite';
diff --git a/app/assets/stylesheets/framework/editor-lite.scss b/app/assets/stylesheets/framework/editor-lite.scss
new file mode 100644
index 00000000000..75d511d7f66
--- /dev/null
+++ b/app/assets/stylesheets/framework/editor-lite.scss
@@ -0,0 +1,5 @@
+.monaco-editor.gl-editor-lite {
+ .line-numbers {
+ @include gl-pt-0;
+ }
+}
diff --git a/app/controllers/dashboard/projects_controller.rb b/app/controllers/dashboard/projects_controller.rb
index 039991e07a2..711be67f8f9 100644
--- a/app/controllers/dashboard/projects_controller.rb
+++ b/app/controllers/dashboard/projects_controller.rb
@@ -33,7 +33,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
def starred
@projects = load_projects(params.merge(starred: true))
- .includes(:forked_from_project, :tags)
+ .includes(:forked_from_project, :tags).page(params[:page])
@groups = []
@@ -51,7 +51,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
private
def projects
- @projects ||= load_projects(params.merge(non_public: true))
+ @projects ||= load_projects(params.merge(non_public: true)).page(params[:page])
end
def render_projects
@@ -73,7 +73,6 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
.execute
.includes(:route, :creator, :group, namespace: [:route, :owner])
.preload(:project_feature)
- .page(finder_params[:page])
prepare_projects_for_rendering(projects)
end