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
d215d688
Commit
d215d688
authored
Apr 09, 2022
by
Sam Beckham
Committed by
Vitaly Slobodin
Apr 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates the design discussion buttons to match the design system
parent
c9127868
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
35 deletions
+31
-35
app/assets/javascripts/design_management/components/design_notes/design_discussion.vue
..._management/components/design_notes/design_discussion.vue
+12
-14
app/assets/javascripts/design_management/components/design_notes/design_note.vue
...design_management/components/design_notes/design_note.vue
+15
-16
spec/frontend/design_management/components/design_notes/design_discussion_spec.js
...agement/components/design_notes/design_discussion_spec.js
+3
-4
spec/frontend/design_management/components/design_notes/design_note_spec.js
...gn_management/components/design_notes/design_note_spec.js
+1
-1
No files found.
app/assets/javascripts/design_management/components/design_notes/design_discussion.vue
View file @
d215d688
<
script
>
import
{
Gl
TooltipDirective
,
GlIcon
,
GlLoadingIcon
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
Gl
Button
,
GlLink
,
GlTooltipDirective
}
from
'
@gitlab/ui
'
;
import
{
ApolloMutation
}
from
'
vue-apollo
'
;
import
createFlash
from
'
~/flash
'
;
import
{
s__
}
from
'
~/locale
'
;
...
...
@@ -26,15 +26,14 @@ export default {
components
:
{
ApolloMutation
,
DesignNote
,
DesignNotePin
,
DesignNoteSignedOut
,
ReplyPlaceholder
,
DesignReplyForm
,
GlIcon
,
GlLoadingIcon
,
GlButton
,
GlLink
,
ToggleRepliesWidget
,
ReplyPlaceholder
,
TimeAgoTooltip
,
DesignNotePin
,
ToggleRepliesWidget
,
},
directives
:
{
GlTooltip
:
GlTooltipDirective
,
...
...
@@ -239,18 +238,17 @@ export default {
@error="$emit('update-note-error', $event)"
>
<template
v-if=
"isLoggedIn && discussion.resolvable"
#resolve-discussion
>
<button
<
gl-
button
v-gl-tooltip
:class=
"
{ 'is-active': discussion.resolved }"
:title="resolveCheckboxText"
:aria-label=
"resolveCheckboxText"
class="line-resolve-btn note-action-button gl-mr-3"
:icon=
"resolveIconName"
:title=
"resolveCheckboxText"
:loading=
"isResolving"
category=
"tertiary"
data-testid=
"resolve-button"
size=
"small"
@
click.stop=
"toggleResolvedStatus"
>
<gl-icon
v-if=
"!isResolving"
:name=
"resolveIconName"
data-testid=
"resolve-icon"
/>
<gl-loading-icon
v-else
size=
"sm"
inline
/>
</button>
/>
</
template
>
<
template
v-if=
"discussion.resolved"
#resolved-status
>
<p
class=
"gl-text-gray-500 gl-font-sm gl-m-0 gl-mt-5"
data-testid=
"resolved-message"
>
...
...
app/assets/javascripts/design_management/components/design_notes/design_note.vue
View file @
d215d688
<
script
>
import
{
GlTooltipDirective
,
GlIcon
,
GlLink
,
GlSafeHtmlDirective
,
GlAvatar
,
GlAvatarLink
,
GlButton
,
GlLink
,
GlSafeHtmlDirective
,
GlTooltipDirective
,
}
from
'
@gitlab/ui
'
;
import
{
ApolloMutation
}
from
'
vue-apollo
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
...
...
@@ -22,14 +22,14 @@ export default {
editCommentLabel
:
__
(
'
Edit comment
'
),
},
components
:
{
ApolloMutation
,
DesignReplyForm
,
GlAvatar
,
GlAvatarLink
,
TimelineEntryItem
,
TimeAgoTooltip
,
DesignReplyForm
,
ApolloMutation
,
GlIcon
,
GlButton
,
GlLink
,
TimeAgoTooltip
,
TimelineEntryItem
,
},
directives
:
{
GlTooltip
:
GlTooltipDirective
,
...
...
@@ -123,18 +123,17 @@ export default {
</div>
<div
class=
"gl-display-flex gl-align-items-baseline"
>
<slot
name=
"resolve-discussion"
></slot>
<button
<
gl-
button
v-if=
"isEditButtonVisible"
v-gl-tooltip
type=
"button"
:title=
"$options.i18n.editCommentLabel"
:aria-label=
"$options.i18n.editCommentLabel"
class=
"note-action-button btn btn-transparent qa-note-edit-button"
:title=
"$options.i18n.editCommentLabel"
category=
"tertiary"
data-testid=
"note-edit"
icon=
"pencil"
size=
"small"
@
click=
"isEditing = true"
>
<gl-icon
name=
"pencil"
class=
"link-highlight"
/>
</button>
/>
</div>
</div>
<template
v-if=
"!isEditing"
>
...
...
spec/frontend/design_management/components/design_notes/design_discussion_spec.js
View file @
d215d688
...
...
@@ -31,7 +31,6 @@ describe('Design discussions component', () => {
const
findReplyForm
=
()
=>
wrapper
.
find
(
DesignReplyForm
);
const
findRepliesWidget
=
()
=>
wrapper
.
find
(
ToggleRepliesWidget
);
const
findResolveButton
=
()
=>
wrapper
.
find
(
'
[data-testid="resolve-button"]
'
);
const
findResolveIcon
=
()
=>
wrapper
.
find
(
'
[data-testid="resolve-icon"]
'
);
const
findResolvedMessage
=
()
=>
wrapper
.
find
(
'
[data-testid="resolved-message"]
'
);
const
findResolveLoadingIcon
=
()
=>
wrapper
.
find
(
GlLoadingIcon
);
const
findResolveCheckbox
=
()
=>
wrapper
.
find
(
'
[data-testid="resolve-checkbox"]
'
);
...
...
@@ -117,7 +116,7 @@ describe('Design discussions component', () => {
});
it
(
'
does not render an icon to resolve a thread
'
,
()
=>
{
expect
(
findResolve
Ic
on
().
exists
()).
toBe
(
false
);
expect
(
findResolve
Butt
on
().
exists
()).
toBe
(
false
);
});
it
(
'
does not render a checkbox in reply form
'
,
async
()
=>
{
...
...
@@ -147,7 +146,7 @@ describe('Design discussions component', () => {
});
it
(
'
renders a correct icon to resolve a thread
'
,
()
=>
{
expect
(
findResolve
Icon
().
props
(
'
name
'
)).
toBe
(
'
check-circle
'
);
expect
(
findResolve
Button
().
props
(
'
icon
'
)).
toBe
(
'
check-circle
'
);
});
it
(
'
renders a checkbox with Resolve thread text in reply form
'
,
async
()
=>
{
...
...
@@ -203,7 +202,7 @@ describe('Design discussions component', () => {
});
it
(
'
renders a correct icon to resolve a thread
'
,
()
=>
{
expect
(
findResolve
Icon
().
props
(
'
name
'
)).
toBe
(
'
check-circle-filled
'
);
expect
(
findResolve
Button
().
props
(
'
icon
'
)).
toBe
(
'
check-circle-filled
'
);
});
it
(
'
emit todo:toggle when discussion is resolved
'
,
async
()
=>
{
...
...
spec/frontend/design_management/components/design_notes/design_note_spec.js
View file @
d215d688
...
...
@@ -122,7 +122,7 @@ describe('Design note component', () => {
},
});
findEditButton
().
trigger
(
'
click
'
);
findEditButton
().
vm
.
$emit
(
'
click
'
);
await
nextTick
();
expect
(
findReplyForm
().
exists
()).
toBe
(
true
);
...
...
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