Skip to content
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
21 changes: 15 additions & 6 deletions src/components/BreakoutRoomsEditor/BreakoutRoomsEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@
<template v-if="!isEditingParticipants">
<div class="breakout-rooms-editor__main">
<label class="breakout-rooms-editor__caption" for="room-number">{{ t('spreed', 'Number of breakout rooms') }} </label>
<input id="room-number"
v-model.number="amount"
<NcInputField id="room-number"
:value="amount.toString()"
class="breakout-rooms-editor__number-input"
type="number"
min="1"
max="20">
max="20"
@update:value="setAmount" />

<label class="breakout-rooms-editor__caption">{{ t('spreed', 'Assignment method') }}</label>
<fieldset>
Expand Down Expand Up @@ -82,6 +83,7 @@
<script>
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcInputField from '@nextcloud/vue/dist/Components/NcInputField.js'
import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'

import BreakoutRoomsParticipantsEditor from './BreakoutRoomsParticipantsEditor.vue'
Expand All @@ -90,10 +92,11 @@ export default {
name: 'BreakoutRoomsEditor',

components: {
NcModal,
NcCheckboxRadioSwitch,
NcButton,
BreakoutRoomsParticipantsEditor,
NcButton,
NcCheckboxRadioSwitch,
NcInputField,
NcModal,
},

props: {
Expand Down Expand Up @@ -137,6 +140,12 @@ export default {
console.debug(error)
}
},

// FIXME upstream: support of value type as Number should be added to NcInputField,
// now it breaks validation. Another option: Create NcNumberField component
setAmount(value) {
this.amount = parseFloat(value)
},
},
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/components/NewMessageForm/NewMessageForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ export default {

// Focus and select the text within the input field
focusTextDialogInput() {
// this.$refs.textFileTitleInput.$refs.inputField.$refs.input.focus()
// FIXME upstream: add support of native input methods: focus, select, etc
this.$refs.textFileTitleInput.$refs.inputField.$refs.input.select()
},

Expand Down
77 changes: 33 additions & 44 deletions src/components/SetGuestUsername.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,39 @@
-->

<template>
<!-- Guest username setting form -->
<form class="username-form"
@submit.prevent="handleChooseUserName">
<div class="username-form">
<!-- eslint-disable-next-line vue/no-v-html -->
<h3 v-html="displayNameLabel" />
<NcButton @click.prevent="handleEditUsername">

<NcButton v-if="!isEditingUsername"
@click.prevent="handleEditUsername">
{{ t('spreed', 'Edit') }}
<template #icon>
<Pencil :size="20" />
</template>
</NcButton>
<div v-if="isEditingUsername"
class="username-form__wrapper">
<input ref="usernameInput"
v-model="guestUserName"
:placeholder="t('spreed', 'Guest')"
class="username-form__input"
type="text"
@keydown.enter="handleChooseUserName"
@keydown.esc="isEditingUsername = !isEditingUsername">
<NcButton class="username-form__button"
native-type="submit"
:aria-label="t('spreed', 'Save name')"
type="tertiary">
<template #icon>
<ArrowRight :size="20" />
</template>
</NcButton>
</div>
</form>

<NcTextField v-else
ref="usernameInput"
:value.sync="guestUserName"
:placeholder="t('spreed', 'Guest')"
class="username-form__input"
:show-trailing-button="!!guestUserName"
trailing-button-icon="arrowRight"
:trailing-button-label="t('spreed', 'Save name')"
@trailing-button-click="handleChooseUserName"
@keydown.enter="handleChooseUserName"
@keydown.esc="handleEditUsername" />
</div>
</template>

<script>
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'
import escapeHtml from 'escape-html'

import Pencil from 'vue-material-design-icons/Pencil.vue'

import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'

import { setGuestUserName } from '../services/participantsService.js'

Expand All @@ -65,8 +61,8 @@ export default {

components: {
NcButton,
NcTextField,
Pencil,
ArrowRight,
},

data() {
Expand All @@ -79,12 +75,12 @@ export default {

computed: {
actorDisplayName() {
return this.$store.getters.getDisplayName()
return this.$store.getters.getDisplayName() || t('spreed', 'Guest')
},
displayNameLabel() {
return t('spreed', 'Display name: <strong>{name}</strong>', {
name: this.actorDisplayName ? this.actorDisplayName : t('spreed', 'Guest'),
})
return t('spreed', 'Display name: {name}', {
name: `<strong>${escapeHtml(this.actorDisplayName)}</strong>`,
}, undefined, { escape: false })
},
actorId() {
return this.$store.getters.getActorId()
Expand All @@ -107,7 +103,7 @@ export default {
mounted() {
// FIXME use @nextcloud/browser-storage or OCP when decided
// https://github.com/nextcloud/nextcloud-browser-storage/issues/3
this.guestUserName = localStorage.getItem('nick')
this.guestUserName = localStorage.getItem('nick') || ''
if (this.guestUserName && this.actorDisplayName !== this.guestUserName) {
// Browser storage has a name, so we use that.
if (this.actorId) {
Expand Down Expand Up @@ -152,7 +148,8 @@ export default {
this.isEditingUsername = !this.isEditingUsername
if (this.isEditingUsername) {
this.$nextTick(() => {
this.$refs.usernameInput.focus()
// FIXME upstream: add support of native input methods: focus, select, etc
this.$refs.usernameInput.$refs.inputField.$refs.input.focus()
})
}
},
Expand All @@ -162,21 +159,13 @@ export default {
</script>

<style lang="scss" scoped>

/** Username form for guest users */
.username-form {
padding: 0 12px;
margin:auto;
&__wrapper {
display: flex;
margin-top: 16px;
}
&__input {
padding-right: var(--clickable-area);
width: 230px;
}
&__button {
margin-left: -52px;
margin: 0 auto 12px;

& &__input {
width: 300px;
height: var(--default-clickable-area);
}
}

Expand Down
36 changes: 28 additions & 8 deletions src/components/SettingsDialog/SettingsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,16 @@
<h3 class="app-settings-section__hint">
{{ locationHint }}
</h3>
<input type="text"
class="app-settings-section__input"
:value="attachmentFolder"
:disabled="attachmentFolderLoading"
@click="selectAttachmentFolder">
<div class="app-settings-section__wrapper">
<NcTextField class="app-settings-section__input"
:value="attachmentFolder"
:disabled="true"
@click="selectAttachmentFolder" />
<NcButton type="primary"
@click="selectAttachmentFolder">
{{ t('spreed', 'Browse…') }}
</NcButton>
</div>
</NcAppSettingsSection>
<NcAppSettingsSection v-if="!isGuest"
id="privacy"
Expand Down Expand Up @@ -146,7 +151,9 @@ import { generateUrl } from '@nextcloud/router'

import NcAppSettingsDialog from '@nextcloud/vue/dist/Components/NcAppSettingsDialog.js'
import NcAppSettingsSection from '@nextcloud/vue/dist/Components/NcAppSettingsSection.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'

import MediaDevicesPreview from '../MediaDevicesPreview.vue'

Expand All @@ -159,7 +166,9 @@ export default {
MediaDevicesPreview,
NcAppSettingsDialog,
NcAppSettingsSection,
NcButton,
NcCheckboxRadioSwitch,
NcTextField,
},

data() {
Expand Down Expand Up @@ -247,7 +256,7 @@ export default {
try {
await this.$store.dispatch(
'updateReadStatusPrivacy',
this.readStatusPrivacyIsPublic ? PRIVACY.PRIVATE : PRIVACY.PUBLIC
this.readStatusPrivacyIsPublic ? PRIVACY.PRIVATE : PRIVACY.PUBLIC,
)
showSuccess(t('spreed', 'Your privacy setting has been saved'))
} catch (exception) {
Expand Down Expand Up @@ -298,8 +307,19 @@ export default {
color: var(--color-text-lighter);
padding: 8px 0;
}
&__input {
width: 100%;
&__wrapper {
display: flex;
align-items: center;
gap: 8px;
}

& &__input {
width: 300px;
height: var(--default-clickable-area);
:deep(input) {
height: var(--default-clickable-area) !important;
cursor: default;
}
}

.shortcut-description {
Expand Down
5 changes: 1 addition & 4 deletions src/views/WelcomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
<p class="emptycontent-additional">
{{ t('spreed', 'Say hi to your friends and colleagues!') }}
</p>
<div id="shareRoomContainer">
<!-- <input id="shareRoomInput" class="share-room-input hidden" readonly="readonly" type="text"/>
<div id="shareRoomClipboardButton" class="shareRoomClipboard icon-clippy hidden" data-clipboard-target="#shareRoomInput"></div> -->
</div>
<div id="shareRoomContainer" />
</div>
</template>

Expand Down