-
-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Also aligns items on top menu vertically - Renames SelectionStatus to RecommentationLevel in the top menu to make it more clear. - In App.vue it renames row class to `app__row` to avoid misusage as styles are not scoped in it. - In ScriptsArea, remove unintended row class refering to global style, make styling menu class more verbose and lower bottom margin. - Change category toggle so its status become reverted when all of its reversible scripts are reverted, before it did not care about reversible scripts but required all scripts to be reverted. If a category has no reversible scripts, revert toggle returns false.
- Loading branch information
1 parent
e122215
commit fe17479
Showing
23 changed files
with
566 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* Represents preferred position in generated user script */ | ||
export class ScriptPosition { | ||
constructor( | ||
public readonly positionInFile: number, | ||
public readonly positionInCategory: number) { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/presentation/components/Scripts/Menu/Recommendation/RecommendationStatusType.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export enum RecommendationStatusType { | ||
Standard, | ||
Strict, | ||
All, | ||
None, | ||
Custom, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/presentation/components/Scripts/Menu/Revert/RevertStatusHandler.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { SelectedScript } from '@/application/Context/State/Selection/SelectedScript'; | ||
import { RevertStatusType } from './RevertStatusType'; | ||
import { IUserSelection } from '@/application/Context/State/Selection/IUserSelection'; | ||
|
||
export class RevertStatusHandler { | ||
public getCurrentStatusType(scripts: readonly SelectedScript[]): RevertStatusType { | ||
const allRevertStatuses = getReversibleScripts(scripts) | ||
.map((script) => script.revert); | ||
if (!allRevertStatuses.length) { | ||
return RevertStatusType.NothingIsReversible; | ||
} | ||
if (allRevertStatuses.every((c) => c === true)) { | ||
return RevertStatusType.AllReverted; | ||
} | ||
if (allRevertStatuses.every((c) => c === false)) { | ||
return RevertStatusType.NoneReverted; | ||
} | ||
return RevertStatusType.SomeReverted; | ||
} | ||
public setType(revert: boolean, selection: IUserSelection) { | ||
const scriptsToChange = getReversibleScripts(selection.selectedScripts) | ||
.map((script) => new SelectedScript(script.script, revert)); | ||
selection.addOrUpdateAll(scriptsToChange); | ||
} | ||
} | ||
|
||
function getReversibleScripts(scripts: readonly SelectedScript[]) { | ||
return scripts.filter((script) => script.script.canRevert()); | ||
} |
6 changes: 6 additions & 0 deletions
6
src/presentation/components/Scripts/Menu/Revert/RevertStatusType.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export enum RevertStatusType { | ||
NothingIsReversible, | ||
NoneReverted, | ||
SomeReverted, | ||
AllReverted, | ||
} |
Oops, something went wrong.