Merge branch 'main' into renovate/vue-i18n-8.x
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
konrad 2021-07-17 17:25:36 +00:00
commit f253c2e2ed
4 changed files with 21 additions and 4 deletions

View File

@ -13,7 +13,7 @@ export class UserFactory extends Factory {
id: '{increment}',
username: faker.lorem.word(10) + faker.random.uuid(),
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.', // 1234
is_active: true,
status: 0,
created: formatISO(now),
updated: formatISO(now)
}

View File

@ -10,6 +10,8 @@ export const getHistory = () => {
export function saveListToHistory(list) {
const history = getHistory()
list.id = parseInt(list.id)
// Remove the element if it already exists in history, preventing duplicates and essentially moving it to the beginning
for (const i in history) {
if (history[i].id === list.id) {
@ -17,6 +19,7 @@ export function saveListToHistory(list) {
}
}
// Add the new list to the beginning of the list
history.unshift(list)
if (history.length > 5) {

View File

@ -53,6 +53,18 @@ test('don\'t store the same list twice', () => {
expect(saved).toBe('[{"id":1}]')
})
test('don\'t store the same list twice with different id types', () => {
let saved = null
Storage.prototype.getItem = jest.fn(() => saved)
Storage.prototype.setItem = jest.fn((key, lists) => {
saved = lists
})
saveListToHistory({id: 1})
saveListToHistory({id: '1'})
expect(saved).toBe('[{"id":1}]')
})
test('move a list to the beginning when storing it multiple times', () => {
let saved = null
Storage.prototype.getItem = jest.fn(() => saved)

View File

@ -1,3 +1,5 @@
@use 'sass:math';
$bucket-background: $grey-100;
$task-background: $white;
$ease-out: all .3s cubic-bezier(0.23, 1, 0.32, 1);
@ -237,10 +239,10 @@ $filter-container-height: '1rem - #{$switch-view-height}';
}
&.is-collapsed {
transform: rotate(90deg) translateX($bucket-width / 2 - $bucket-header-height / 2);
transform: rotate(90deg) translateX(math.div($bucket-width, 2) - math.div($bucket-header-height, 2));
// Using negative margins instead of translateY here to make all other buckets fill the empty space
margin-left: ($bucket-width / 2 - $bucket-header-height / 2) * -1;
margin-right: calc(#{($bucket-width / 2 - $bucket-header-height / 2) * -1} + #{$bucket-right-margin});
margin-left: (math.div($bucket-width, 2) - math.div($bucket-header-height, 2)) * -1;
margin-right: calc(#{(math.div($bucket-width, 2) - math.div($bucket-header-height, 2)) * -1} + #{$bucket-right-margin});
cursor: pointer;
.tasks, .bucket-footer {