Merge pull request #367 from nextcloud/design/title-no-prefill
Do not prefill form or question title for less confusion
This commit is contained in:
commit
a662dd11ef
7 changed files with 49 additions and 18 deletions
|
|
@ -25,7 +25,7 @@
|
|||
ref="navigationItem"
|
||||
:exact="true"
|
||||
:icon="icon"
|
||||
:title="form.title"
|
||||
:title="formTitle"
|
||||
:to="{ name: 'edit', params: { hash: form.hash } }">
|
||||
<template v-if="!loading" #actions>
|
||||
<ActionLink
|
||||
|
|
@ -124,6 +124,17 @@ export default {
|
|||
return this.form.expires && moment().unix() > this.form.expires
|
||||
},
|
||||
|
||||
/**
|
||||
* Return form title, or placeholder if not set
|
||||
* @returns {string}
|
||||
*/
|
||||
formTitle() {
|
||||
if (this.form.title) {
|
||||
return this.form.title
|
||||
}
|
||||
return t('forms', 'New form')
|
||||
},
|
||||
|
||||
/**
|
||||
* Return the form share link
|
||||
* @returns {string}
|
||||
|
|
@ -148,7 +159,7 @@ export default {
|
|||
|
||||
methods: {
|
||||
async onDeleteForm() {
|
||||
if (!confirm(t('forms', 'Are you sure you want to delete the form “{title}”?', { title: this.form.title }))) {
|
||||
if (!confirm(t('forms', 'Are you sure you want to delete {title}?', { title: this.formTitle }))) {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -158,7 +169,7 @@ export default {
|
|||
await axios.delete(generateUrl('/apps/forms/api/v1/form/{id}', { id: this.form.id }))
|
||||
this.$emit('delete', this.form.id)
|
||||
} catch (error) {
|
||||
showError(t('forms', 'Error while deleting form “{title}”', { title: this.form.title }))
|
||||
showError(t('forms', 'Error while deleting {title}', { title: this.formTitle }))
|
||||
console.error(error.response)
|
||||
} finally {
|
||||
this.loading = false
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@
|
|||
|
||||
<!-- Header -->
|
||||
<div class="question__header">
|
||||
<input v-if="edit"
|
||||
:placeholder="t('forms', 'Enter a title for this question')"
|
||||
<input v-if="edit || !text"
|
||||
:placeholder="t('forms', 'Question title')"
|
||||
:aria-label="t('forms', 'Title of question number {index}', {index})"
|
||||
:value="text"
|
||||
class="question__header-title"
|
||||
|
|
|
|||
|
|
@ -23,9 +23,7 @@
|
|||
<template>
|
||||
<div class="section submission">
|
||||
<div class="submission-head">
|
||||
<h3>
|
||||
{{ t('forms', 'Response by {userDisplayName}', { userDisplayName: submission.userDisplayName }) }}
|
||||
</h3>
|
||||
<h3>{{ submission.userDisplayName }}</h3>
|
||||
<Actions class="submission-menu" :force-menu="true">
|
||||
<ActionButton icon="icon-delete" @click="onDelete">
|
||||
{{ t('forms', 'Delete this response') }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue