Skip to content

Commit

Permalink
add button to enter dashboard edit mode from listing page (#15645)
Browse files Browse the repository at this point in the history
* add button to enter dashboard edit mode from listing page

* do not show actions column when dashboard is in read only mode
  • Loading branch information
nreese authored Dec 21, 2017
1 parent b445389 commit c4d5018
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,15 @@
</span>
</button>
</th>

<th
ng-if="!listingController.hideWriteControls"
scope="col"
class="kuiTableHeaderCell"
width="80px"
>
<div class="kuiTableHeaderCell__liner">Actions</div>
</th>
</tr>
</thead>

Expand Down Expand Up @@ -215,6 +224,20 @@
{{ item.description }}
</div>
</td>
<td
ng-if="!listingController.hideWriteControls"
class="kuiTableRowCell kuiTableRowCell--wrap"
>
<div class="kuiTableRowCell__liner">
<a
class="kuiMenuButton kuiMenuButton--basic"
data-test-subj="dashboardListingTitleEditLink-{{item.title.split(' ').join('-')}}"
ng-href="{{ listingController.getEditUrlForItem(item) }}"
>
Edit
</a>
</div>
</td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ export function DashboardListingController($injector, $scope, $location) {
return `#${createDashboardEditUrl(item.id)}`;
};

this.getEditUrlForItem = function getEditUrlForItem(item) {
return `#${createDashboardEditUrl(item.id)}?_a=(viewMode:edit)`;
};

this.getCreateDashboardHref = function getCreateDashboardHref() {
return `#${DashboardConstants.CREATE_NEW_DASHBOARD_URL}`;
};
Expand Down

0 comments on commit c4d5018

Please sign in to comment.