Skip to content

Commit 5018044

Browse files
mcelaneyrishijain
andauthored
Move copy story url to clipboard button to the story dropdown menu (#232)
* Move copy story url to clipboard button to the story dropdown menu * Fix copy-to-clipboard popup alert position * Shift location of popup * fix css of the copy link message * fixed the options under the menu on the project show page --------- Co-authored-by: rishijain <[email protected]>
1 parent 21d7457 commit 5018044

File tree

3 files changed

+8
-29
lines changed

3 files changed

+8
-29
lines changed

app/assets/stylesheets/project.scss

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -267,24 +267,7 @@
267267
i {
268268
position: relative;
269269
border-radius: 50%;
270-
padding: 5px;
271-
opacity: 0;
272-
transition: transform 0.5s, opacity 0.5s;
273-
transform: translateX(-100%);
274-
}
275-
276-
&:hover {
277-
i {
278-
opacity: 1;
279-
transform: translateX(0);
280-
}
281-
}
282-
283-
&:active {
284-
i {
285-
background: #f70a7c;
286-
color: white;
287-
}
270+
padding-right: 5px;
288271
}
289272
}
290273

app/assets/stylesheets/stories.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@
118118
.popup {
119119
display: none;
120120
position: absolute;
121-
top: 5px;
122-
left: 30px;
121+
right: 30px;
122+
z-index: 50;
123123
background: #d9f1f1;
124124
height: 30px;
125125
width: 140px;

app/views/projects/show.html.erb

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
<% @stories.each do | story | %>
2828
<tr class="project-table__row project-table__row--story" id="<%= dom_id(story)%>" >
2929
<td class="project-table__cell">
30+
<span class="popup">Copied to clipboard</span>
3031
<input type="checkbox" name="stories[]" value="<%= story.id %>">
3132
<%= link_to "#{story.id} - #{story.title}", [story.project, story] %>
32-
<button class="copy-link btn-clipboard" data-clipboard-text="<%= project_story_url(@project, story) %>" title='Copy story'><i class="fa fa-link"></i><span class= "popup">Copied to clipboard</span></button>
3333
</td>
3434
<td class="project-table__cell"><%= story.estimate_for(current_user)&.best_case_points %></td>
3535
<td class="project-table__cell"><%= story.estimate_for(current_user)&.worst_case_points %></td>
@@ -46,6 +46,10 @@
4646
<i class="fa fa-ellipsis-v"></i>
4747
</button>
4848
<div class="dropdown">
49+
50+
<button class="copy-link btn-clipboard" data-clipboard-text="<%= project_story_url(@project, story) %>" title='Copy story'>
51+
<i class="fa fa-link"></i>Copy Link</button>
52+
4953
<%= link_unless_archived(@project, "Edit", edit_project_story_path(@project, story), classes: "edit", icon: 'pencil-square-o') %>
5054

5155
<% if @siblings.any? %>
@@ -63,12 +67,6 @@
6367
<% end %>
6468

6569
<%= link_unless_archived(@project, "Delete", project_story_path(@project.id, story), classes: "delete", icon: 'trash-o', method: :delete, remote: true, data_attr: { confirm: 'Are you sure?', story_id: story.id }) %>
66-
67-
<% link_to new_project_story_path(@project.id, story_id: story.id), class: "clone", title: "Clone" do %>
68-
<i class="fa fa-files-o"></i>
69-
<span>Clone</span>
70-
<% end %>
71-
7270
<%= link_unless_archived(@project, "Clone", new_project_story_path(@project.id, story_id: story.id), classes: "clone", icon: 'files-o') %>
7371
</div>
7472
</div>
@@ -102,11 +100,9 @@
102100

103101
<div class="btn-group actions">
104102
<%= link_to 'Return to Projects Page', projects_path, id: :back, class: "button" %>
105-
106103
<% if current_user.admin? %>
107104
<%= button_to is_unlocked?(@project) ? 'Lock Project' : 'Unlock Project', toggle_locked_project_path(@project.id), method: :patch, class: "button magenta", id: "lock-btn", remote: true %>
108105
<% end %>
109-
110106
<%= link_to 'Clone Project', new_clone_project_path(@project.id), class: "button green" %>
111107
<%= link_to 'Edit Project', edit_project_path(@project.id), class: "button green" %>
112108

0 commit comments

Comments
 (0)