Commit 088de723 authored by Filipa Lacerda's avatar Filipa Lacerda

[ci skip] Fix more eslint rules

parent 7c7f5266
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import LineHighlighter from '../../line_highlighter'; import LineHighlighter from '../../line_highlighter';
import syntaxHighlight from '../../syntax_highlight'; import syntaxHighlight from '../../syntax_highlight';
export default { export default {
computed: { computed: {
...mapGetters([ ...mapGetters([
'activeFile', 'activeFile',
]), ]),
renderErrorTooLarge() { renderErrorTooLarge() {
return this.activeFile.renderError === 'too_large'; return this.activeFile.renderError === 'too_large';
},
}, },
}, mounted() {
methods: {
highlightFile() {
syntaxHighlight($(this.$el).find('.file-content'));
},
},
mounted() {
this.highlightFile();
this.lineHighlighter = new LineHighlighter({
fileHolderSelector: '.blob-viewer-container',
scrollFileHolder: true,
});
},
updated() {
this.$nextTick(() => {
this.highlightFile(); this.highlightFile();
}); this.lineHighlighter = new LineHighlighter({
}, fileHolderSelector: '.blob-viewer-container',
}; scrollFileHolder: true,
});
},
updated() {
this.$nextTick(() => {
this.highlightFile();
});
},
methods: {
highlightFile() {
syntaxHighlight($(this.$el).find('.file-content'));
},
},
};
</script> </script>
<template> <template>
<div> <div>
<div <div
v-if="!activeFile.renderError" v-if="!activeFile.renderError"
v-html="activeFile.html" v-html="activeFile.html"
class="multi-file-preview-holder" class="multi-file-preview-holder"
> >
</div> </div>
<div <div
v-else-if="activeFile.tempFile" v-else-if="activeFile.tempFile"
class="vertical-center render-error"> class="vertical-center render-error">
<p class="text-center"> <p class="text-center">
The source could not be displayed for this temporary file. The source could not be displayed for this temporary file.
</p> </p>
</div> </div>
<div <div
v-else-if="renderErrorTooLarge" v-else-if="renderErrorTooLarge"
class="vertical-center render-error"> class="vertical-center render-error">
<p class="text-center"> <p class="text-center">
The source could not be displayed because it is too large. You can <a :href="activeFile.rawPath" download>download</a> it instead. The source could not be displayed because it is too large.
</p> You can <a
</div> :href="activeFile.rawPath"
<div download>download</a> it instead.
v-else </p>
class="vertical-center render-error"> </div>
<p class="text-center"> <div
The source could not be displayed because a rendering error occurred. You can <a :href="activeFile.rawPath" download>download</a> it instead. v-else
</p> class="vertical-center render-error">
<p class="text-center">
The source could not be displayed because a rendering error occurred.
You can <a
:href="activeFile.rawPath"
download>download</a> it instead.
</p>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import fileIcon from '../../vue_shared/components/file_icon.vue'; import fileIcon from '../../vue_shared/components/file_icon.vue';
export default { export default {
props: { components: {
tab: { fileIcon,
type: Object,
required: true,
}, },
}, props: {
components: { tab: {
fileIcon, type: Object,
}, required: true,
computed: { },
closeLabel() {
if (this.tab.changed || this.tab.tempFile) {
return `${this.tab.name} changed`;
}
return `Close ${this.tab.name}`;
}, },
changedClass() { computed: {
const tabChangedObj = { closeLabel() {
'fa-times close-icon': !this.tab.changed && !this.tab.tempFile, if (this.tab.changed || this.tab.tempFile) {
'fa-circle unsaved-icon': this.tab.changed || this.tab.tempFile, return `${this.tab.name} changed`;
}; }
return tabChangedObj; return `Close ${this.tab.name}`;
},
changedClass() {
const tabChangedObj = {
'fa-times close-icon': !this.tab.changed && !this.tab.tempFile,
'fa-circle unsaved-icon': this.tab.changed || this.tab.tempFile,
};
return tabChangedObj;
},
}, },
},
methods: { methods: {
...mapActions([ ...mapActions([
'closeFile', 'closeFile',
]), ]),
clickFile(tab) { clickFile(tab) {
this.$router.push(`/project${tab.url}`); this.$router.push(`/project${tab.url}`);
},
}, },
}, };
};
</script> </script>
<template> <template>
<li <li @click="clickFile(tab)">
@click="clickFile(tab)"
>
<button <button
type="button" type="button"
class="multi-file-tab-close" class="multi-file-tab-close"
...@@ -69,8 +67,7 @@ export default { ...@@ -69,8 +67,7 @@ export default {
<file-icon <file-icon
:file-name="tab.name" :file-name="tab.name"
:size="16" :size="16"
> />
</file-icon>
{{ tab.name }} {{ tab.name }}
</div> </div>
</li> </li>
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
import markdownField from '../../../vue_shared/components/markdown/field.vue'; import markdownField from '../../../vue_shared/components/markdown/field.vue';
export default { export default {
mixins: [updateMixin],
components: { components: {
markdownField, markdownField,
}, },
mixins: [updateMixin],
props: { props: {
formState: { formState: {
type: Object, type: Object,
......
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
import { spriteIcon } from '../../lib/utils/common_utils'; import { spriteIcon } from '../../lib/utils/common_utils';
export default { export default {
mixins: [animateMixin],
directives: { directives: {
tooltip, tooltip,
}, },
mixins: [animateMixin],
props: { props: {
issuableRef: { issuableRef: {
type: String, type: String,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import loadingIcon from '../../vue_shared/components/loading_icon.vue'; import loadingIcon from '../../vue_shared/components/loading_icon.vue';
export default { export default {
name: 'jobHeaderSection', name: 'JobHeaderSection',
components: { components: {
ciHeader, ciHeader,
loadingIcon, loadingIcon,
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
mixins: [MonitoringMixin], mixins: [MonitoringMixin],
props: { props: {
graphData: { graphData: {
type: Object, type: Object,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment