remove download options
This commit is contained in:
@@ -42,7 +42,6 @@
|
|||||||
<SMButton
|
<SMButton
|
||||||
label="Edit"
|
label="Edit"
|
||||||
:dropdown="{
|
:dropdown="{
|
||||||
download: 'Download',
|
|
||||||
delete: 'Delete',
|
delete: 'Delete',
|
||||||
}"
|
}"
|
||||||
size="medium"
|
size="medium"
|
||||||
@@ -112,15 +111,13 @@ const handleSearch = () => {
|
|||||||
/**
|
/**
|
||||||
* Handle user selecting option in action button.
|
* Handle user selecting option in action button.
|
||||||
*
|
*
|
||||||
* @param {Media} item The media item.
|
* @param {Article} item The article item.
|
||||||
* @param {string} extra The option selected.
|
* @param {string} extra The option selected.
|
||||||
* @param option
|
* @param option
|
||||||
*/
|
*/
|
||||||
const handleActionButton = (item: Article, option: string): void => {
|
const handleActionButton = (item: Article, option: string): void => {
|
||||||
if (option.length == 0) {
|
if (option.length == 0) {
|
||||||
handleEdit(item);
|
handleEdit(item);
|
||||||
} else if (option.toLowerCase() == "download") {
|
|
||||||
handleDownload(item);
|
|
||||||
} else if (option.toLowerCase() == "delete") {
|
} else if (option.toLowerCase() == "delete") {
|
||||||
handleDelete(item);
|
handleDelete(item);
|
||||||
}
|
}
|
||||||
@@ -192,18 +189,18 @@ const handleLoad = async () => {
|
|||||||
/**
|
/**
|
||||||
* User requests to edit the item
|
* User requests to edit the item
|
||||||
*
|
*
|
||||||
* @param {Media} item The media item.
|
* @param {Artile} item The article item.
|
||||||
*/
|
*/
|
||||||
const handleEdit = (item: Media) => {
|
const handleEdit = (item: Article) => {
|
||||||
router.push({ name: "dashboard-media-edit", params: { id: item.id } });
|
router.push({ name: "dashboard-article-edit", params: { id: item.id } });
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request to delete a media item from the server.
|
* Request to delete a article item from the server.
|
||||||
*
|
*
|
||||||
* @param {Media} item The media object to delete.
|
* @param {Article} item The article object to delete.
|
||||||
*/
|
*/
|
||||||
const handleDelete = async (item: Media) => {
|
const handleDelete = async (item: Article) => {
|
||||||
let result = await openDialog(SMDialogConfirm, {
|
let result = await openDialog(SMDialogConfirm, {
|
||||||
title: "Delete File?",
|
title: "Delete File?",
|
||||||
text: `Are you sure you want to delete the file <strong>${item.title}</strong>?`,
|
text: `Are you sure you want to delete the file <strong>${item.title}</strong>?`,
|
||||||
@@ -220,7 +217,7 @@ const handleDelete = async (item: Media) => {
|
|||||||
if (result == true) {
|
if (result == true) {
|
||||||
try {
|
try {
|
||||||
await api.delete({
|
await api.delete({
|
||||||
url: "/media/{id}",
|
url: "/articles/{id}",
|
||||||
params: {
|
params: {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
},
|
},
|
||||||
@@ -244,15 +241,6 @@ const handleDelete = async (item: Media) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Handle the user requesting to download the item.
|
|
||||||
*
|
|
||||||
* @param {Media} item The media item.
|
|
||||||
*/
|
|
||||||
const handleDownload = (item: Media) => {
|
|
||||||
window.open(`${item.url}?download=1`, "_blank");
|
|
||||||
};
|
|
||||||
|
|
||||||
handleLoad();
|
handleLoad();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -275,7 +263,7 @@ handleLoad();
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 768px) {
|
@media only screen and (max-width: 768px) {
|
||||||
.page-dashboard-media-list {
|
.page-dashboard-article-list {
|
||||||
.toolbar-search {
|
.toolbar-search {
|
||||||
max-width: none;
|
max-width: none;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user