fix(calendar(js)): allow event invitations to be moved

Fixes #4926
pull/269/head
Francis Lachapelle 2020-01-17 11:34:37 -05:00
parent 62f64314c0
commit 001d76fd05
2 changed files with 14 additions and 2 deletions

View File

@ -49,7 +49,7 @@
</md-menu-content>
</md-menu>
</md-menu-item>
<md-menu-item ng-hide="::editor.component.isReadOnly">
<md-menu-item ng-show="editor.component.isMovable()">
<md-menu>
<md-button label:aria-label="Move To" ng-click="$mdMenu.open($event)">
<var:string label:value="Move To"/>

View File

@ -694,13 +694,25 @@
/**
* @function isInvitationOccurrence
* @memberof Component.prototype
* @desc Check if the component an invitation and an occurrence of a recurrent component
* @desc Check if the component is an invitation and an occurrence of a recurrent component
* @returns true or false
*/
Component.prototype.isInvitationOccurrence = function() {
return (this.occurrenceId && this.userHasRSVP);
};
/**
* @function isMovable
* @memberof Component.prototype
* @desc Return true if the component can be moved to a different calendar which occurs in two cases:
* - the component is editable, ie is owned by the current user;
* - the component is an invitation and the current user is an attendee.
* @returns true or false
*/
Component.prototype.isMovable = function() {
return (!this.isReadOnly || this.userHasRSVP);
};
/**
* @function showPercentComplete
* @memberof Component.prototype