-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1476 from getredash/v1fixes
Multiple fixes from latest refactors
- Loading branch information
Showing
18 changed files
with
120 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
dynamic-table > div { | ||
overflow: auto; | ||
} | ||
|
||
th.sortable-column { | ||
cursor: pointer; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
<table class="table table-condensed table-hover"> | ||
<thead> | ||
<div> | ||
<table class="table table-condensed table-hover"> | ||
<thead> | ||
<tr> | ||
<th ng-repeat="column in $ctrl.columns" ng-click="$ctrl.orderBy(column)" class="sortable-column"> | ||
{{column}} <span ng-if="$ctrl.sortIcon(column)"><i class="fa fa-sort-{{$ctrl.sortIcon(column)}}"></i></span> | ||
</th> | ||
</tr> | ||
|
||
</thead> | ||
<tbody> | ||
</thead> | ||
<tbody> | ||
<tr ng-repeat="row in $ctrl.rows"> | ||
<td ng-repeat="column in $ctrl.columns"> | ||
{{row[column]}} | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
</tbody> | ||
</table> | ||
</div> | ||
<div class="text-center"> | ||
<ul uib-pagination total-items="$ctrl.rowsCount" | ||
items-per-page="$ctrl.itemsPerPage" | ||
ng-model="$ctrl.page" | ||
max-size="6" | ||
class="pagination" | ||
boundary-link-numbers="true" | ||
rotate="false" | ||
next-text='>' | ||
previous-text='<' | ||
ng-change="$ctrl.pageChanged()"></ul> | ||
items-per-page="$ctrl.itemsPerPage" | ||
ng-model="$ctrl.page" | ||
max-size="6" | ||
class="pagination" | ||
boundary-link-numbers="true" | ||
rotate="false" | ||
next-text='>' | ||
previous-text='<' | ||
ng-change="$ctrl.pageChanged()"></ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
const groupName = { | ||
bindings: { | ||
group: '<', | ||
}, | ||
transclude: true, | ||
template: ` | ||
<h2 class="p-l-5"> | ||
<edit-in-place editable="$ctrl.canEdit()" done="$ctrl.saveName" ignore-blanks='true' value="$ctrl.group.name"></edit-in-place> | ||
<button class="btn btn-xs btn-danger" ng-if="$ctrl.canEdit()" ng-click="$ctrl.deleteGroup()">Delete this group</button> | ||
</h2> | ||
`, | ||
replace: true, | ||
controller($window, $location, toastr, currentUser) { | ||
this.canEdit = () => currentUser.isAdmin && this.group.type !== 'builtin'; | ||
function controller($window, $location, toastr, currentUser) { | ||
this.canEdit = () => currentUser.isAdmin && this.group.type !== 'builtin'; | ||
|
||
this.saveName = () => { | ||
this.group.$save(); | ||
}; | ||
this.saveName = () => { | ||
this.group.$save(); | ||
}; | ||
|
||
this.deleteGroup = () => { | ||
if ($window.confirm('Are you sure you want to delete this group?')) { | ||
this.group.$delete(() => { | ||
$location.path('/groups').replace(); | ||
toastr.success('Group deleted successfully.'); | ||
}); | ||
} | ||
}; | ||
}, | ||
}; | ||
this.deleteGroup = () => { | ||
if ($window.confirm('Are you sure you want to delete this group?')) { | ||
this.group.$delete(() => { | ||
$location.path('/groups').replace(); | ||
toastr.success('Group deleted successfully.'); | ||
}); | ||
} | ||
}; | ||
} | ||
|
||
export default function (ngModule) { | ||
ngModule.component('groupName', groupName); | ||
ngModule.component('groupName', { | ||
bindings: { | ||
group: '<', | ||
}, | ||
transclude: true, | ||
template: ` | ||
<h2 class="p-l-5"> | ||
<edit-in-place editable="$ctrl.canEdit()" done="$ctrl.saveName" ignore-blanks='true' value="$ctrl.group.name"></edit-in-place> | ||
<button class="btn btn-xs btn-danger" ng-if="$ctrl.canEdit()" ng-click="$ctrl.deleteGroup()">Delete this group</button> | ||
</h2> | ||
`, | ||
replace: true, | ||
controller, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.