feat: review changes

This commit is contained in:
Dominik Pschenitschni 2022-01-05 11:56:20 +01:00
parent 0f32991b16
commit 8a95bb7422
No known key found for this signature in database
GPG key ID: B257AC0149F43A77
4 changed files with 59 additions and 56 deletions

View file

@ -31,7 +31,7 @@ describe('Lists', () => {
cy.url()
.should('contain', '/namespaces/1/list')
cy.get('.card-header-title')
.contains('Create a new list')
.contains('New list')
cy.get('input.input')
.type('New List')
cy.get('.button')

View file

@ -15,7 +15,7 @@ describe('Namepaces', () => {
it('Should be all there', () => {
cy.visit('/namespaces')
cy.get('.namespace h1 span')
cy.get('[data-cy="namespace-title"]')
.should('contain', namespaces[0].title)
})
@ -23,14 +23,14 @@ describe('Namepaces', () => {
const newNamespaceTitle = 'New Namespace'
cy.visit('/namespaces')
cy.get('a.button')
.contains('Create a new namespace')
cy.get('[data-cy="new-namespace"]')
.should('contain', 'New namespace')
.click()
cy.url()
.should('contain', '/namespaces/new')
cy.get('.card-header-title')
.should('contain', 'Create a new namespace')
.should('contain', 'New namespace')
cy.get('input.input')
.type(newNamespaceTitle)
cy.get('.button')

View file

@ -7,7 +7,7 @@
"lastViewed": "Last viewed",
"list": {
"newText": "You can create a new list for your new tasks:",
"new": "Create a new list",
"new": "New list",
"importText": "Or import your lists and tasks from other services into Vikunja:",
"import": "Import your data into Vikunja"
}
@ -157,7 +157,7 @@
"searchSelect": "Click or press enter to select this list",
"shared": "Shared Lists",
"create": {
"header": "Create a new list",
"header": "New list",
"titlePlaceholder": "The list's title goes here…",
"addTitleRequired": "Please specify a title.",
"createdSuccess": "The list was successfully created.",
@ -315,7 +315,7 @@
"namespaces": "Namespaces",
"search": "Type to search for a namespace…",
"create": {
"title": "Create a new namespace",
"title": "New namespace",
"titleRequired": "Please specify a title.",
"explanation": "A namespace is a collection of lists you can share and use to organize your lists with. In fact, every list belongs to a namepace.",
"tooltip": "What's a namespace?",
@ -383,7 +383,7 @@
"reminderRange": "Reminder Date Range"
},
"create": {
"title": "Create A Saved Filter",
"title": "New Saved Filter",
"description": "A saved filter is a virtual list which is computed from a set of filters each time it is accessed. Once created, it will appear in a special namespace.",
"action": "Create new saved filter"
},

View file

@ -1,17 +1,19 @@
<template>
<div class="content loader-container" :class="{'is-loading': loading}" v-cy="'namespaces-list'">
<div class="create-buttons">
<header class="namespace-header">
<fancycheckbox v-model="showArchived" @change="saveShowArchivedState" v-cy="'show-archived-check'">
{{ $t('namespace.showArchived') }}
</fancycheckbox>
<x-button :to="{name: 'filters.create'}" class="new-namespace ml-auto" icon="filter">
<div class="action-buttons">
<x-button :to="{name: 'filters.create'}" icon="filter">
{{ $t('filters.create.title') }}
</x-button>
<x-button :to="{name: 'namespace.create'}" class="new-namespace" icon="plus">
<x-button :to="{name: 'namespace.create'}" icon="plus" v-cy="'new-namespace'">
{{ $t('namespace.create.title') }}
</x-button>
</div>
</header>
<p class="has-text-centered has-text-grey mt-4 is-italic" v-if="namespaces.length === 0">
{{ $t('namespace.noneAvailable') }}
@ -40,12 +42,12 @@
{{ $t('namespace.unarchive') }}
</x-button>
<h1>
<span>{{ getNamespaceTitle(n) }}</span>
<h2 class="namespace-title">
<span v-cy="'namespace-title'">{{ getNamespaceTitle(n) }}</span>
<span class="is-archived" v-if="n.isArchived">
{{ $t('namespace.archived') }}
</span>
</h1>
</h2>
<p class="has-text-centered has-text-grey mt-4 is-italic" v-if="n.lists.length === 0">
{{ $t('namespace.noLists') }}
@ -105,17 +107,41 @@ export default {
</script>
<style lang="scss" scoped>
.namespace {
&:not(:last-child) {
margin-bottom: 1rem;
}
.namespace-header {
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;
h1 {
@media screen and (max-width: $tablet) {
flex-direction: column;
}
}
.action-buttons {
display: flex;
justify-content: space-between;
gap: 1rem;
@media screen and (max-width: $tablet) {
width: 100%;
flex-direction: column;
align-items: stretch;
}
}
.namespace {
& + & {
margin-top: 1rem;
}
}
.namespace-title {
display: flex;
align-items: center;
}
}
.is-archived {
.is-archived {
font-size: 0.75rem;
border: 1px solid var(--grey-500);
color: $grey !important;
@ -124,33 +150,10 @@ export default {
font-family: $vikunja-font;
background: var(--white-translucent);
margin-left: .5rem;
}
}
.lists {
.lists {
display: flex;
flex-flow: row wrap;
}
}
.create-buttons {
display: flex;
justify-content: space-between;
align-items: center;
gap: .5rem;
@media screen and (max-width: $tablet) {
width: 100%;
flex-direction: column;
}
}
.new-namespace {
margin-bottom: .5rem;
width: 100%;
@media screen and (min-width: $tablet) {
margin-left: 1rem;
width: auto;
}
}
</style>