Commit 65fd95d4 authored by Sang D NGO's avatar Sang D NGO
Browse files

Only domain admin can performance action on proposal

parent c9e25b66
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
$state, $state,
$stateParams, $stateParams,
$modal, $modal,
session,
mostProposalApiClient mostProposalApiClient
) { ) {
var self = this; var self = this;
...@@ -18,6 +19,7 @@ ...@@ -18,6 +19,7 @@
self.onAcceptBtnClick = onAcceptBtnClick; self.onAcceptBtnClick = onAcceptBtnClick;
function $onInit() { function $onInit() {
self.showAction = session.userIsDomainAdministrator();
mostProposalApiClient.getProposal($stateParams.proposalId) mostProposalApiClient.getProposal($stateParams.proposalId)
.then(function(proposal) { .then(function(proposal) {
self.proposal = proposal; self.proposal = proposal;
......
sub-header sub-header
most-proposal-detail-subheader( most-proposal-detail-subheader(
data-title="$ctrl.proposal.formJson.title", data-title="$ctrl.proposal.formJson.title",
show-action="$ctrl.showAction",
on-reject-btn-click="$ctrl.onRejectBtnClick()", on-reject-btn-click="$ctrl.onRejectBtnClick()",
on-review-btn-click="$ctrl.onReviewBtnClick()", on-review-btn-click="$ctrl.onReviewBtnClick()",
on-accept-btn-click="$ctrl.onAcceptBtnClick()" on-accept-btn-click="$ctrl.onAcceptBtnClick()"
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
templateUrl: '/linagora.esn.most/app/proposal/detail/subheader/most-proposal-detail-subheader.html', templateUrl: '/linagora.esn.most/app/proposal/detail/subheader/most-proposal-detail-subheader.html',
bindings: { bindings: {
title: '<', title: '<',
showAction: '<',
onRejectBtnClick: '&', onRejectBtnClick: '&',
onReviewBtnClick: '&', onReviewBtnClick: '&',
onAcceptBtnClick: '&' onAcceptBtnClick: '&'
......
...@@ -5,7 +5,7 @@ block left ...@@ -5,7 +5,7 @@ block left
span.title.ellipsis {{::$ctrl.title}} span.title.ellipsis {{::$ctrl.title}}
block right block right
ul.actions.flex-space-around ul.actions.flex-space-around(ng-if="$ctrl.showAction")
li.contact-dropdown.dropdown li.contact-dropdown.dropdown
a(href='', data-toggle='dropdown') a(href='', data-toggle='dropdown')
i.mdi.mdi-dots-vertical i.mdi.mdi-dots-vertical
......
...@@ -18,4 +18,4 @@ ...@@ -18,4 +18,4 @@
i.mdi.mdi-dots-vertical i.mdi.mdi-dots-vertical
ul.dropdown-menu.dropdown-menu-right ul.dropdown-menu.dropdown-menu-right
li li
a(href="", esn-modal-launcher="/group/app/delete/group-delete.html") #{__('Delete')} a(href="", ui-sref="most.proposal.detail({proposalId: $ctrl.proposal.id})") #{__('Xem')}
...@@ -5,5 +5,3 @@ sub-header ...@@ -5,5 +5,3 @@ sub-header
.listview.lv-bordered.lv-lg .listview.lv-bordered.lv-lg
.lv-body .lv-body
most-proposal-list-item.lv-item(proposal='proposal', ng-repeat="proposal in $ctrl.proposals") most-proposal-list-item.lv-item(proposal='proposal', ng-repeat="proposal in $ctrl.proposals")
fab(icon="plus", ui-sref="most.proposal.create")
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
function MostProposalController( function MostProposalController(
$stateParams, $stateParams,
session,
mostProposalApiClient mostProposalApiClient
) { ) {
var self = this; var self = this;
...@@ -14,6 +15,7 @@ ...@@ -14,6 +15,7 @@
function $onInit() { function $onInit() {
self.status = 'loading'; self.status = 'loading';
self.showCreateBtn = !session.userIsDomainAdministrator();
mostProposalApiClient.getProposals({ status: $stateParams.status }).then(function(proposals) { mostProposalApiClient.getProposals({ status: $stateParams.status }).then(function(proposals) {
self.status = 'loaded'; self.status = 'loaded';
......
...@@ -2,3 +2,5 @@ ...@@ -2,3 +2,5 @@
most-proposal-list(proposals="$ctrl.proposals") most-proposal-list(proposals="$ctrl.proposals")
.text-center(ng-if="$ctrl.status === 'loading'", openpaas-logo-spinner, spinner-start-active='1', spinner-size='0.5') .text-center(ng-if="$ctrl.status === 'loading'", openpaas-logo-spinner, spinner-start-active='1', spinner-size='0.5')
fab(ng-if="$ctrl.showCreateBtn", icon="plus", ui-sref="most.proposal.create")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment