Skip to content

Commit

Permalink
Replace custom input field with NcTextField
Browse files Browse the repository at this point in the history
Signed-off-by: julia.kirschenheuter <[email protected]>
  • Loading branch information
JuliaKirschenheuter committed Aug 31, 2023
1 parent 931ab2e commit 29807fc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
7 changes: 5 additions & 2 deletions apps/settings/src/components/AuthToken.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@
<div :class="iconName.icon" />
</td>
<td class="token-name">
<input v-if="token.canRename && renaming"
<NcTextField v-if="token.canRename && renaming"
ref="input"
v-model="newName"
type="text"
:label="t('settings', 'Device name')"
@keyup.enter="rename"
@change="rename"
@keyup.esc="cancelRename">
@keyup.esc="cancelRename" />
<span v-else>{{ iconName.name }}</span>
<span v-if="wiping" class="wiping-warning">({{ t('settings', 'Marked for remote wipe') }})</span>
</td>
Expand Down Expand Up @@ -86,6 +87,7 @@
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import NcActionCheckbox from '@nextcloud/vue/dist/Components/NcActionCheckbox.js'
import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'
// When using capture groups the following parts are extracted the first is used as the version number, the second as the OS
const userAgentMap = {
Expand Down Expand Up @@ -157,6 +159,7 @@ export default {
NcActions,
NcActionButton,
NcActionCheckbox,
NcTextField,
},
props: {
token: {
Expand Down
12 changes: 8 additions & 4 deletions apps/settings/src/components/AuthTokenSetupDialogue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
<template>
<div v-if="!adding" id="generate-app-token-section" class="row spacing">
<!-- Port to TextField component when available -->
<input v-model="deviceName"
<NcTextField v-model="deviceName"
type="text"
:maxlength="120"
:disabled="loading"
class="app-name-text-field"
:label="t('settings', 'App name')"
:placeholder="t('settings', 'App name')"
@keydown.enter="submit">
@keydown.enter="submit" />
<NcButton :disabled="loading || deviceName.length === 0"
type="primary"
@click="submit">
Expand Down Expand Up @@ -87,6 +89,7 @@ import '@nextcloud/password-confirmation/dist/style.css'
import { showError } from '@nextcloud/dialogs'
import { getRootUrl } from '@nextcloud/router'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'
import Check from 'vue-material-design-icons/Check.vue'
import ContentCopy from 'vue-material-design-icons/ContentCopy.vue'
Expand All @@ -98,6 +101,7 @@ export default {
ContentCopy,
NcButton,
QR,
NcTextField,
},
props: {
add: {
Expand Down Expand Up @@ -205,9 +209,9 @@ export default {
width: 100px;
}
.row input {
.app-name-text-field {
height: 44px !important;
padding: 7px 12px;
padding-left: 12px;
margin-right: 12px;
width: 200px;
}
Expand Down
4 changes: 2 additions & 2 deletions dist/settings-vue-settings-personal-security.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-personal-security.js.map

Large diffs are not rendered by default.

0 comments on commit 29807fc

Please sign in to comment.