fix: Fix styling of navigation input fields
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -35,7 +35,7 @@ describe('Board', function() {
|
|||||||
.type(board, { force: true })
|
.type(board, { force: true })
|
||||||
|
|
||||||
// Submit
|
// Submit
|
||||||
cy.get('.board-create form input[type=submit]')
|
cy.get('.board-create form button[type=submit]')
|
||||||
.first().click({ force: true })
|
.first().click({ force: true })
|
||||||
|
|
||||||
cy.wait('@createBoardRequest').its('response.statusCode').should('equal', 200)
|
cy.wait('@createBoardRequest').its('response.statusCode').should('equal', 200)
|
||||||
|
|||||||
@@ -8,19 +8,41 @@
|
|||||||
icon="icon-add"
|
icon="icon-add"
|
||||||
@click.prevent.stop="startCreateBoard" />
|
@click.prevent.stop="startCreateBoard" />
|
||||||
<div v-else class="board-create">
|
<div v-else class="board-create">
|
||||||
<NcColorPicker v-model="color" class="app-navigation-entry-bullet-wrapper">
|
<NcColorPicker v-model="color" class="app-navigation-entry-bullet-wrapper" :disabled="loading">
|
||||||
<div :style="{ backgroundColor: color }" class="color0 icon-colorpicker app-navigation-entry-bullet" />
|
<div :style="{ backgroundColor: color }" class="color0 icon-colorpicker app-navigation-entry-bullet" />
|
||||||
</NcColorPicker>
|
</NcColorPicker>
|
||||||
<form @submit.prevent.stop="createBoard">
|
<form @submit.prevent.stop="createBoard">
|
||||||
<input :placeholder="t('deck', 'Board name')" type="text" required>
|
<NcTextField ref="inputField"
|
||||||
<input type="submit" value="" class="icon-confirm">
|
:disable="loading"
|
||||||
<NcActions><NcActionButton icon="icon-close" @click.stop.prevent="cancelEdit" /></NcActions>
|
:value.sync="value"
|
||||||
|
:placeholder="t('deck', 'Board name')"
|
||||||
|
type="text"
|
||||||
|
required />
|
||||||
|
<NcButton type="tertiary"
|
||||||
|
:disabled="loading"
|
||||||
|
:title="t('deck', 'Cancel edit')"
|
||||||
|
@click.stop.prevent="cancelEdit">
|
||||||
|
<template #icon>
|
||||||
|
<CloseIcon :size="20" />
|
||||||
|
</template>
|
||||||
|
</NcButton>
|
||||||
|
<NcButton type="tertiary"
|
||||||
|
native-type="submit"
|
||||||
|
:disabled="loading"
|
||||||
|
:title="t('deck', 'Save board')">
|
||||||
|
<template #icon>
|
||||||
|
<CheckIcon v-if="!loading" :size="20" />
|
||||||
|
<NcLoadingIcon v-else :size="20" />
|
||||||
|
</template>
|
||||||
|
</NcButton>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { NcColorPicker, NcActionButton, NcActions, NcAppNavigationItem } from '@nextcloud/vue'
|
import { NcButton, NcColorPicker, NcAppNavigationItem, NcLoadingIcon, NcTextField } from '@nextcloud/vue'
|
||||||
|
import CheckIcon from 'vue-material-design-icons/Check.vue'
|
||||||
|
import CloseIcon from 'vue-material-design-icons/Close.vue'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -35,30 +57,33 @@ function randomColor() {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AppNavigationAddBoard',
|
name: 'AppNavigationAddBoard',
|
||||||
components: { NcColorPicker, NcAppNavigationItem, NcActionButton, NcActions },
|
components: { NcButton, NcColorPicker, NcAppNavigationItem, NcLoadingIcon, NcTextField, CheckIcon, CloseIcon },
|
||||||
directives: {},
|
directives: {},
|
||||||
props: {},
|
props: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
value: '',
|
||||||
classes: [],
|
classes: [],
|
||||||
editing: false,
|
editing: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
color: randomColor(),
|
color: randomColor(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {},
|
mounted() {
|
||||||
watch: {},
|
this.$refs.inputField.focus()
|
||||||
mounted() {},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
startCreateBoard(e) {
|
startCreateBoard(e) {
|
||||||
this.editing = true
|
this.editing = true
|
||||||
},
|
},
|
||||||
async createBoard(e) {
|
async createBoard(e) {
|
||||||
const title = e.currentTarget.childNodes[0].value
|
this.loading = true
|
||||||
|
const title = this.value.trim()
|
||||||
await this.$store.dispatch('createBoard', {
|
await this.$store.dispatch('createBoard', {
|
||||||
title,
|
title,
|
||||||
color: this.color.substring(1),
|
color: this.color.substring(1),
|
||||||
})
|
})
|
||||||
|
this.loading = false
|
||||||
this.editing = false
|
this.editing = false
|
||||||
this.color = randomColor()
|
this.color = randomColor()
|
||||||
},
|
},
|
||||||
@@ -89,10 +114,9 @@ export default {
|
|||||||
width: var(--default-clickable-area);
|
width: var(--default-clickable-area);
|
||||||
height: var(--default-clickable-area);
|
height: var(--default-clickable-area);
|
||||||
.color0 {
|
.color0 {
|
||||||
width: 30px !important;
|
width: 24px !important;
|
||||||
margin: 5px;
|
margin: var(--default-grid-baseline);
|
||||||
margin-left: 7px;
|
height: 24px;
|
||||||
height: 30px;
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background-size: 14px;
|
background-size: 14px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,23 +114,43 @@
|
|||||||
<div :style="{ backgroundColor: getColor }" class="color0 icon-colorpicker app-navigation-entry-bullet" />
|
<div :style="{ backgroundColor: getColor }" class="color0 icon-colorpicker app-navigation-entry-bullet" />
|
||||||
</NcColorPicker>
|
</NcColorPicker>
|
||||||
<form @submit.prevent.stop="applyEdit">
|
<form @submit.prevent.stop="applyEdit">
|
||||||
<input v-model="editTitle"
|
<NcTextField ref="inputField"
|
||||||
v-focus
|
:disable="loading"
|
||||||
dir="auto"
|
:value.sync="editTitle"
|
||||||
|
:placeholder="t('deck', 'Board name')"
|
||||||
type="text"
|
type="text"
|
||||||
required>
|
required />
|
||||||
<input type="submit" value="" class="icon-confirm">
|
<NcButton type="tertiary"
|
||||||
<NcActions><NcActionButton icon="icon-close" @click.stop.prevent="cancelEdit" /></NcActions>
|
:disabled="loading"
|
||||||
|
native-type="submit"
|
||||||
|
:title="t('deck', 'Cancel edit')"
|
||||||
|
@click.stop.prevent="cancelEdit">
|
||||||
|
<template #icon>
|
||||||
|
<CloseIcon :size="20" />
|
||||||
|
</template>
|
||||||
|
</NcButton>
|
||||||
|
<NcButton type="tertiary"
|
||||||
|
native-type="submit"
|
||||||
|
:disabled="loading"
|
||||||
|
:title="t('deck', 'Save board')">
|
||||||
|
<template #icon>
|
||||||
|
<CheckIcon v-if="!loading" :size="20" />
|
||||||
|
<NcLoadingIcon v-else :size="20" />
|
||||||
|
</template>
|
||||||
|
</NcButton>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { NcAppNavigationIconBullet, NcAppNavigationItem, NcColorPicker, NcActions, NcActionButton } from '@nextcloud/vue'
|
import { NcAppNavigationIconBullet, NcAppNavigationItem, NcColorPicker, NcButton, NcTextField, NcActionButton } from '@nextcloud/vue'
|
||||||
import ClickOutside from 'vue-click-outside'
|
import ClickOutside from 'vue-click-outside'
|
||||||
import ArchiveIcon from 'vue-material-design-icons/Archive.vue'
|
import ArchiveIcon from 'vue-material-design-icons/Archive.vue'
|
||||||
import CloneIcon from 'vue-material-design-icons/ContentDuplicate.vue'
|
import CloneIcon from 'vue-material-design-icons/ContentDuplicate.vue'
|
||||||
import AccountIcon from 'vue-material-design-icons/Account.vue'
|
import AccountIcon from 'vue-material-design-icons/Account.vue'
|
||||||
|
import CloseIcon from 'vue-material-design-icons/Close.vue'
|
||||||
|
import CheckIcon from 'vue-material-design-icons/Check.vue'
|
||||||
|
|
||||||
import { loadState } from '@nextcloud/initial-state'
|
import { loadState } from '@nextcloud/initial-state'
|
||||||
|
|
||||||
const canCreateState = loadState('deck', 'canCreate')
|
const canCreateState = loadState('deck', 'canCreate')
|
||||||
@@ -141,11 +161,14 @@ export default {
|
|||||||
NcAppNavigationIconBullet,
|
NcAppNavigationIconBullet,
|
||||||
NcAppNavigationItem,
|
NcAppNavigationItem,
|
||||||
NcColorPicker,
|
NcColorPicker,
|
||||||
NcActions,
|
NcButton,
|
||||||
|
NcTextField,
|
||||||
NcActionButton,
|
NcActionButton,
|
||||||
AccountIcon,
|
AccountIcon,
|
||||||
ArchiveIcon,
|
ArchiveIcon,
|
||||||
CloneIcon,
|
CloneIcon,
|
||||||
|
CloseIcon,
|
||||||
|
CheckIcon,
|
||||||
},
|
},
|
||||||
directives: {
|
directives: {
|
||||||
ClickOutside,
|
ClickOutside,
|
||||||
@@ -319,7 +342,7 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.board-edit {
|
.board-edit {
|
||||||
margin-left: var(--default-clickable-area);
|
margin-left: calc(var(--default-clickable-area) / 2);
|
||||||
order: 1;
|
order: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
height: var(--default-clickable-area);
|
height: var(--default-clickable-area);
|
||||||
@@ -338,10 +361,9 @@ export default {
|
|||||||
width: var(--default-clickable-area);
|
width: var(--default-clickable-area);
|
||||||
height: var(--default-clickable-area);
|
height: var(--default-clickable-area);
|
||||||
.color0 {
|
.color0 {
|
||||||
width: 30px !important;
|
width: 24px !important;
|
||||||
margin: 5px;
|
margin: var(--default-grid-baseline);
|
||||||
margin-left: 7px;
|
height: 24px;
|
||||||
height: 30px;
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background-size: 14px;
|
background-size: 14px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user