Commit 40f7eac5 authored by Marcel van Remmerden's avatar Marcel van Remmerden Committed by Miguel Rincon

Adding translations for file view tooltip

This updates the translation file with the new file view tooltip.
parent c93986fe
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { GlLink, GlTooltipDirective } from '@gitlab/ui';
import TerminalSyncStatusSafe from './terminal_sync/terminal_sync_status_safe.vue'; import TerminalSyncStatusSafe from './terminal_sync/terminal_sync_status_safe.vue';
import { getFileEOL } from '../utils'; import { getFileEOL } from '../utils';
export default { export default {
components: { components: {
GlLink,
TerminalSyncStatusSafe, TerminalSyncStatusSafe,
}, },
directives: {
GlTooltip: GlTooltipDirective,
},
computed: { computed: {
...mapGetters(['activeFile']), ...mapGetters(['activeFile']),
activeFileEOL() { activeFileEOL() {
...@@ -19,12 +24,14 @@ export default { ...@@ -19,12 +24,14 @@ export default {
<template> <template>
<div class="ide-status-list d-flex"> <div class="ide-status-list d-flex">
<template v-if="activeFile"> <template v-if="activeFile">
<div class="ide-status-file">{{ activeFile.name }}</div> <div>
<div class="ide-status-file">{{ activeFileEOL }}</div> <gl-link v-gl-tooltip.hover :href="activeFile.permalink" :title="__('Open in file view')">
<div v-if="!activeFile.binary" class="ide-status-file"> {{ activeFile.name }}
{{ activeFile.editorRow }}:{{ activeFile.editorColumn }} </gl-link>
</div> </div>
<div class="ide-status-file">{{ activeFile.fileLanguage }}</div> <div>{{ activeFileEOL }}</div>
<div v-if="!activeFile.binary">{{ activeFile.editorRow }}:{{ activeFile.editorColumn }}</div>
<div>{{ activeFile.fileLanguage }}</div>
</template> </template>
<terminal-sync-status-safe /> <terminal-sync-status-safe />
</div> </div>
......
...@@ -251,10 +251,6 @@ $ide-commit-header-height: 48px; ...@@ -251,10 +251,6 @@ $ide-commit-header-height: 48px;
padding-left: $gl-padding; padding-left: $gl-padding;
} }
} }
.ide-status-file {
text-align: right;
}
// Not great, but this is to deal with our current output // Not great, but this is to deal with our current output
.multi-file-preview-holder { .multi-file-preview-holder {
height: 100%; height: 100%;
......
---
title: Move file link to bottom in Web IDE
merge_request: 35847
author:
type: changed
...@@ -15928,6 +15928,9 @@ msgstr "" ...@@ -15928,6 +15928,9 @@ msgstr ""
msgid "Open in Xcode" msgid "Open in Xcode"
msgstr "" msgstr ""
msgid "Open in file view"
msgstr ""
msgid "Open issues" msgid "Open issues"
msgstr "" msgstr ""
......
import Vuex from 'vuex'; import Vuex from 'vuex';
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { createLocalVue, shallowMount } from '@vue/test-utils';
import { GlLink } from '@gitlab/ui';
import IdeStatusList from '~/ide/components/ide_status_list.vue'; import IdeStatusList from '~/ide/components/ide_status_list.vue';
import TerminalSyncStatusSafe from '~/ide/components/terminal_sync/terminal_sync_status_safe.vue'; import TerminalSyncStatusSafe from '~/ide/components/terminal_sync/terminal_sync_status_safe.vue';
...@@ -9,6 +10,7 @@ const TEST_FILE = { ...@@ -9,6 +10,7 @@ const TEST_FILE = {
editorColumn: 23, editorColumn: 23,
fileLanguage: 'markdown', fileLanguage: 'markdown',
content: 'abc\nndef', content: 'abc\nndef',
permalink: '/lorem.md',
}; };
const localVue = createLocalVue(); const localVue = createLocalVue();
...@@ -19,6 +21,7 @@ describe('ide/components/ide_status_list', () => { ...@@ -19,6 +21,7 @@ describe('ide/components/ide_status_list', () => {
let store; let store;
let wrapper; let wrapper;
const findLink = () => wrapper.find(GlLink);
const createComponent = (options = {}) => { const createComponent = (options = {}) => {
store = new Vuex.Store({ store = new Vuex.Store({
getters: { getters: {
...@@ -51,8 +54,9 @@ describe('ide/components/ide_status_list', () => { ...@@ -51,8 +54,9 @@ describe('ide/components/ide_status_list', () => {
createComponent(); createComponent();
}); });
it('shows file name', () => { it('shows a link to the file that contains the file name', () => {
expect(wrapper.text()).toContain(TEST_FILE.name); expect(findLink().attributes('href')).toBe(TEST_FILE.permalink);
expect(findLink().text()).toBe(TEST_FILE.name);
}); });
it('shows file eol', () => { it('shows file eol', () => {
......
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