@ -41,7 +41,7 @@
< / div >
<!-- pending actions -- >
< NcActions v -if = " ! pending & & ( pendingPassword | | pendingEnforcedPassword | | pendingExpirationDate ) "
< NcActions v -if = " ! pending & & pendingDataIsMissing "
class = "sharing-entry__actions"
: aria - label = "actionsTooltip"
menu - align = "right"
@ -82,10 +82,18 @@
< / template >
< / NcActionInput >
< NcActionCheckbox v -if = " hasDefaultExpirationDate "
: checked . sync = "defaultExpirationDateEnabled"
: disabled = "pendingEnforcedExpirationDate || saving"
class = "share-link-expiration-date-checkbox"
@ change = "onDefaultExpirationDateEnabledChange" >
{ { config . enforcePasswordForPublicLink ? t ( 'files_sharing' , 'Enable link expiration (enforced)' ) : t ( 'files_sharing' , 'Enable link expiration' ) } }
< / NcActionCheckbox >
<!-- expiration date -- >
< NcActionInput v -if = " pendingExpirationDate "
< NcActionInput v -if = " ( hasDefaultExpirationDate | | pendingE nforcedE xpirationDate) & & defaultExpirationDateEnabled "
class = "share-link-expire-date"
: label = "t('files_sharing', 'Expiration date (enforced)')"
: label = " pendingEnforcedExpirationDate ? t('files_sharing', 'Enter e xpiration date (enforced)') : t('files_sharing', 'Enter expiration date ')"
: disabled = "saving"
: is - native - picker = "true"
: hide - label = "true"
@ -289,6 +297,7 @@ export default {
shareCreationComplete : false ,
copySuccess : true ,
copied : false ,
defaultExpirationDateEnabled : false ,
/ / A r e w e w a i t i n g f o r p a s s w o r d / e x p i r a t i o n d a t e
pending : false ,
@ -462,14 +471,28 @@ export default {
*
* @ return { boolean }
* /
pendingDataIsMissing ( ) {
return this . pendingPassword || this . pendingEnforcedPassword || this . pendingEnforcedExpirationDate
} ,
pendingPassword ( ) {
return this . config . enableLinkPasswordByDefault && this . share && ! this . share . id
return this . config . enableLinkPasswordByDefault && this . isPendingShare
} ,
pendingEnforcedPassword ( ) {
return this . config . enforcePasswordForPublicLink && this . share && ! this . share . id
return this . config . enforcePasswordForPublicLink && this . isPendingShare
} ,
pendingEnforcedExpirationDate ( ) {
return this . config . isDefaultExpireDateEnforced && this . isPendingShare
} ,
hasDefaultExpirationDate ( ) {
return ( this . config . defaultExpirationDate instanceof Date || ! isNaN ( new Date ( this . config . defaultExpirationDate ) . getTime ( ) ) ) && this . isPendingShare
} ,
pendingExpirationDate ( ) {
return this . config . isDefaultExpireDateEnforced && this . share && ! this . share . id
isPendingShare ( ) {
return ! ! ( this . share && ! this . share . id )
} ,
shareRequiresReview ( ) {
return this . defaultExpirationDateEnabled || this . config . enableLinkPasswordByDefault
} ,
sharePolicyHasRequiredProperties ( ) {
@ -572,6 +595,10 @@ export default {
return this . share . isFileRequest
} ,
} ,
mounted ( ) {
this . defaultExpirationDateEnabled = this . config . defaultExpirationDate instanceof Date
this . share . expireDate = this . defaultExpirationDateEnabled ? this . formatDateToString ( this . config . defaultExpirationDate ) : ''
} ,
methods : {
/ * *
@ -594,8 +621,10 @@ export default {
}
this . logger . debug ( 'Missing required properties?' , this . requiredPropertiesMissing )
/ / d o n o t p u s h y e t i f w e n e e d a p a s s w o r d o r a n e x p i r a t i o n d a t e : s h o w p e n d i n g m e n u
if ( this . sharePolicyHasRequiredProperties && this . requiredPropertiesMissing ) {
/ / D o n o t p u s h y e t i f w e n e e d a p a s s w o r d o r a n e x p i r a t i o n d a t e : s h o w p e n d i n g m e n u
/ / A s h a r e w o u l d r e q u i r e a r e v i e w f o r e x a m p l e i s d e f a u l t e x p i r a t i o n d a t e i s s e t b u t n o t e n f o r c e d , t h i s a l l o w s
/ / t h e u s e r t o r e v i e w t h e s h a r e a n d r e m o v e t h e e x p i r a t i o n d a t e i f t h e y d o n ' t w a n t i t
if ( ( this . sharePolicyHasRequiredProperties && this . requiredPropertiesMissing ) || this . shareRequiresReview ) {
this . pending = true
this . shareCreationComplete = false
@ -829,6 +858,9 @@ export default {
this . onPasswordSubmit ( )
this . onNoteSubmit ( )
} ,
onDefaultExpirationDateEnabledChange ( enabled ) {
this . share . expireDate = enabled ? this . formatDateToString ( this . config . defaultExpirationDate ) : ''
} ,
/ * *
* Cancel the share creation