From c0c475ff564b23a4dabcc03ac2909207a8eb61ce Mon Sep 17 00:00:00 2001 From: undergroundwires Date: Sun, 29 Aug 2021 11:33:16 +0100 Subject: [PATCH] Change "grouping" to "view" 1. *Grouping* becomes *view*. Because *view* is more clear and extensible than *grouping*. It increases flexibility to extend by e.g. adding *flat* as a new view as discussed in #50, in this case "flat *view*" would make more sense than "flat *grouping*". 2. *None* becomes *tree*. Because *tree* is more descriptive than *none*. Updates labels on top menu. As labels are updated, the file structure/names are refactored to follow the same concept. `TheScriptsList` is renamed to `TheScriptsView`. Also refactors `ViewChanger` so view types are presented in same way. --- .../Scripts/Menu/Grouping/Grouping.ts | 4 -- .../Scripts/Menu/Grouping/TheGrouper.vue | 66 ------------------- .../Scripts/Menu/MenuOptionListItem.vue | 2 +- .../Scripts/Menu/TheScriptsMenu.vue | 8 +-- .../Scripts/Menu/View/TheViewChanger.vue | 61 +++++++++++++++++ .../components/Scripts/Menu/View/ViewType.ts | 4 ++ .../components/Scripts/TheScriptArea.vue | 12 ++-- .../Scripts/{ => View}/Cards/CardList.vue | 0 .../Scripts/{ => View}/Cards/CardListItem.vue | 2 +- .../Cards/NonCollapsingDirective.ts | 0 .../ScriptsTree/ScriptNodeParser.ts | 0 .../{ => View}/ScriptsTree/ScriptsTree.vue | 0 .../SelectableTree/INodeSelectedEvent.ts | 0 .../SelectableTree/LiquorTree/LiquorTree.d.ts | 0 .../LiquorTree/LiquorTreeOptions.ts | 0 .../NodeWrapper/NodePredicateFilter.ts | 2 +- .../NodeWrapper/NodeStateUpdater.ts | 2 +- .../LiquorTree/NodeWrapper/NodeTranslator.ts | 2 +- .../SelectableTree/Node/DocumentationUrls.vue | 0 .../ScriptsTree/SelectableTree/Node/INode.ts | 0 .../ScriptsTree/SelectableTree/Node/Node.vue | 0 .../SelectableTree/Node/RevertToggle.vue | 0 .../Node/Reverter/CategoryReverter.ts | 0 .../SelectableTree/Node/Reverter/IReverter.ts | 0 .../Node/Reverter/ReverterFactory.ts | 0 .../Node/Reverter/ScriptReverter.ts | 0 .../SelectableTree/SelectableTree.vue | 0 .../TheScriptsView.vue} | 19 +++--- src/presentation/components/TheSearchBar.vue | 2 +- .../Cards/NonCollapsingDirective.spec.ts | 4 +- .../Tree}/ScriptNodeParser.spec.ts | 6 +- .../NodeWrapper/NodePredicateFilter.spec.ts | 4 +- .../NodeWrapper/NodeStateUpdater.spec.ts | 4 +- .../NodeWrapper/NodeTranslator.spec.ts | 4 +- .../Node/Reverter/CategoryReverter.spec.ts | 4 +- .../Node/Reverter/ReverterFactory.spec.ts | 13 ++-- .../Node/Reverter/ScriptReverter.spec.ts | 4 +- 37 files changed, 112 insertions(+), 117 deletions(-) delete mode 100644 src/presentation/components/Scripts/Menu/Grouping/Grouping.ts delete mode 100644 src/presentation/components/Scripts/Menu/Grouping/TheGrouper.vue create mode 100644 src/presentation/components/Scripts/Menu/View/TheViewChanger.vue create mode 100644 src/presentation/components/Scripts/Menu/View/ViewType.ts rename src/presentation/components/Scripts/{ => View}/Cards/CardList.vue (100%) rename src/presentation/components/Scripts/{ => View}/Cards/CardListItem.vue (98%) rename src/presentation/components/Scripts/{ => View}/Cards/NonCollapsingDirective.ts (100%) rename src/presentation/components/Scripts/{ => View}/ScriptsTree/ScriptNodeParser.ts (100%) rename src/presentation/components/Scripts/{ => View}/ScriptsTree/ScriptsTree.vue (100%) rename src/presentation/components/Scripts/{ => View}/ScriptsTree/SelectableTree/INodeSelectedEvent.ts (100%) rename src/presentation/components/Scripts/{ => View}/ScriptsTree/SelectableTree/LiquorTree/LiquorTree.d.ts (100%) rename src/presentation/components/Scripts/{ => View}/ScriptsTree/SelectableTree/LiquorTree/LiquorTreeOptions.ts (100%) rename src/presentation/components/Scripts/{ => View}/ScriptsTree/SelectableTree/LiquorTree/NodeWrapper/NodePredicateFilter.ts (93%) rename src/presentation/components/Scripts/{ => View}/ScriptsTree/SelectableTree/LiquorTree/NodeWrapper/NodeStateUpdater.ts (97%) rename src/presentation/components/Scripts/{ => View}/ScriptsTree/SelectableTree/LiquorTree/NodeWrapper/NodeTranslator.ts (97%) rename src/presentation/components/Scripts/{ => View}/ScriptsTree/SelectableTree/Node/DocumentationUrls.vue (100%) rename src/presentation/components/Scripts/{ => View}/ScriptsTree/SelectableTree/Node/INode.ts (100%) rename src/presentation/components/Scripts/{ => View}/ScriptsTree/SelectableTree/Node/Node.vue (100%) rename src/presentation/components/Scripts/{ => View}/ScriptsTree/SelectableTree/Node/RevertToggle.vue (100%) rename src/presentation/components/Scripts/{ => View}/ScriptsTree/SelectableTree/Node/Reverter/CategoryReverter.ts (100%) rename src/presentation/components/Scripts/{ => View}/ScriptsTree/SelectableTree/Node/Reverter/IReverter.ts (100%) rename src/presentation/components/Scripts/{ => View}/ScriptsTree/SelectableTree/Node/Reverter/ReverterFactory.ts (100%) rename src/presentation/components/Scripts/{ => View}/ScriptsTree/SelectableTree/Node/Reverter/ScriptReverter.ts (100%) rename src/presentation/components/Scripts/{ => View}/ScriptsTree/SelectableTree/SelectableTree.vue (100%) rename src/presentation/components/Scripts/{TheScriptsList.vue => View/TheScriptsView.vue} (87%) rename tests/unit/presentation/components/Scripts/{ => View}/Cards/NonCollapsingDirective.spec.ts (96%) rename tests/unit/presentation/components/Scripts/{ScriptsTree => View/Tree}/ScriptNodeParser.spec.ts (97%) rename tests/unit/presentation/components/Scripts/{ScriptsTree => View/Tree}/SelectableTree/LiquorTree/NodeWrapper/NodePredicateFilter.spec.ts (93%) rename tests/unit/presentation/components/Scripts/{ScriptsTree => View/Tree}/SelectableTree/LiquorTree/NodeWrapper/NodeStateUpdater.spec.ts (97%) rename tests/unit/presentation/components/Scripts/{ScriptsTree => View/Tree}/SelectableTree/LiquorTree/NodeWrapper/NodeTranslator.spec.ts (96%) rename tests/unit/presentation/components/Scripts/{ScriptsTree => View/Tree}/SelectableTree/Node/Reverter/CategoryReverter.spec.ts (97%) rename tests/unit/presentation/components/Scripts/{ScriptsTree => View/Tree}/SelectableTree/Node/Reverter/ReverterFactory.spec.ts (80%) rename tests/unit/presentation/components/Scripts/{ScriptsTree => View/Tree}/SelectableTree/Node/Reverter/ScriptReverter.spec.ts (97%) diff --git a/src/presentation/components/Scripts/Menu/Grouping/Grouping.ts b/src/presentation/components/Scripts/Menu/Grouping/Grouping.ts deleted file mode 100644 index ccaf200f..00000000 --- a/src/presentation/components/Scripts/Menu/Grouping/Grouping.ts +++ /dev/null @@ -1,4 +0,0 @@ -export enum Grouping { - Cards = 1, - None = 0, -} diff --git a/src/presentation/components/Scripts/Menu/Grouping/TheGrouper.vue b/src/presentation/components/Scripts/Menu/Grouping/TheGrouper.vue deleted file mode 100644 index 23c44704..00000000 --- a/src/presentation/components/Scripts/Menu/Grouping/TheGrouper.vue +++ /dev/null @@ -1,66 +0,0 @@ - - - - - diff --git a/src/presentation/components/Scripts/Menu/MenuOptionListItem.vue b/src/presentation/components/Scripts/Menu/MenuOptionListItem.vue index 1c98c9ce..a8b98150 100644 --- a/src/presentation/components/Scripts/Menu/MenuOptionListItem.vue +++ b/src/presentation/components/Scripts/Menu/MenuOptionListItem.vue @@ -9,7 +9,7 @@ + + diff --git a/src/presentation/components/Scripts/Menu/View/ViewType.ts b/src/presentation/components/Scripts/Menu/View/ViewType.ts new file mode 100644 index 00000000..68eebb00 --- /dev/null +++ b/src/presentation/components/Scripts/Menu/View/ViewType.ts @@ -0,0 +1,4 @@ +export enum ViewType { + Cards = 1, + Tree = 0, +} diff --git a/src/presentation/components/Scripts/TheScriptArea.vue b/src/presentation/components/Scripts/TheScriptArea.vue index edbc9b9d..889cb5a9 100644 --- a/src/presentation/components/Scripts/TheScriptArea.vue +++ b/src/presentation/components/Scripts/TheScriptArea.vue @@ -1,9 +1,9 @@