Web: Files: fixed empty links context-menu
This commit is contained in:
parent
af744d3dff
commit
17be338ccf
@ -146,5 +146,7 @@
|
||||
"Links": "Links",
|
||||
"WantToRestoreTheRoom": "All external links in this room will become active, and its contents will be available to everyone with the link. Do you want to restore the room?",
|
||||
"WantToRestoreTheRooms": "All external links in restored rooms will become active, and their contents will be available to everyone with the room links. Do you want to restore the rooms?",
|
||||
"LinkValidUntil": "This link will be valid until"
|
||||
"LinkValidUntil": "This link will be valid until",
|
||||
"NoExternalLinks": "No external links",
|
||||
"AllLinksAreDisabled": "All links are disabled"
|
||||
}
|
||||
|
@ -39,6 +39,5 @@
|
||||
"SystemProperties": "System properties",
|
||||
"UsersInRoom": "Users in room",
|
||||
"Versions": "Versions",
|
||||
"LinksToViewingIcon": "Links to Viewing",
|
||||
"NoExternalLinks": "No external links"
|
||||
"LinksToViewingIcon": "Links to Viewing"
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ const PublicRoomBlock = (props) => {
|
||||
<Text fontSize="14px" fontWeight={600} color="#a3a9ae">
|
||||
{externalLinks.length
|
||||
? t("LinksToViewingIcon")
|
||||
: t("NoExternalLinks")}
|
||||
: t("Files:NoExternalLinks")}
|
||||
</Text>
|
||||
<IconButton
|
||||
className="link-to-viewing-icon"
|
||||
|
@ -224,7 +224,7 @@ export default inject(({ auth, treeFoldersStore, filesStore }) => {
|
||||
};
|
||||
})(
|
||||
observer(
|
||||
withTranslation(["Files", "Translations"])(
|
||||
withTranslation(["Files", "Translations", "Notifications"])(
|
||||
withContent(withBadges(FilesRowContent))
|
||||
)
|
||||
)
|
||||
|
@ -367,6 +367,9 @@ const SimpleFilesRow = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default withTranslation(["Files", "Translations", "InfoPanel"])(
|
||||
withFileActions(withQuickButtons(SimpleFilesRow))
|
||||
);
|
||||
export default withTranslation([
|
||||
"Files",
|
||||
"Translations",
|
||||
"InfoPanel",
|
||||
"Notifications",
|
||||
])(withFileActions(withQuickButtons(SimpleFilesRow)));
|
||||
|
@ -544,7 +544,7 @@ export default inject(
|
||||
};
|
||||
}
|
||||
)(
|
||||
withTranslation(["Files", "Common", "Translations"])(
|
||||
withTranslation(["Files", "Common", "Translations", "Notifications"])(
|
||||
observer(FilesTableHeader)
|
||||
)
|
||||
);
|
||||
|
@ -168,6 +168,9 @@ const FilesTableRow = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default withTranslation(["Files", "Common", "InfoPanel"])(
|
||||
withFileActions(withContent(withQuickButtons(withBadges(FilesTableRow))))
|
||||
);
|
||||
export default withTranslation([
|
||||
"Files",
|
||||
"Common",
|
||||
"InfoPanel",
|
||||
"Notifications",
|
||||
])(withFileActions(withContent(withQuickButtons(withBadges(FilesTableRow)))));
|
||||
|
@ -170,7 +170,7 @@ export default inject(
|
||||
};
|
||||
}
|
||||
)(
|
||||
withTranslation(["Files", "InfoPanel"])(
|
||||
withTranslation(["Files", "InfoPanel", "Notifications"])(
|
||||
withFileActions(withBadges(withQuickButtons(observer(FileTile))))
|
||||
)
|
||||
);
|
||||
|
@ -127,7 +127,7 @@ export default inject(({ auth, treeFoldersStore }) => {
|
||||
return { theme: auth.settingsStore.theme, isRooms };
|
||||
})(
|
||||
observer(
|
||||
withTranslation(["Files", "Translations"])(
|
||||
withTranslation(["Files", "Translations", "Notifications"])(
|
||||
withContent(withBadges(FilesTileContent))
|
||||
)
|
||||
)
|
||||
|
@ -290,4 +290,6 @@ export default inject(({ auth, filesStore, treeFoldersStore }) => {
|
||||
isRecentFolder,
|
||||
isDesc,
|
||||
};
|
||||
})(observer(withTranslation(["Files", "Common"])(TileContainer)));
|
||||
})(
|
||||
observer(withTranslation(["Files", "Common", "Notifications"])(TileContainer))
|
||||
);
|
||||
|
@ -559,15 +559,16 @@ class ContextOptionsStore {
|
||||
|
||||
onLoadLinks = async (t, item) => {
|
||||
const promise = new Promise(async (resolve, reject) => {
|
||||
const linksArray = [];
|
||||
let linksArray = [];
|
||||
|
||||
this.setLoaderTimer(true);
|
||||
try {
|
||||
const links = await this.publicRoomStore.fetchExternalLinks(item.id);
|
||||
|
||||
for (let item of links) {
|
||||
const { id, title, shareLink } = item.sharedTo;
|
||||
const { id, title, shareLink, disabled, isExpired } = item.sharedTo;
|
||||
|
||||
if (!disabled && !isExpired) {
|
||||
linksArray.push({
|
||||
icon: InvitationLinkReactSvgUrl,
|
||||
id,
|
||||
@ -579,6 +580,32 @@ class ContextOptionsStore {
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (!linksArray.length) {
|
||||
linksArray = [
|
||||
{
|
||||
id: "no-external-links-option",
|
||||
key: "no-external-links",
|
||||
label: !links.length
|
||||
? t("Files:NoExternalLinks")
|
||||
: t("Files:AllLinksAreDisabled"),
|
||||
disableColor: true,
|
||||
},
|
||||
{
|
||||
key: "separator0",
|
||||
isSeparator: true,
|
||||
},
|
||||
{
|
||||
icon: SettingsReactSvgUrl,
|
||||
id: "manage-option",
|
||||
key: "manage-links",
|
||||
label: t("Notifications:ManageNotifications"),
|
||||
onClick: () => this.onShowInfoPanel(item),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
this.setLoaderTimer(false, () => resolve(linksArray));
|
||||
} catch (error) {
|
||||
toastr.error(error);
|
||||
|
@ -155,10 +155,10 @@ const SubMenu = (props) => {
|
||||
item.className
|
||||
);
|
||||
const linkClassName = classNames("p-menuitem-link", "not-selectable", {
|
||||
"p-disabled": item.disabled,
|
||||
"p-disabled": item.disabled || item.disableColor,
|
||||
});
|
||||
const iconClassName = classNames("p-menuitem-icon", {
|
||||
"p-disabled": item.disabled,
|
||||
"p-disabled": item.disabled || item.disableColor,
|
||||
});
|
||||
const subMenuIconClassName = "p-submenu-icon";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user