@@ -13,6 +13,7 @@ import { RenamingSidebarButtonComponent } from './renaming-button/renaming-sideb
1313import { DeletingSidebarButtonComponent } from './deleting-button/deleting-sidebar-button.component' ;
1414import { TranslateModule } from '@ngx-translate/core' ;
1515import { VariableTabUIAction } from 'src/app/new.state/ui/ui.actions' ;
16+ import { XmlManipulationActions } from 'src/app/new.state/xml/xml.actions' ;
1617
1718@Component ( {
1819 selector : 'dct-sidebar-button' ,
@@ -35,10 +36,6 @@ export class SidebarButtonComponent {
3536 selected = input . required < boolean > ( ) ;
3637 disabledOptions = input < boolean > ( false ) ;
3738
38- changeSelectedGroupID = output < string > ( ) ;
39- emitDeleteGroup = output < string > ( ) ;
40- emitRenameGroup = output < { groupID : string ; newLabel : string } > ( ) ;
41-
4239 renaming = signal ( false ) ;
4340 renamingActive = computed ( ( ) => {
4441 return this . selected ( ) && this . renaming ( ) ;
@@ -54,34 +51,41 @@ export class SidebarButtonComponent {
5451 this . store . dispatch (
5552 VariableTabUIAction . changeSelectedGroupID ( { groupID : this . groupID ( ) } ) ,
5653 ) ;
57- // const elem = document.activeElement;
58- // if (elem instanceof HTMLElement) {
59- // elem?.blur();
60- // }
61- // setTimeout(()=> {
62- // const heading = document.querySelector('#tableHeading');
63- // if (heading) {
64- // (heading as HTMLElement)?.focus();
65- // }
66- // }, 1000)
54+ const elem = document . activeElement ;
55+ if ( elem instanceof HTMLElement ) {
56+ elem ?. blur ( ) ;
57+ }
58+ setTimeout ( ( ) => {
59+ const heading = document . querySelector ( '#tableHeading' ) ;
60+ if ( heading ) {
61+ ( heading as HTMLElement ) ?. focus ( ) ;
62+ }
63+ } , 1000 ) ;
6764 }
6865
6966 delete ( ) {
7067 this . deleting . set ( true ) ;
7168 }
7269
7370 confirmDelete ( ) {
71+ this . store . dispatch (
72+ XmlManipulationActions . deleteGroup ( { groupID : this . groupID ( ) } ) ,
73+ ) ;
7474 this . resetUI ( ) ;
75- this . emitDeleteGroup . emit ( this . groupID ( ) ) ;
7675 }
7776
7877 rename ( ) {
7978 this . renaming . set ( true ) ;
8079 }
8180
8281 confirmRename ( newLabel : string ) {
82+ this . store . dispatch (
83+ XmlManipulationActions . renameGroup ( {
84+ groupID : this . groupID ( ) ,
85+ newLabel,
86+ } ) ,
87+ ) ;
8388 this . resetUI ( ) ;
84- this . emitRenameGroup . emit ( { groupID : this . groupID ( ) , newLabel } ) ;
8589 }
8690
8791 resetUI ( ) {
0 commit comments