Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf44281a

Browse files
author
Filip Hric
committed
add slots
1 parenta3c46b7 commitf44281a

File tree

11 files changed

+189
-158
lines changed

11 files changed

+189
-158
lines changed

‎backend/data/database.json‎

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
11
{
2-
"boards": [
3-
{
4-
"name":"new board",
5-
"user":0,
6-
"starred":false,
7-
"created":"2022-06-11",
8-
"id":1
9-
}
10-
],
2+
"boards": [],
113
"cards": [],
12-
"lists": [
13-
{
14-
"boardId":1,
15-
"name":"new list",
16-
"created":"2022-06-11",
17-
"id":1
18-
}
19-
],
4+
"lists": [],
205
"users": []
216
}

‎cypress/e2e/list.spec.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ it('list actions', function() {
5656

5757
cy.step('open and close dropdown ')
5858
cy.getDataCy('list-options').click();
59-
cy.getDataCy('dropdown').should('be.visible');
59+
cy.getDataCy('list-dropdown').should('be.visible');
6060
cy.getDataCy('cancel').click();
6161
cy.getDataCy('list-options').click();
6262
cy.getDataCy('board-detail').click('bottomRight');
63-
cy.getDataCy('dropdown').should('not.exist');
63+
cy.getDataCy('list-dropdown').should('not.exist');
6464

6565
cy.step('delete list')
6666
cy.getDataCy('list-options').click();

‎cypress/support/@types/selectors.d.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export type Selectors =
3131
|'day'
3232
|'delete-board'
3333
|'delete-list'
34-
|'dropdown'
3534
|'due-date'
3635
|'error-icon'
3736
|'first-board'
@@ -43,6 +42,7 @@ export type Selectors =
4342
|'image-delete'
4443
|'info-icon'
4544
|'list'
45+
|'list-dropdown'
4646
|'list-name'
4747
|'list-options'
4848
|'list-placeholder'
@@ -58,6 +58,7 @@ export type Selectors =
5858
|'new-card'
5959
|'new-card-input'
6060
|'notification-message'
61+
|'selector'
6162
|'signup-email'
6263
|'signup-password'
6364
|'signup-submit'

‎src/components/board/BoardDetail.vue‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<!-- BOARD DETAIL-->
3131
<div
3232
v-if="!state.loading && !state.loadingError.show"
33-
class="overflow-x-autooverflow-y-hidden h-full whitespace-nowrap"
33+
class="overflow-x-automin-h-screen whitespace-nowrap"
3434
data-cy="board-detail"
3535
>
3636
<divclass="py-2.5">
@@ -63,7 +63,7 @@
6363
>
6464
<Starclass="place-self-center m-2" />
6565
</div>
66-
<Dropdown:board="state.board" />
66+
<BoardOptions:board="state.board" />
6767
</div>
6868
<draggable
6969
v-model="state.lists"
@@ -95,7 +95,7 @@ import { ref } from 'vue';
9595
import {selectInput }from'@/utils/selectInput';
9696
import {useStore }from'@/store/store';
9797
import {useRoute }from'vue-router';
98-
importDropdownfrom'@/components/board/Dropdown.vue';
98+
importBoardOptionsfrom'@/components/board/BoardOptions.vue';
9999
importListCreatefrom'@/components/list/ListCreate.vue';
100100
importListItemfrom'@/components/list/ListItem.vue';
101101
importLoadingIconfrom'@/assets/icons/loadingIcon.svg';
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<template>
2+
<divclass="inline-block relative">
3+
<button
4+
data-cy="board-options"
5+
class="inline-grid self-center ml-2 w-8 h-8 text-white bg-white bg-opacity-20 hover:bg-opacity-30 rounded-sm cursor-pointer"
6+
@click="showDropdown()"
7+
>
8+
<Dotsclass="place-self-center m-2" />
9+
</button>
10+
<Dropdown
11+
v-if="dropdown"
12+
v-click-away="onClickAway"
13+
data-cy="board-dropdown"
14+
:header="'Board actions'"
15+
@close="hideDropdown()"
16+
>
17+
<DropdownItem
18+
item-text="Delete board"
19+
:warning="true"
20+
data-cy="delete-board"
21+
@click="
22+
deleteBoard(board.id);
23+
router.push('/');
24+
showDropdown();
25+
"
26+
/>
27+
</Dropdown>
28+
</div>
29+
</template>
30+
31+
<script setup lang="ts">
32+
import {PropType,ref }from'vue';
33+
import {useStore }from'@/store/store';
34+
import {useRouter }from'vue-router';
35+
importBoardfrom'@/typings/board';
36+
importDotsfrom'@/assets/icons/dots.svg';
37+
importDropdownfrom'@/components/common/Dropdown.vue';
38+
importDropdownItemfrom'@/components/common/DropdownItem.vue';
39+
40+
defineProps({
41+
board: {
42+
default:null,
43+
type:ObjectasPropType<Board>,
44+
},
45+
});
46+
47+
const router=useRouter();
48+
const dropdown=ref(false);
49+
const { deleteBoard }=useStore();
50+
const onClickAway= ()=> {
51+
dropdown.value=false;
52+
};
53+
const showDropdown= ()=> {
54+
dropdown.value=true;
55+
};
56+
const hideDropdown= ()=> {
57+
dropdown.value=false;
58+
};
59+
</script>

‎src/components/board/Dropdown.vue‎

Lines changed: 0 additions & 61 deletions
This file was deleted.

‎src/components/common/Dropdown.vue‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<template>
2+
<div
3+
v-click-away="onClickAway"
4+
class="absolute top-11 left-2 z-10 py-2 w-dropdown bg-white rounded-sm shadow-xl"
5+
>
6+
<divclass="mt-0.5 h-7 text-sm text-center text-gray-600">
7+
{{ header }}
8+
</div>
9+
<Cross
10+
class="absolute top-1 right-1 px-2 w-8 h-8 text-gray-600 cursor-pointer"
11+
@click="emit('close')"
12+
/>
13+
<hr>
14+
<slot />
15+
</div>
16+
</template>
17+
<script setup lang="ts">
18+
importCrossfrom'@/assets/icons/cross.svg';
19+
20+
defineProps({
21+
header: {
22+
default:null,
23+
type:String,
24+
},
25+
});
26+
27+
const emit=defineEmits(['close']);
28+
29+
const onClickAway= ()=> {
30+
emit('close');
31+
};
32+
</script>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<template>
2+
<div
3+
class="block py-1 px-2 pt-2 text-sm text-gray-700 hover:bg-gray1 active:bg-gray2 cursor-pointer"
4+
:class="warning && 'text-red-600'"
5+
>
6+
{{ itemText }}
7+
</div>
8+
</template>
9+
10+
<script setup lang="ts">
11+
import {defineProps }from'vue';
12+
defineProps({
13+
itemText: {
14+
default:'Item text',
15+
type:String,
16+
},
17+
warning: {
18+
default:false,
19+
type:Boolean,
20+
},
21+
});
22+
</script>

‎src/components/list/Dropdown.vue‎

Lines changed: 0 additions & 72 deletions
This file was deleted.

‎src/components/list/ListItem.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"
2323
@blur="inputActive = false"
2424
>
25-
<Dropdown
25+
<ListOptions
2626
:list="list"
2727
@toggle-input="showCardCreate"
2828
/>
@@ -75,7 +75,7 @@ import { useStore } from '@/store/store';
7575
importCardfrom'@/typings/card';
7676
importCardCreateInputfrom'@/components/card/CardCreateInput.vue';
7777
importCardItemfrom'@/components/card/CardItem.vue';
78-
importDropdownfrom'@/components/list/Dropdown.vue';
78+
importListOptionsfrom'@/components/list/ListOptions.vue';
7979
importListfrom'@/typings/list';
8080
importPlusfrom'@/assets/icons/plus.svg';
8181
importdraggablefrom'vuedraggable';

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp