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

Only domain admin can performance action on proposal

parent c9e25b66
......@@ -8,6 +8,7 @@
$state,
$stateParams,
$modal,
session,
mostProposalApiClient
) {
var self = this;
......@@ -18,6 +19,7 @@
self.onAcceptBtnClick = onAcceptBtnClick;
function $onInit() {
self.showAction = session.userIsDomainAdministrator();
mostProposalApiClient.getProposal($stateParams.proposalId)
.then(function(proposal) {
self.proposal = proposal;
......
sub-header
most-proposal-detail-subheader(
data-title="$ctrl.proposal.formJson.title",
show-action="$ctrl.showAction",
on-reject-btn-click="$ctrl.onRejectBtnClick()",
on-review-btn-click="$ctrl.onReviewBtnClick()",
on-accept-btn-click="$ctrl.onAcceptBtnClick()"
......
......@@ -7,6 +7,7 @@
templateUrl: '/linagora.esn.most/app/proposal/detail/subheader/most-proposal-detail-subheader.html',
bindings: {
title: '<',
showAction: '<',
onRejectBtnClick: '&',
onReviewBtnClick: '&',
onAcceptBtnClick: '&'
......
......@@ -5,7 +5,7 @@ block left
span.title.ellipsis {{::$ctrl.title}}
block right
ul.actions.flex-space-around
ul.actions.flex-space-around(ng-if="$ctrl.showAction")
li.contact-dropdown.dropdown
a(href='', data-toggle='dropdown')
i.mdi.mdi-dots-vertical
......
......@@ -18,4 +18,4 @@
i.mdi.mdi-dots-vertical
ul.dropdown-menu.dropdown-menu-right
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
.listview.lv-bordered.lv-lg
.lv-body
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 @@
function MostProposalController(
$stateParams,
session,
mostProposalApiClient
) {
var self = this;
......@@ -14,6 +15,7 @@
function $onInit() {
self.status = 'loading';
self.showCreateBtn = !session.userIsDomainAdministrator();
mostProposalApiClient.getProposals({ status: $stateParams.status }).then(function(proposals) {
self.status = 'loaded';
......
......@@ -2,3 +2,5 @@
most-proposal-list(proposals="$ctrl.proposals")
.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