|
|
@@ -24,23 +24,25 @@ const PageShareManagement = (props) => {
|
|
|
setIsOutsideShareLinkModalShown(false);
|
|
|
}
|
|
|
|
|
|
- function exportPageHundler(type) {
|
|
|
- const exportPageFile = getExportPageFile(type);
|
|
|
- exportPage(exportPageFile);
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
async function getExportPageFile(type) {
|
|
|
const pageId = pageContainer.state.pageId;
|
|
|
try {
|
|
|
- const res = await appContainer.apiv3Get('/pages/export', {'page_id': pageId,'type': type});
|
|
|
+ const res = await appContainer.apiv3Get('/pages/export', { pageId, type });
|
|
|
return res;
|
|
|
- } catch(err) {
|
|
|
+ }
|
|
|
+ catch (err) {
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function exportPage(exportPageFile) {
|
|
|
- // export
|
|
|
+ // TODO implement
|
|
|
+ }
|
|
|
+
|
|
|
+ function exportPageHundler(type) {
|
|
|
+ const exportPageFile = getExportPageFile(type);
|
|
|
+ exportPage(exportPageFile);
|
|
|
}
|
|
|
|
|
|
function renderModals() {
|
|
|
@@ -94,10 +96,10 @@ const PageShareManagement = (props) => {
|
|
|
<i className="icon-fw icon-link"></i>{t('Shere this page link to public')}
|
|
|
<span className="ml-2 badge badge-info badge-pill">{pageContainer.state.shareLinksNumber}</span>
|
|
|
</button>
|
|
|
- <button type="button" className="dropdown-item" onClick={() => {exportPageHundler('markdown')}}>
|
|
|
+ <button type="button" className="dropdown-item" onClick={() => { exportPageHundler('markdown') }}>
|
|
|
<span>Export page as Markdown</span>
|
|
|
</button>
|
|
|
- <button type="button" className="dropdown-item" onClick={() => {exportPageHundler('pdf')}}>
|
|
|
+ <button type="button" className="dropdown-item" onClick={() => { exportPageHundler('pdf') }}>
|
|
|
<span>Export page as PDF</span>
|
|
|
</button>
|
|
|
</div>
|