loading: boolean;
saveEnabled: boolean;
sharedResourceUuid: string;
+ sharingURLsNr: number;
+ privateAccess: boolean;
}
export interface SharingDialogActionProps {
onClose: () => void;
}
export default (props: SharingDialogDataProps & SharingDialogActionProps) => {
const { open, loading, saveEnabled, sharedResourceUuid,
+ sharingURLsNr, privateAccess,
onClose, onSave, onCreateSharingToken, refreshPermissions } = props;
const showTabs = extractUuidObjectType(sharedResourceUuid) === ResourceObjectType.COLLECTION;
const [tabNr, setTabNr] = React.useState<number>(SharingDialogTab.PERMISSIONS);
setTabNr(tb)}
}>
<Tab label="With users/groups" />
- <Tab label="Sharing URLs" disabled={saveEnabled} />
+ <Tab label={`Sharing URLs ${sharingURLsNr > 0 ? '('+sharingURLsNr+')' : ''}`} disabled={saveEnabled} />
</Tabs>
}
<DialogContent>
{ tabNr === SharingDialogTab.PERMISSIONS &&
<Grid item md={12}>
<SharingInvitationForm />
- </Grid> }
+ </Grid>
+ }
{ tabNr === SharingDialogTab.URLS && withExpiration && <>
<Grid item container direction='row' md={12}>
<MuiPickersUtilsProvider utils={DateFnsUtils}>
Maximum expiration date may be limited by the cluster configuration.
</Typography>
</Grid>
- </> }
+ </>
+ }
+ { tabNr === SharingDialogTab.PERMISSIONS && privateAccess && sharingURLsNr > 0 &&
+ <Grid item md={12}>
+ <Typography variant='caption' align='center' color='error'>
+ Although there aren't specific permissions set, this is publicly accessible via Sharing URL(s).
+ </Typography>
+ </Grid>
+ }
<Grid item xs />
{ tabNr === SharingDialogTab.URLS && <>
<Grid item><FormControlLabel
Create sharing URL
</Button>
</Grid>
- </>}
+ </>
+ }
{ tabNr === SharingDialogTab.PERMISSIONS &&
<Grid item>
<Button onClick={onSave} variant="contained" color="primary"