Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/script ordering #223

Merged
merged 4 commits into from
Nov 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ module.exports = {
},
],
'space-before-blocks': 'error',
'vue/component-tags-order': [
'error',
{
'order': ['script', 'template', 'style'],
}
],
},
settings: {
'import/resolver': {
Expand Down
12 changes: 6 additions & 6 deletions client/components/bar-loader.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<script>
export default {
name: 'bar-loader',
};
</script>

<template>
<loader class="bar"
><div></div>
Expand All @@ -6,12 +12,6 @@
></loader>
</template>

<script>
export default {
name: 'bar-loader',
};
</script>

<style lang="stylus">
@require "../styles/definitions.styl"

Expand Down
38 changes: 19 additions & 19 deletions client/components/button-fill.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
<template>
<component
:aria-disabled="disabled"
class="button-fill"
:class="{
disabled: disabled,
[color]: color,
}"
:disabled="disabled"
:href="href"
:is="tag"
:to="to"
:title="disabledLabelText"
@click="onClick"
>
{{ label }}
</component>
</template>

<script>
export default {
name: 'button-fill',
Expand Down Expand Up @@ -61,6 +42,25 @@ export default {
};
</script>

<template>
<component
:aria-disabled="disabled"
class="button-fill"
:class="{
disabled: disabled,
[color]: color,
}"
:disabled="disabled"
:href="href"
:is="tag"
:to="to"
:title="disabledLabelText"
@click="onClick"
>
{{ label }}
</component>
</template>

<style lang="stylus">
.button-fill {
border: none;
Expand Down
44 changes: 22 additions & 22 deletions client/components/button-icon.vue
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
<template>
<component
:aria-disabled="disabled"
class="button-icon"
:class="{ disabled: disabled }"
:disabled="disabled"
:href="href"
:is="tag"
:to="to"
@click="onClick"
>
<span
class="icon"
:class="{ [icon]: icon, [color]: color }"
:style="{ 'font-size': size }"
/>
<span class="label" :class="{ [color]: color }" v-if="label">{{
label
}}</span>
</component>
</template>

<script>
export default {
name: 'button-icon',
Expand Down Expand Up @@ -62,6 +40,28 @@ export default {
};
</script>

<template>
<component
:aria-disabled="disabled"
class="button-icon"
:class="{ disabled: disabled }"
:disabled="disabled"
:href="href"
:is="tag"
:to="to"
@click="onClick"
>
<span
class="icon"
:class="{ [icon]: icon, [color]: color }"
:style="{ 'font-size': size }"
/>
<span class="label" :class="{ [color]: color }" v-if="label">{{
label
}}</span>
</component>
</template>

<style lang="stylus">
.button-icon {
background-color: transparent;
Expand Down
8 changes: 4 additions & 4 deletions client/components/copy.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<template>
<a href="#" class="copy" @click.prevent="copy"></a>
</template>

<script>
export default {
name: 'copy',
Expand Down Expand Up @@ -34,6 +30,10 @@ export default {
};
</script>

<template>
<a href="#" class="copy" @click.prevent="copy"></a>
</template>

<style lang="stylus">
@require "../styles/definitions.styl"

Expand Down
22 changes: 11 additions & 11 deletions client/components/data-viewer.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
<template>
<div class="data-viewer">
<a
href="#"
class="view-full-screen"
@click.stop.prevent="viewFullScreen"
></a>
<prism language="json" ref="codebox">{{ item.jsonStringDisplay }}</prism>
</div>
</template>

<script>
import 'prismjs';
import 'prismjs/components/prism-json';
Expand Down Expand Up @@ -79,6 +68,17 @@ export default {
};
</script>

<template>
<div class="data-viewer">
<a
href="#"
class="view-full-screen"
@click.stop.prevent="viewFullScreen"
></a>
<prism language="json" ref="codebox">{{ item.jsonStringDisplay }}</prism>
</div>
</template>

<style lang="stylus">
@require "../styles/definitions.styl"

Expand Down
150 changes: 75 additions & 75 deletions client/components/date-range-picker/index.vue
Original file line number Diff line number Diff line change
@@ -1,78 +1,3 @@
<template>
<div class="date-range-picker">
<date-picker
range
type="datetime"
v-model="range"
:clearable="false"
:disabled-date="isDayDisabled"
:showTimePanel="showTimePanel"
:open.sync="open"
@change="onDateRangeChange"
>
<template v-slot:input>
<input
placeholder="Date Range"
readonly
type="text"
:value="rangeDisplayText"
/>
</template>
<template v-slot:sidebar>
<div class="sidebar-column sidebar-column-shortcuts">
<h5>Quick ranges</h5>
<button
class="mx-btn mx-btn-text mx-btn-shortcut"
type="button"
v-for="shortcut in shortcuts"
:key="shortcut.value"
@click="onShortcutClick(shortcut)"
>
{{ shortcut.text }}
</button>
</div>
<div class="sidebar-column sidebar-column-custom-range">
<form @submit.prevent="onCustomRangeSubmit">
<h5>Custom range</h5>
<div>
<label for="custom-range-from">From:</label>
<input
id="custom-range-from"
maxlength="19"
v-model="startTimeString"
:class="{ invalid: startTimeInvalid }"
/>
</div>
<div>
<label for="custom-range-to">To:</label>
<input
id="custom-range-to"
maxlength="19"
v-model="endTimeString"
:class="{ invalid: endTimeInvalid }"
/>
</div>
<div>
<button
class="sidebar-button"
type="submit"
:disabled="startOrEndTimeInvalid"
>
Apply
</button>
</div>
</form>
</div>
</template>
<template v-slot:footer>
<button class="mx-btn mx-btn-text" @click="onClickTimePanelLabel">
{{ timePanelLabel }}
</button>
</template>
</date-picker>
</div>
</template>

<script>
import moment from 'moment';
import DatePicker from 'vue2-datepicker';
Expand Down Expand Up @@ -191,6 +116,81 @@ export default {
};
</script>

<template>
<div class="date-range-picker">
<date-picker
range
type="datetime"
v-model="range"
:clearable="false"
:disabled-date="isDayDisabled"
:showTimePanel="showTimePanel"
:open.sync="open"
@change="onDateRangeChange"
>
<template v-slot:input>
<input
placeholder="Date Range"
readonly
type="text"
:value="rangeDisplayText"
/>
</template>
<template v-slot:sidebar>
<div class="sidebar-column sidebar-column-shortcuts">
<h5>Quick ranges</h5>
<button
class="mx-btn mx-btn-text mx-btn-shortcut"
type="button"
v-for="shortcut in shortcuts"
:key="shortcut.value"
@click="onShortcutClick(shortcut)"
>
{{ shortcut.text }}
</button>
</div>
<div class="sidebar-column sidebar-column-custom-range">
<form @submit.prevent="onCustomRangeSubmit">
<h5>Custom range</h5>
<div>
<label for="custom-range-from">From:</label>
<input
id="custom-range-from"
maxlength="19"
v-model="startTimeString"
:class="{ invalid: startTimeInvalid }"
/>
</div>
<div>
<label for="custom-range-to">To:</label>
<input
id="custom-range-to"
maxlength="19"
v-model="endTimeString"
:class="{ invalid: endTimeInvalid }"
/>
</div>
<div>
<button
class="sidebar-button"
type="submit"
:disabled="startOrEndTimeInvalid"
>
Apply
</button>
</div>
</form>
</div>
</template>
<template v-slot:footer>
<button class="mx-btn mx-btn-text" @click="onClickTimePanelLabel">
{{ timePanelLabel }}
</button>
</template>
</date-picker>
</div>
</template>

<style lang="stylus">
sidebarColumnCustomRangeWidth = 181px;
sidebarColumnShortcutsWidth = 130px;
Expand Down
Loading