Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
e65d5f78
Unverified
Commit
e65d5f78
authored
Jun 24, 2023
by
zhu-mingye
Committed by
GitHub
Jun 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorder after removing items (#2103)
parent
6199d7fc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
index.tsx
...RegCenter/GitProject/components/ProjectProTable/index.tsx
+12
-10
No files found.
dinky-web/src/pages/RegCenter/GitProject/components/ProjectProTable/index.tsx
View file @
e65d5f78
...
@@ -118,7 +118,6 @@ const ProjectProTable: React.FC = () => {
...
@@ -118,7 +118,6 @@ const ProjectProTable: React.FC = () => {
if
(
result
)
{
if
(
result
)
{
setFormValues
(
value
);
setFormValues
(
value
);
handleBuildVisible
(
true
);
handleBuildVisible
(
true
);
// todo : build success, set build modal visible and set build steps
}
}
});
});
};
};
...
@@ -133,6 +132,15 @@ const ProjectProTable: React.FC = () => {
...
@@ -133,6 +132,15 @@ const ProjectProTable: React.FC = () => {
handleUpdateModalVisible
(
true
);
handleUpdateModalVisible
(
true
);
};
};
/**
* drag sort call
* @param {GitProject[]} newDataSource
* @returns {Promise<void>}
*/
const
handleDragSortEnd
=
async
(
newDataSource
:
GitProject
[])
=>
{
const
updatedItems
=
newDataSource
.
map
((
item
:
GitProject
,
index
:
number
)
=>
({...
item
,
orderLine
:
index
+
1
,}));
await
executeAndCallback
(
async
()
=>
await
handleOption
(
API_CONSTANTS
.
GIT_DRAGEND_SORT_PROJECT
,
l
(
'rc.gp.ucl.projectOrder'
),{
sortList
:
updatedItems
}));
};
/**
/**
* delete git project by id
* delete git project by id
...
@@ -141,6 +149,8 @@ const ProjectProTable: React.FC = () => {
...
@@ -141,6 +149,8 @@ const ProjectProTable: React.FC = () => {
*/
*/
const
handleDeleteSubmit
=
async
(
id
:
number
)
=>
{
const
handleDeleteSubmit
=
async
(
id
:
number
)
=>
{
await
executeAndCallback
(
async
()
=>
await
handleRemoveById
(
API_CONSTANTS
.
GIT_PROJECT_DELETE
,
id
));
await
executeAndCallback
(
async
()
=>
await
handleRemoveById
(
API_CONSTANTS
.
GIT_PROJECT_DELETE
,
id
));
await
queryList
(
API_CONSTANTS
.
GIT_PROJECT
).
then
(
res
=>
handleDragSortEnd
(
res
.
data
));
actionRef
.
current
?.
reload
()
};
};
/**
/**
...
@@ -292,15 +302,7 @@ const ProjectProTable: React.FC = () => {
...
@@ -292,15 +302,7 @@ const ProjectProTable: React.FC = () => {
handleCancel
();
handleCancel
();
};
};
/**
* drag sort call
* @param {GitProject[]} newDataSource
* @returns {Promise<void>}
*/
const
handleDragSortEnd
=
async
(
newDataSource
:
GitProject
[])
=>
{
const
updatedItems
=
newDataSource
.
map
((
item
:
GitProject
,
index
:
number
)
=>
({...
item
,
orderLine
:
index
+
1
,}));
await
executeAndCallback
(
async
()
=>
await
handleOption
(
API_CONSTANTS
.
GIT_DRAGEND_SORT_PROJECT
,
l
(
'rc.gp.ucl.projectOrder'
),{
sortList
:
updatedItems
}));
};
/**
/**
* render jar
* render jar
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment