diff options
author | Clement Ho <clemmakesapps@gmail.com> | 2018-05-10 16:00:33 +0000 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2018-05-10 16:00:33 +0000 |
commit | d77433a8ff87959d1e7bafd5aca093975106b891 (patch) | |
tree | 18913b14f8bcec7adf57e8abb36c880f6ccb23f3 /app/assets | |
parent | f6e47f6f222380eead684ae8ba0ae522f7fcd789 (diff) | |
parent | 0afcfd31bdf8d23bc180d5a36796aba8e66dbd33 (diff) | |
download | gitlab-ce-d77433a8ff87959d1e7bafd5aca093975106b891.tar.gz |
Merge branch 'master' into 'bootstrap4'
# Conflicts:
# app/views/shared/runners/_form.html.haml
Diffstat (limited to 'app/assets')
8 files changed, 44 insertions, 45 deletions
diff --git a/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js b/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js index 87f8854f940..1c43fc3cdc7 100644 --- a/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js +++ b/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js @@ -82,7 +82,6 @@ export default () => { this.service .fetchCycleAnalyticsData(fetchOptions) - .then(resp => resp.json()) .then((response) => { this.store.setCycleAnalyticsData(response); this.selectDefaultStage(); @@ -116,7 +115,6 @@ export default () => { stage, startDate: this.startDate, }) - .then(resp => resp.json()) .then((response) => { this.isEmptyStage = !response.events.length; this.store.setStageEvents(response.events, stage); diff --git a/app/assets/javascripts/cycle_analytics/cycle_analytics_service.js b/app/assets/javascripts/cycle_analytics/cycle_analytics_service.js index f496c38208d..4cf416c50e5 100644 --- a/app/assets/javascripts/cycle_analytics/cycle_analytics_service.js +++ b/app/assets/javascripts/cycle_analytics/cycle_analytics_service.js @@ -1,16 +1,20 @@ -import Vue from 'vue'; -import VueResource from 'vue-resource'; - -Vue.use(VueResource); +import axios from '~/lib/utils/axios_utils'; export default class CycleAnalyticsService { constructor(options) { - this.requestPath = options.requestPath; - this.cycleAnalytics = Vue.resource(this.requestPath); + this.axios = axios.create({ + baseURL: options.requestPath, + }); } fetchCycleAnalyticsData(options = { startDate: 30 }) { - return this.cycleAnalytics.get({ cycle_analytics: { start_date: options.startDate } }); + return this.axios + .get('', { + params: { + 'cycle_analytics[start_date]': options.startDate, + }, + }) + .then(x => x.data); } fetchStageData(options) { @@ -19,12 +23,12 @@ export default class CycleAnalyticsService { startDate, } = options; - return Vue.http.get(`${this.requestPath}/events/${stage.name}.json`, { - params: { - cycle_analytics: { - start_date: startDate, + return this.axios + .get(`events/${stage.name}.json`, { + params: { + 'cycle_analytics[start_date]': startDate, }, - }, - }); + }) + .then(x => x.data); } } diff --git a/app/assets/javascripts/deploy_keys/service/index.js b/app/assets/javascripts/deploy_keys/service/index.js index 194e95e4fca..9dc3b21f6f6 100644 --- a/app/assets/javascripts/deploy_keys/service/index.js +++ b/app/assets/javascripts/deploy_keys/service/index.js @@ -1,37 +1,24 @@ -import Vue from 'vue'; -import VueResource from 'vue-resource'; - -Vue.use(VueResource); +import axios from '~/lib/utils/axios_utils'; export default class DeployKeysService { constructor(endpoint) { - this.endpoint = endpoint; - - this.resource = Vue.resource( - `${this.endpoint}{/id}`, - {}, - { - enable: { - method: 'PUT', - url: `${this.endpoint}{/id}/enable`, - }, - disable: { - method: 'PUT', - url: `${this.endpoint}{/id}/disable`, - }, - }, - ); + this.axios = axios.create({ + baseURL: endpoint, + }); } getKeys() { - return this.resource.get().then(response => response.json()); + return this.axios.get() + .then(response => response.data); } enableKey(id) { - return this.resource.enable({ id }, {}); + return this.axios.put(`${id}/enable`) + .then(response => response.data); } disableKey(id) { - return this.resource.disable({ id }, {}); + return this.axios.put(`${id}/disable`) + .then(response => response.data); } } diff --git a/app/assets/javascripts/ide/components/commit_sidebar/actions.vue b/app/assets/javascripts/ide/components/commit_sidebar/actions.vue index 6a5790c9dff..b4f3778d946 100644 --- a/app/assets/javascripts/ide/components/commit_sidebar/actions.vue +++ b/app/assets/javascripts/ide/components/commit_sidebar/actions.vue @@ -1,5 +1,5 @@ <script> -import { mapActions, mapState } from 'vuex'; +import { mapActions, mapState, mapGetters } from 'vuex'; import { sprintf, __ } from '~/locale'; import * as consts from '../../stores/modules/commit/constants'; import RadioGroup from './radio_group.vue'; @@ -10,6 +10,7 @@ export default { }, computed: { ...mapState(['currentBranchId', 'changedFiles', 'stagedFiles']), + ...mapGetters(['currentProject']), commitToCurrentBranchText() { return sprintf( __('Commit to %{branchName} branch'), @@ -52,6 +53,7 @@ export default { :show-input="true" /> <radio-group + v-if="currentProject.merge_requests_enabled" :value="$options.commitToNewBranchMR" :label="__('Create a new branch and merge request')" :show-input="true" diff --git a/app/assets/javascripts/ide/components/ide.vue b/app/assets/javascripts/ide/components/ide.vue index c328d1f36d2..cf2566b8019 100644 --- a/app/assets/javascripts/ide/components/ide.vue +++ b/app/assets/javascripts/ide/components/ide.vue @@ -110,8 +110,8 @@ export default { Welcome to the GitLab IDE </h4> <p> - You can select a file in the left sidebar to begin - editing and use the right sidebar to commit your changes. + Select a file from the left sidebar to begin editing. + Afterwards, you'll be able to commit your changes. </p> </div> </div> diff --git a/app/assets/javascripts/ide/lib/common/model.js b/app/assets/javascripts/ide/lib/common/model.js index 016dcda1fa1..b1e43a1e38c 100644 --- a/app/assets/javascripts/ide/lib/common/model.js +++ b/app/assets/javascripts/ide/lib/common/model.js @@ -14,12 +14,12 @@ export default class Model { (this.originalModel = this.monaco.editor.createModel( head ? head.content : this.file.raw, undefined, - new this.monaco.Uri(null, null, `original/${this.file.key}`), + new this.monaco.Uri(null, null, `original/${this.path}`), )), (this.model = this.monaco.editor.createModel( this.content, undefined, - new this.monaco.Uri(null, null, this.file.key), + new this.monaco.Uri(null, null, this.path), )), ); if (this.file.mrChange) { @@ -27,7 +27,7 @@ export default class Model { (this.baseModel = this.monaco.editor.createModel( this.file.baseRaw, undefined, - new this.monaco.Uri(null, null, `target/${this.file.path}`), + new this.monaco.Uri(null, null, `target/${this.path}`), )), ); } diff --git a/app/assets/javascripts/ide/stores/actions/file.js b/app/assets/javascripts/ide/stores/actions/file.js index 3ac9b9222ca..b6baa693104 100644 --- a/app/assets/javascripts/ide/stores/actions/file.js +++ b/app/assets/javascripts/ide/stores/actions/file.js @@ -196,6 +196,8 @@ export const unstageChange = ({ commit }, path) => { }; export const openPendingTab = ({ commit, getters, dispatch, state }, { file, keyPrefix }) => { + if (getters.activeFile && getters.activeFile.key === `${keyPrefix}-${file.key}`) return false; + state.openFiles.forEach(f => eventHub.$emit(`editor.update.model.dispose.${f.key}`)); commit(types.ADD_PENDING_TAB, { file, keyPrefix }); diff --git a/app/assets/stylesheets/print.scss b/app/assets/stylesheets/print.scss index b07a5ae22cd..90ccd4abd90 100644 --- a/app/assets/stylesheets/print.scss +++ b/app/assets/stylesheets/print.scss @@ -36,7 +36,9 @@ ul.notes-form, .gutter-toggle, .issuable-details .content-block-small, .edit-link, -.note-action-button { +.note-action-button, +.right-sidebar, +.flash-container { display: none !important; } @@ -53,3 +55,7 @@ pre { .right-sidebar { top: 0; } + +a[href]::after { + content: none !important; +} |