Ensure consistent naming of title fields #134

Merged
konrad merged 3 commits from fix/title-fields into master 2020-05-16 10:31:43 +00:00
5 changed files with 45 additions and 17 deletions
Showing only changes of commit c94cedd886 - Show all commits

View File

@ -120,17 +120,17 @@
<icon icon="cog"/>
</span>
</router-link>
<router-link v-tooltip="'Add a new list in the ' + n.name + ' namespace'"
<router-link v-tooltip="'Add a new list in the ' + n.title + ' namespace'"
:to="{ name: 'newList', params: { id: n.id} }" class="nsettings"
:key="n.id + 'newList'" v-if="n.id > 0">
<span class="icon">
<icon icon="plus"/>
</span>
</router-link>
<label class="menu-label" v-tooltip="n.name + ' (' + n.lists.length + ')'" :for="n.id + 'checker'">
<label class="menu-label" v-tooltip="n.title + ' (' + n.lists.length + ')'" :for="n.id + 'checker'">
<span class="name">
<span class="color-bubble" v-if="n.hexColor !== ''" :style="{ backgroundColor: n.hexColor }"></span>
{{n.name}} ({{n.lists.length}})
{{n.title}} ({{n.lists.length}})
</span>
<span class="is-archived" v-if="n.isArchived">
Archived

View File

@ -12,23 +12,39 @@
</header>
<div class="card-content">
<div class="content">
<form @submit.prevent="submit()">
<form @submit.prevent="submit()">
<div class="field">
<label class="label" for="namespacetext">Namespace Name</label>
<div class="control">
<input v-focus :class="{ 'disabled': namespaceService.loading}" :disabled="namespaceService.loading" class="input" type="text" id="namespacetext" placeholder="The namespace text is here..." v-model="namespace.name">
<input
v-focus
:class="{ 'disabled': namespaceService.loading}"
:disabled="namespaceService.loading"
class="input"
type="text"
id="namespacetext"
placeholder="The namespace text is here..."
v-model="namespace.title"/>
</div>
</div>
<div class="field">
<label class="label" for="namespacedescription">Description</label>
<div class="control">
<textarea :class="{ 'disabled': namespaceService.loading}" :disabled="namespaceService.loading" class="textarea" placeholder="The namespaces description goes here..." id="namespacedescription" v-model="namespace.description"></textarea>
<textarea
:class="{ 'disabled': namespaceService.loading}"
:disabled="namespaceService.loading"
class="textarea"
placeholder="The namespaces description goes here..."
id="namespacedescription"
v-model="namespace.description"></textarea>
</div>
</div>
<div class="field">
<label class="label" for="isArchivedCheck">Is Archived</label>
<div class="control">
<fancycheckbox v-model="namespace.isArchived" v-tooltip="'If a namespace is archived, you cannot create new lists or edit it.'">
<fancycheckbox
v-model="namespace.isArchived"
v-tooltip="'If a namespace is archived, you cannot create new lists or edit it.'">
This namespace is archived
</fancycheckbox>
</div>
@ -49,12 +65,14 @@
<div class="columns bigbuttons">
<div class="column">
<button @click="submit()" class="button is-primary is-fullwidth" :class="{ 'is-loading': namespaceService.loading}">
<button @click="submit()" class="button is-primary is-fullwidth"
:class="{ 'is-loading': namespaceService.loading}">
Save
</button>
</div>
<div class="column is-1">
<button @click="showDeleteModal = true" class="button is-danger is-fullwidth" :class="{ 'is-loading': namespaceService.loading}">
<button @click="showDeleteModal = true" class="button is-danger is-fullwidth"
:class="{ 'is-loading': namespaceService.loading}">
<span class="icon is-small">
<icon icon="trash-alt"/>
</span>
@ -65,8 +83,18 @@
</div>
</div>
<component :is="manageUsersComponent" :id="namespace.id" type="namespace" shareType="user" :userIsAdmin="userIsAdmin"></component>
<component :is="manageTeamsComponent" :id="namespace.id" type="namespace" shareType="team" :userIsAdmin="userIsAdmin"></component>
<component
:is="manageUsersComponent"
:id="namespace.id"
type="namespace"
shareType="user"
:userIsAdmin="userIsAdmin"/>
<component
:is="manageTeamsComponent"
:id="namespace.id"
type="namespace"
shareType="team"
:userIsAdmin="userIsAdmin"/>
<modal
v-if="showDeleteModal"

View File

@ -10,14 +10,14 @@
<input v-focus
class="input"
v-bind:class="{ 'disabled': namespaceService.loading}"
v-model="namespace.name"
v-model="namespace.title"
type="text"
@keyup.enter="newNamespace()"
@keyup.esc="back()"
placeholder="The namespace's name goes here..."/>
</p>
<p class="control">
<button class="button is-success noshadow" @click="newNamespace()" :disabled="namespace.name.length <= 5">
<button class="button is-success noshadow" @click="newNamespace()" :disabled="namespace.title.length <= 5">
<span class="icon is-small">
<icon icon="plus"/>
</span>
@ -25,7 +25,7 @@
</button>
</p>
</div>
<p class="help is-danger" v-if="showError && namespace.name.length <= 5">
<p class="help is-danger" v-if="showError && namespace.title.length <= 5">
Please specify at least five characters.
</p>
<p class="small" v-tooltip.bottom="'A namespace is a collection of lists you can share and use to organize your lists with.<br/>In fact, every list belongs to a namepace.'">
@ -55,7 +55,7 @@
},
methods: {
newNamespace() {
if (this.namespace.name.length <= 4) {
if (this.namespace.title.length <= 4) {
this.showError = true
return
}

View File

@ -10,7 +10,7 @@
@keyup.ctrl.enter="saveTaskOnChange()">{{ task.text }}</h1>
</div>
<h6 class="subtitle" v-if="parent && parent.namespace && parent.list">
{{ parent.namespace.name }} >
{{ parent.namespace.title }} >
<router-link :to="{ name: 'list.list', params: { listId: parent.list.id } }">
{{ parent.list.title }}
</router-link>

View File

@ -23,7 +23,7 @@ export default class NamespaceModel extends AbstractModel {
defaults() {
return {
id: 0,
name: '',
title: '',
description: '',
owner: UserModel,
lists: [],