mirror of
https://github.com/sasjs/server.git
synced 2025-12-23 00:31:20 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
940f705f5d | ||
|
|
7a6e6c8bec |
@@ -2,6 +2,13 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
### [0.0.32](https://github.com/sasjs/server/compare/v0.0.31...v0.0.32) (2022-03-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **web:** added delete option in Drive ([7a6e6c8](https://github.com/sasjs/server/commit/7a6e6c8becab31410d0a36bcc22e13d5359a6cdf))
|
||||||
|
|
||||||
### [0.0.31](https://github.com/sasjs/server/compare/v0.0.30...v0.0.31) (2022-03-14)
|
### [0.0.31](https://github.com/sasjs/server/compare/v0.0.30...v0.0.31) (2022-03-14)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "server",
|
"name": "server",
|
||||||
"version": "0.0.31",
|
"version": "0.0.32",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "server",
|
"name": "server",
|
||||||
"version": "0.0.31",
|
"version": "0.0.32",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"prettier": "^2.3.1",
|
"prettier": "^2.3.1",
|
||||||
"standard-version": "^9.3.2"
|
"standard-version": "^9.3.2"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "server",
|
"name": "server",
|
||||||
"version": "0.0.31",
|
"version": "0.0.32",
|
||||||
"description": "NodeJS wrapper for calling the SAS binary executable",
|
"description": "NodeJS wrapper for calling the SAS binary executable",
|
||||||
"repository": "https://github.com/sasjs/server",
|
"repository": "https://github.com/sasjs/server",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const Main = (props: any) => {
|
|||||||
if (props.selectedFilePath) {
|
if (props.selectedFilePath) {
|
||||||
setIsLoading(true)
|
setIsLoading(true)
|
||||||
axios
|
axios
|
||||||
.get(`/SASjsApi/drive/file?filePath=${props.selectedFilePath}`)
|
.get(`/SASjsApi/drive/file?_filePath=${props.selectedFilePath}`)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
setFileContent(res.data)
|
setFileContent(res.data)
|
||||||
})
|
})
|
||||||
@@ -36,6 +36,25 @@ const Main = (props: any) => {
|
|||||||
}
|
}
|
||||||
}, [props.selectedFilePath])
|
}, [props.selectedFilePath])
|
||||||
|
|
||||||
|
const handleDeleteBtnClick = () => {
|
||||||
|
setIsLoading(true)
|
||||||
|
|
||||||
|
const filePath = props.selectedFilePath
|
||||||
|
|
||||||
|
axios
|
||||||
|
.delete(`/SASjsApi/drive/file?_filePath=${filePath}`)
|
||||||
|
.then((res) => {
|
||||||
|
setFileContent('')
|
||||||
|
window.history.pushState('', '', `${baseUrl}/#/SASjsDrive`)
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setIsLoading(false)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const handleEditSaveBtnClick = () => {
|
const handleEditSaveBtnClick = () => {
|
||||||
if (!editMode) {
|
if (!editMode) {
|
||||||
setFileContentBeforeEdit(fileContent)
|
setFileContentBeforeEdit(fileContent)
|
||||||
@@ -112,6 +131,13 @@ const Main = (props: any) => {
|
|||||||
direction="row"
|
direction="row"
|
||||||
sx={{ justifyContent: 'center', marginTop: '20px' }}
|
sx={{ justifyContent: 'center', marginTop: '20px' }}
|
||||||
>
|
>
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
onClick={handleDeleteBtnClick}
|
||||||
|
disabled={isLoading || !props?.selectedFilePath}
|
||||||
|
>
|
||||||
|
Delete
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
onClick={handleEditSaveBtnClick}
|
onClick={handleEditSaveBtnClick}
|
||||||
|
|||||||
@@ -64,7 +64,10 @@ const SideBar = (props: any) => {
|
|||||||
}, [setFilePathOnMount])
|
}, [setFilePathOnMount])
|
||||||
|
|
||||||
const handleSelect = (node: TreeNode) => {
|
const handleSelect = (node: TreeNode) => {
|
||||||
if (!node.children.length) {
|
if (node.children.length) return
|
||||||
|
|
||||||
|
if (!node.name.includes('.')) return
|
||||||
|
|
||||||
window.history.pushState(
|
window.history.pushState(
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
@@ -72,7 +75,6 @@ const SideBar = (props: any) => {
|
|||||||
)
|
)
|
||||||
setSelectedFilePath(node.relativePath)
|
setSelectedFilePath(node.relativePath)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const renderTree = (nodes: TreeNode) => (
|
const renderTree = (nodes: TreeNode) => (
|
||||||
<TreeItem
|
<TreeItem
|
||||||
|
|||||||
Reference in New Issue
Block a user