Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Papermerge.Js
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
Papermerge.Js
Commits
83a4daba
Commit
83a4daba
authored
3 years ago
by
Eugen Ciur
Browse files
Options
Downloads
Patches
Plain Diff
better user experience for deleting records
parent
8bab497f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/components/commander/index.js
+17
-1
17 additions, 1 deletion
app/components/commander/index.js
app/components/modal/delete_node.js
+4
-1
4 additions, 1 deletion
app/components/modal/delete_node.js
with
21 additions
and
2 deletions
app/components/commander/index.js
+
17
−
1
View file @
83a4daba
...
...
@@ -31,6 +31,9 @@ export default class CommanderComponent extends Component {
@
tracked
new_records
=
A
([]);
@
tracked
__new_record
;
// used as workaround for an ember bug
@
tracked
deleted_records
=
A
([]);
@
tracked
__deleted_records
;
// used as workaround for an ember bug
@
action
openNewFolderModal
()
{
this
.
show_new_folder_modal
=
true
;
...
...
@@ -60,9 +63,11 @@ export default class CommanderComponent extends Component {
}
@
action
closeConfirmDeletionModal
()
{
closeConfirmDeletionModal
(
deleted_records
)
{
this
.
show_confirm_deletion_modal
=
false
;
this
.
selected_nodes
=
A
([]);
this
.
deleted_records
=
this
.
deleted_records
.
concat
(
deleted_records
);
this
.
__deleted_records
=
deleted_records
;
}
@
action
...
...
@@ -115,6 +120,12 @@ export default class CommanderComponent extends Component {
}
}
if
(
this
.
deleted_records
.
length
>
0
)
{
children_copy
=
children_copy
.
filter
(
item
=>
!
this
.
deleted_records
.
includes
(
item
)
);
}
if
(
this
.
__new_record
)
{
// workaround ember bug
// Ember bug! Without this empty statement
// updates on tracked attributes ``this.new_records``
...
...
@@ -122,6 +133,11 @@ export default class CommanderComponent extends Component {
//
// pass
}
if
(
this
.
__deleted_records
)
{
// similar to ``this.__new_record`` - it is used
// here to help ember with tracking of ``this.deleted_records`` array
}
return
children_copy
;
}
}
This diff is collapsed.
Click to expand it.
app/components/modal/delete_node.js
+
4
−
1
View file @
83a4daba
import
{
action
}
from
'
@ember/object
'
;
import
{
inject
as
service
}
from
'
@ember/service
'
;
import
{
A
}
from
'
@ember/array
'
;
import
BaseComponent
from
"
./base
"
;
...
...
@@ -14,11 +15,13 @@ export default class DeleteNodeComponent extends BaseComponent {
@
action
onSubmit
()
{
let
nodes_copy
=
A
(
this
.
nodes
);
this
.
nodes
.
forEach
((
node
)
=>
{
node
.
destroyRecord
();
});
this
.
args
.
onClose
();
this
.
args
.
onClose
(
nodes_copy
);
}
get
titles_to_be_deleted
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment