(groupId: UniqueId)
| 690 | } |
| 691 | |
| 692 | public closeAll(groupId: UniqueId) { |
| 693 | const { current, groups = [] } = this.state; |
| 694 | const groupIndex = this.getGroupIndexById(groupId); |
| 695 | |
| 696 | if (groupIndex > -1) { |
| 697 | const nextGroups = [...groups]; |
| 698 | let nextCurrentGroup = current; |
| 699 | |
| 700 | const removedGroup = nextGroups.splice(groupIndex, 1); |
| 701 | |
| 702 | const removed = cloneDeep( |
| 703 | removedGroup[0].data?.filter( |
| 704 | (item) => !this.isOpened(item.id!, nextGroups) |
| 705 | ) || [] |
| 706 | ); |
| 707 | |
| 708 | if (current && current.id === groupId) { |
| 709 | nextCurrentGroup = |
| 710 | groups[groupIndex + 1] || groups[groupIndex - 1]; |
| 711 | } |
| 712 | |
| 713 | this.setState( |
| 714 | { |
| 715 | groups: nextGroups, |
| 716 | current: nextCurrentGroup, |
| 717 | }, |
| 718 | () => { |
| 719 | // dispose all models in specific group |
| 720 | this.disposeModel(removed); |
| 721 | this.explorerService.forceUpdate(); |
| 722 | } |
| 723 | ); |
| 724 | // reset editor group |
| 725 | this.layoutService.setGroupSplitSize( |
| 726 | nextGroups.length |
| 727 | ? new Array(nextGroups.length + 1).fill('auto') |
| 728 | : [] |
| 729 | ); |
| 730 | } |
| 731 | } |
| 732 | |
| 733 | public cloneGroup(groupId?: UniqueId): IEditorGroup { |
| 734 | const { current, groups = [] } = this.state; |
nothing calls this directly
no test coverage detected