forked from vikunja/frontend
Compare commits
2 Commits
main
...
fix/quick-
Author | SHA1 | Date | |
---|---|---|---|
c986759436 | |||
316b147517 |
|
@ -128,7 +128,7 @@ describe('Task', () => {
|
|||
cy.visit(`/tasks/${tasks[0].id}`)
|
||||
|
||||
cy.get('.task-view .action-buttons .button')
|
||||
.contains('Mark task done!')
|
||||
.contains('Done!')
|
||||
.click()
|
||||
|
||||
cy.get('.task-view .heading .is-done')
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
"lint": "eslint --ignore-pattern '*.test.*' ./src --ext .vue,.js,.ts",
|
||||
"cypress:open": "cypress open",
|
||||
"test:unit": "vitest run",
|
||||
"test:unit-watch": "vitest watch",
|
||||
"test:frontend": "cypress run",
|
||||
"browserslist:update": "npx browserslist@latest --update-db"
|
||||
},
|
||||
|
|
|
@ -348,10 +348,6 @@ $editor-border-color: #ddd;
|
|||
color: var(--grey-400) !important;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
&-cursor {
|
||||
border-color: var(--grey-700);
|
||||
}
|
||||
}
|
||||
|
||||
.editor-preview {
|
||||
|
|
|
@ -545,7 +545,7 @@
|
|||
"chooseStartDate": "Click here to set a start date",
|
||||
"chooseEndDate": "Click here to set an end date",
|
||||
"move": "Move task to a different list",
|
||||
"done": "Mark task done!",
|
||||
"done": "Done!",
|
||||
"undone": "Mark as undone",
|
||||
"created": "Created {0} by {1}",
|
||||
"updated": "Updated {0}",
|
||||
|
@ -781,7 +781,7 @@
|
|||
"then": "then",
|
||||
"task": {
|
||||
"title": "Task Page",
|
||||
"done": "Done",
|
||||
"done": "Mark a task as done",
|
||||
"assign": "Assign to a user",
|
||||
"labels": "Add labels to this task",
|
||||
"dueDate": "Change the due date of this task",
|
||||
|
|
|
@ -32,6 +32,13 @@ describe('Parse Task Text', () => {
|
|||
expect(result.assignees).toHaveLength(1)
|
||||
expect(result.assignees[0]).toBe('user')
|
||||
})
|
||||
|
||||
it('should ignore email addresses', () => {
|
||||
const text = 'Lorem Ipsum email@example.com'
|
||||
const result = parseTaskText(text)
|
||||
|
||||
expect(result.text).toBe(text)
|
||||
})
|
||||
|
||||
describe('Date Parsing', () => {
|
||||
it('should not return any date if none was provided', () => {
|
||||
|
|
|
@ -117,23 +117,30 @@ export const parseTaskText = (text: string, prefixesMode: PrefixMode = PrefixMod
|
|||
const getItemsFromPrefix = (text: string, prefix: string): string[] => {
|
||||
const items: string[] = []
|
||||
|
||||
const itemParts = text.split(prefix)
|
||||
const itemParts = text.split(' ' + prefix)
|
||||
if (text.startsWith(prefix)) {
|
||||
const firstItem = text.split(prefix)[1]
|
||||
itemParts.unshift(firstItem)
|
||||
}
|
||||
|
||||
itemParts.forEach((p, index) => {
|
||||
// First part contains the rest
|
||||
if (index < 1) {
|
||||
return
|
||||
}
|
||||
|
||||
let labelText
|
||||
p = p.replace(prefix, '')
|
||||
|
||||
let itemText
|
||||
if (p.charAt(0) === '\'') {
|
||||
labelText = p.split('\'')[1]
|
||||
itemText = p.split('\'')[1]
|
||||
} else if (p.charAt(0) === '"') {
|
||||
labelText = p.split('"')[1]
|
||||
itemText = p.split('"')[1]
|
||||
} else {
|
||||
// Only until the next space
|
||||
labelText = p.split(' ')[0]
|
||||
itemText = p.split(' ')[0]
|
||||
}
|
||||
items.push(labelText)
|
||||
items.push(itemText)
|
||||
})
|
||||
|
||||
return Array.from(new Set(items))
|
||||
|
|
|
@ -627,6 +627,7 @@ export default {
|
|||
}
|
||||
|
||||
this.task = await this.$store.dispatch('tasks/update', this.task)
|
||||
this.setActiveFields()
|
||||
|
||||
if (!showNotification) {
|
||||
return
|
||||
|
@ -870,7 +871,7 @@ $flash-background-duration: 750ms;
|
|||
}
|
||||
|
||||
.action-buttons {
|
||||
.button {
|
||||
a.button {
|
||||
width: 100%;
|
||||
margin-bottom: .5rem;
|
||||
justify-content: left;
|
||||
|
|
Loading…
Reference in New Issue
Block a user