Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
bdac9165
Commit
bdac9165
authored
Jun 25, 2018
by
Filipa Lacerda
Committed by
Mike Greiling
Jun 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EE port of Moves remove_issue component into a .vue file
parent
5d90aef3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
155 additions
and
151 deletions
+155
-151
app/assets/javascripts/boards/components/board_sidebar.js
app/assets/javascripts/boards/components/board_sidebar.js
+10
-10
app/assets/javascripts/boards/components/modal/header.js
app/assets/javascripts/boards/components/modal/header.js
+2
-2
app/assets/javascripts/boards/components/modal/tabs.js
app/assets/javascripts/boards/components/modal/tabs.js
+0
-46
app/assets/javascripts/boards/components/modal/tabs.vue
app/assets/javascripts/boards/components/modal/tabs.vue
+49
-0
app/assets/javascripts/boards/components/sidebar/remove_issue.js
...ets/javascripts/boards/components/sidebar/remove_issue.js
+0
-93
app/assets/javascripts/boards/components/sidebar/remove_issue.vue
...ts/javascripts/boards/components/sidebar/remove_issue.vue
+94
-0
No files found.
app/assets/javascripts/boards/components/board_sidebar.js
View file @
bdac9165
...
...
@@ -2,18 +2,18 @@
import
$
from
'
jquery
'
;
import
Vue
from
'
vue
'
;
import
w
eight
from
'
ee/sidebar/components/weight/weight.vue
'
;
import
W
eight
from
'
ee/sidebar/components/weight/weight.vue
'
;
import
Flash
from
'
../../flash
'
;
import
{
__
}
from
'
../../locale
'
;
import
Sidebar
from
'
../../right_sidebar
'
;
import
eventHub
from
'
../../sidebar/event_hub
'
;
import
a
ssigneeTitle
from
'
../../sidebar/components/assignees/assignee_title.vue
'
;
import
a
ssignees
from
'
../../sidebar/components/assignees/assignees.vue
'
;
import
A
ssigneeTitle
from
'
../../sidebar/components/assignees/assignee_title.vue
'
;
import
A
ssignees
from
'
../../sidebar/components/assignees/assignees.vue
'
;
import
DueDateSelectors
from
'
../../due_date_select
'
;
import
'
./sidebar/remove_iss
ue
'
;
import
RemoveBtn
from
'
./sidebar/remove_issue.v
ue
'
;
import
IssuableContext
from
'
../../issuable_context
'
;
import
LabelsSelect
from
'
../../labels_select
'
;
import
s
ubscriptions
from
'
../../sidebar/components/subscriptions/subscriptions.vue
'
;
import
S
ubscriptions
from
'
../../sidebar/components/subscriptions/subscriptions.vue
'
;
import
MilestoneSelect
from
'
../../milestone_select
'
;
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
...
...
@@ -23,11 +23,11 @@ window.gl.issueBoards = window.gl.issueBoards || {};
gl
.
issueBoards
.
BoardSidebar
=
Vue
.
extend
({
components
:
{
a
ssigneeTitle
,
a
ssignees
,
removeBtn
:
gl
.
issueBoards
.
RemoveIssu
eBtn
,
s
ubscriptions
,
w
eight
,
A
ssigneeTitle
,
A
ssignees
,
Remov
eBtn
,
S
ubscriptions
,
W
eight
,
},
props
:
{
currentUser
:
{
...
...
app/assets/javascripts/boards/components/modal/header.js
View file @
bdac9165
import
Vue
from
'
vue
'
;
import
modalFilters
from
'
./filters
'
;
import
'
./tabs
'
;
import
modalTabs
from
'
./tabs.vue
'
;
import
ModalStore
from
'
../../stores/modal_store
'
;
import
modalMixin
from
'
../../mixins/modal_mixins
'
;
gl
.
issueBoards
.
ModalHeader
=
Vue
.
extend
({
components
:
{
'
modal-tabs
'
:
gl
.
issueBoards
.
M
odalTabs
,
m
odalTabs
,
modalFilters
,
},
mixins
:
[
modalMixin
],
...
...
app/assets/javascripts/boards/components/modal/tabs.js
deleted
100644 → 0
View file @
5d90aef3
import
Vue
from
'
vue
'
;
import
ModalStore
from
'
../../stores/modal_store
'
;
import
modalMixin
from
'
../../mixins/modal_mixins
'
;
gl
.
issueBoards
.
ModalTabs
=
Vue
.
extend
({
mixins
:
[
modalMixin
],
data
()
{
return
ModalStore
.
store
;
},
computed
:
{
selectedCount
()
{
return
ModalStore
.
selectedCount
();
},
},
destroyed
()
{
this
.
activeTab
=
'
all
'
;
},
template
:
`
<div class="top-area prepend-top-10 append-bottom-10">
<ul class="nav-links issues-state-filters">
<li :class="{ 'active': activeTab == 'all' }">
<a
href="#"
role="button"
@click.prevent="changeTab('all')">
Open issues
<span class="badge badge-pill">
{{ issuesCount }}
</span>
</a>
</li>
<li :class="{ 'active': activeTab == 'selected' }">
<a
href="#"
role="button"
@click.prevent="changeTab('selected')">
Selected issues
<span class="badge badge-pill">
{{ selectedCount }}
</span>
</a>
</li>
</ul>
</div>
`
,
});
app/assets/javascripts/boards/components/modal/tabs.vue
0 → 100644
View file @
bdac9165
<
script
>
import
ModalStore
from
'
../../stores/modal_store
'
;
import
modalMixin
from
'
../../mixins/modal_mixins
'
;
export
default
{
mixins
:
[
modalMixin
],
data
()
{
return
ModalStore
.
store
;
},
computed
:
{
selectedCount
()
{
return
ModalStore
.
selectedCount
();
},
},
destroyed
()
{
this
.
activeTab
=
'
all
'
;
},
};
</
script
>
<
template
>
<div
class=
"top-area prepend-top-10 append-bottom-10"
>
<ul
class=
"nav-links issues-state-filters"
>
<li
:class=
"
{ 'active': activeTab == 'all' }">
<a
href=
"#"
role=
"button"
@
click.prevent=
"changeTab('all')"
>
Open issues
<span
class=
"badge badge-pill"
>
{{
issuesCount
}}
</span>
</a>
</li>
<li
:class=
"
{ 'active': activeTab == 'selected' }">
<a
href=
"#"
role=
"button"
@
click.prevent=
"changeTab('selected')"
>
Selected issues
<span
class=
"badge badge-pill"
>
{{
selectedCount
}}
</span>
</a>
</li>
</ul>
</div>
</
template
>
app/assets/javascripts/boards/components/sidebar/remove_issue.js
deleted
100644 → 0
View file @
5d90aef3
import
Vue
from
'
vue
'
;
import
Flash
from
'
../../../flash
'
;
import
{
__
}
from
'
../../../locale
'
;
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
gl
.
issueBoards
.
RemoveIssueBtn
=
Vue
.
extend
({
props
:
{
issue
:
{
type
:
Object
,
required
:
true
,
},
list
:
{
type
:
Object
,
required
:
true
,
},
},
computed
:
{
updateUrl
()
{
return
this
.
issue
.
path
;
},
},
methods
:
{
removeIssue
()
{
const
board
=
Store
.
state
.
currentBoard
;
const
issue
=
this
.
issue
;
const
lists
=
issue
.
getLists
();
const
boardLabelIds
=
board
.
labels
.
map
(
label
=>
label
.
id
);
const
listLabelIds
=
lists
.
map
(
list
=>
list
.
label
.
id
);
let
labelIds
=
issue
.
labels
.
map
(
label
=>
label
.
id
)
.
filter
(
id
=>
!
listLabelIds
.
includes
(
id
))
.
filter
(
id
=>
!
boardLabelIds
.
includes
(
id
));
if
(
labelIds
.
length
===
0
)
{
labelIds
=
[
''
];
}
let
assigneeIds
=
issue
.
assignees
.
map
(
assignee
=>
assignee
.
id
)
.
filter
(
id
=>
id
!==
board
.
assignee
.
id
);
if
(
assigneeIds
.
length
===
0
)
{
// for backend to explicitly set No Assignee
assigneeIds
=
[
'
0
'
];
}
const
data
=
{
issue
:
{
label_ids
:
labelIds
,
assignee_ids
:
assigneeIds
,
},
};
if
(
board
.
milestone_id
)
{
data
.
issue
.
milestone_id
=
-
1
;
}
if
(
board
.
weight
)
{
data
.
issue
.
weight
=
null
;
}
// Post the remove data
Vue
.
http
.
patch
(
this
.
updateUrl
,
data
).
catch
(()
=>
{
Flash
(
__
(
'
Failed to remove issue from board, please try again.
'
));
lists
.
forEach
((
list
)
=>
{
list
.
addIssue
(
issue
);
});
});
// Remove from the frontend store
lists
.
forEach
((
list
)
=>
{
list
.
removeIssue
(
issue
);
});
Store
.
detail
.
issue
=
{};
},
},
template
:
`
<div
class="block list">
<button
class="btn btn-default btn-block"
type="button"
@click="removeIssue">
Remove from board
</button>
</div>
`
,
});
app/assets/javascripts/boards/components/sidebar/remove_issue.vue
0 → 100644
View file @
bdac9165
<
script
>
import
Vue
from
'
vue
'
;
import
Flash
from
'
../../../flash
'
;
import
{
__
}
from
'
../../../locale
'
;
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
export
default
{
props
:
{
issue
:
{
type
:
Object
,
required
:
true
,
},
list
:
{
type
:
Object
,
required
:
true
,
},
},
computed
:
{
updateUrl
()
{
return
this
.
issue
.
path
;
},
},
methods
:
{
removeIssue
()
{
const
board
=
Store
.
state
.
currentBoard
;
const
issue
=
this
.
issue
;
const
lists
=
issue
.
getLists
();
const
boardLabelIds
=
board
.
labels
.
map
(
label
=>
label
.
id
);
const
listLabelIds
=
lists
.
map
(
list
=>
list
.
label
.
id
);
let
labelIds
=
issue
.
labels
.
map
(
label
=>
label
.
id
)
.
filter
(
id
=>
!
listLabelIds
.
includes
(
id
))
.
filter
(
id
=>
!
boardLabelIds
.
includes
(
id
));
if
(
labelIds
.
length
===
0
)
{
labelIds
=
[
''
];
}
let
assigneeIds
=
issue
.
assignees
.
map
(
assignee
=>
assignee
.
id
)
.
filter
(
id
=>
id
!==
board
.
assignee
.
id
);
if
(
assigneeIds
.
length
===
0
)
{
// for backend to explicitly set No Assignee
assigneeIds
=
[
'
0
'
];
}
const
data
=
{
issue
:
{
label_ids
:
labelIds
,
assignee_ids
:
assigneeIds
,
},
};
if
(
board
.
milestone_id
)
{
data
.
issue
.
milestone_id
=
-
1
;
}
if
(
board
.
weight
)
{
data
.
issue
.
weight
=
null
;
}
// Post the remove data
Vue
.
http
.
patch
(
this
.
updateUrl
,
data
).
catch
(()
=>
{
Flash
(
__
(
'
Failed to remove issue from board, please try again.
'
));
lists
.
forEach
(
list
=>
{
list
.
addIssue
(
issue
);
});
});
// Remove from the frontend store
lists
.
forEach
(
list
=>
{
list
.
removeIssue
(
issue
);
});
Store
.
detail
.
issue
=
{};
},
},
};
</
script
>
<
template
>
<div
class=
"block list"
>
<button
class=
"btn btn-default btn-block"
type=
"button"
@
click=
"removeIssue"
>
Remove from board
</button>
</div>
</
template
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment