Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
edd076fade | ||
|
|
0ce354ea09 | ||
|
|
19813b6917 | ||
|
|
97a7747933 | ||
|
|
92f1a36bcb | ||
|
|
31364bdfec | ||
|
|
5b743a67a4 | ||
|
|
16a7327750 | ||
|
|
5ea46ecbf5 | ||
|
|
e3f82e069e | ||
|
|
95baf3175b | ||
|
|
89862b2775 |
18
CHANGELOG.md
18
CHANGELOG.md
@@ -2,7 +2,19 @@
|
|||||||
|
|
||||||
- All notable changes to this project will be documented in this file.
|
- All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## [Unreleased]
|
## Unreleased
|
||||||
|
|
||||||
|
## [0.4.1] - 2020-01-11
|
||||||
|
|
||||||
|
- Fixed & improved search
|
||||||
|
- Hiding grouping while searching
|
||||||
|
- Showing search queries when searching
|
||||||
|
|
||||||
|
## [0.4.0] - 2020-01-11
|
||||||
|
|
||||||
|
- Added search
|
||||||
|
- Some styling improvements
|
||||||
|
- Better organization of scripts + more scripts
|
||||||
|
|
||||||
## [0.3.0] - 2020-01-09
|
## [0.3.0] - 2020-01-09
|
||||||
|
|
||||||
@@ -27,7 +39,9 @@
|
|||||||
|
|
||||||
## All releases
|
## All releases
|
||||||
|
|
||||||
- [Unreleased] : https://github.com/undergroundwires/privacy.sexy/compare/v0.3.0...HEAD
|
- [Unreleased] : https://github.com/undergroundwires/privacy.sexy/compare/v0.4.1...HEAD
|
||||||
|
- [v0.4.0] : https://github.com/undergroundwires/privacy.sexy/compare/v0.4.0...v0.4.1
|
||||||
|
- [v0.4.0] : https://github.com/undergroundwires/privacy.sexy/compare/v0.3.0...v0.4.0
|
||||||
- [v0.3.0] : https://github.com/undergroundwires/privacy.sexy/compare/v0.2.0...v0.3.0
|
- [v0.3.0] : https://github.com/undergroundwires/privacy.sexy/compare/v0.2.0...v0.3.0
|
||||||
- [v0.2.0] : https://github.com/undergroundwires/privacy.sexy/compare/v0.1.0...v0.2.0
|
- [v0.2.0] : https://github.com/undergroundwires/privacy.sexy/compare/v0.1.0...v0.2.0
|
||||||
- [v0.1.0] : https://github.com/undergroundwires/privacy.sexy/releases/tag/v0.1.0
|
- [v0.1.0] : https://github.com/undergroundwires/privacy.sexy/releases/tag/v0.1.0
|
||||||
|
|||||||
19
src/App.vue
19
src/App.vue
@@ -1,9 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<TheHeader class="row"
|
<TheHeader class="row" />
|
||||||
github-url="https://github.com/undergroundwires/privacy.sexy" />
|
<TheSearchBar class="row" />
|
||||||
<!-- <TheSearchBar> </TheSearchBar> -->
|
|
||||||
<TheScripts class="row"/>
|
<TheScripts class="row"/>
|
||||||
<TheCodeArea class="row" theme="xcode" />
|
<TheCodeArea class="row" theme="xcode" />
|
||||||
<TheCodeButtons class="row" />
|
<TheCodeButtons class="row" />
|
||||||
@@ -15,20 +14,20 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Component, Vue, Prop } from 'vue-property-decorator';
|
import { Component, Vue, Prop } from 'vue-property-decorator';
|
||||||
import { ApplicationState, IApplicationState } from '@/application/State/ApplicationState';
|
import { ApplicationState, IApplicationState } from '@/application/State/ApplicationState';
|
||||||
import TheHeader from './presentation/TheHeader.vue';
|
import TheHeader from '@/presentation/TheHeader.vue';
|
||||||
import TheFooter from './presentation/TheFooter.vue';
|
import TheFooter from '@/presentation/TheFooter.vue';
|
||||||
import TheCodeArea from './presentation/TheCodeArea.vue';
|
import TheCodeArea from '@/presentation/TheCodeArea.vue';
|
||||||
import TheCodeButtons from './presentation/TheCodeButtons.vue';
|
import TheCodeButtons from '@/presentation/TheCodeButtons.vue';
|
||||||
import TheSearchBar from './presentation/TheSearchBar.vue';
|
import TheSearchBar from '@/presentation/TheSearchBar.vue';
|
||||||
import TheScripts from './presentation/Scripts/TheScripts.vue';
|
import TheScripts from '@/presentation/Scripts/TheScripts.vue';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
TheHeader,
|
TheHeader,
|
||||||
TheCodeArea,
|
TheCodeArea,
|
||||||
TheCodeButtons,
|
TheCodeButtons,
|
||||||
TheSearchBar,
|
|
||||||
TheScripts,
|
TheScripts,
|
||||||
|
TheSearchBar,
|
||||||
TheFooter,
|
TheFooter,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import applicationFile from 'js-yaml-loader!./../application.yaml';
|
|||||||
import { parseCategory } from './CategoryParser';
|
import { parseCategory } from './CategoryParser';
|
||||||
|
|
||||||
export function parseApplication(): Application {
|
export function parseApplication(): Application {
|
||||||
const name = applicationFile.name as string;
|
|
||||||
const version = applicationFile.version as number;
|
|
||||||
const categories = new Array<Category>();
|
const categories = new Array<Category>();
|
||||||
if (!applicationFile.actions || applicationFile.actions.length <= 0) {
|
if (!applicationFile.actions || applicationFile.actions.length <= 0) {
|
||||||
throw new Error('Application does not define any action');
|
throw new Error('Application does not define any action');
|
||||||
@@ -14,6 +12,10 @@ export function parseApplication(): Application {
|
|||||||
const category = parseCategory(action);
|
const category = parseCategory(action);
|
||||||
categories.push(category);
|
categories.push(category);
|
||||||
}
|
}
|
||||||
const app = new Application(name, version, categories);
|
const app = new Application(
|
||||||
|
applicationFile.name,
|
||||||
|
applicationFile.repositoryUrl,
|
||||||
|
applicationFile.version,
|
||||||
|
categories);
|
||||||
return app;
|
return app;
|
||||||
}
|
}
|
||||||
|
|||||||
18
src/application/State/Filter/FilterResult.ts
Normal file
18
src/application/State/Filter/FilterResult.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import { IFilterResult } from './IFilterResult';
|
||||||
|
import { IScript } from '@/domain/Script';
|
||||||
|
import { ICategory } from '@/domain/ICategory';
|
||||||
|
|
||||||
|
export class FilterResult implements IFilterResult {
|
||||||
|
constructor(
|
||||||
|
public readonly scriptMatches: ReadonlyArray<IScript>,
|
||||||
|
public readonly categoryMatches: ReadonlyArray<ICategory>,
|
||||||
|
public readonly query: string) {
|
||||||
|
if (!query) { throw new Error('Query is empty or undefined'); }
|
||||||
|
if (!scriptMatches) { throw new Error('Script matches is undefined'); }
|
||||||
|
if (!categoryMatches) { throw new Error('Category matches is undefined'); }
|
||||||
|
}
|
||||||
|
public hasAnyMatches(): boolean {
|
||||||
|
return this.scriptMatches.length > 0
|
||||||
|
|| this.categoryMatches.length > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
import { IScript, ICategory } from '@/domain/ICategory';
|
import { IScript, ICategory } from '@/domain/ICategory';
|
||||||
|
|
||||||
export interface IFilterMatches {
|
export interface IFilterResult {
|
||||||
readonly scriptMatches: ReadonlyArray<IScript>;
|
|
||||||
readonly categoryMatches: ReadonlyArray<ICategory>;
|
readonly categoryMatches: ReadonlyArray<ICategory>;
|
||||||
|
readonly scriptMatches: ReadonlyArray<IScript>;
|
||||||
readonly query: string;
|
readonly query: string;
|
||||||
|
hasAnyMatches(): boolean;
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import { IFilterMatches } from './IFilterMatches';
|
import { IFilterResult } from './IFilterResult';
|
||||||
import { ISignal } from '@/infrastructure/Events/Signal';
|
import { ISignal } from '@/infrastructure/Events/Signal';
|
||||||
|
|
||||||
export interface IUserFilter {
|
export interface IUserFilter {
|
||||||
readonly filtered: ISignal<IFilterMatches>;
|
readonly filtered: ISignal<IFilterResult>;
|
||||||
readonly filterRemoved: ISignal<void>;
|
readonly filterRemoved: ISignal<void>;
|
||||||
setFilter(filter: string): void;
|
setFilter(filter: string): void;
|
||||||
removeFilter(): void;
|
removeFilter(): void;
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { IFilterMatches } from './IFilterMatches';
|
import { FilterResult } from './FilterResult';
|
||||||
|
import { IFilterResult } from './IFilterResult';
|
||||||
import { Application } from '../../../domain/Application';
|
import { Application } from '../../../domain/Application';
|
||||||
import { IUserFilter } from './IUserFilter';
|
import { IUserFilter } from './IUserFilter';
|
||||||
import { Signal } from '@/infrastructure/Events/Signal';
|
import { Signal } from '@/infrastructure/Events/Signal';
|
||||||
|
|
||||||
export class UserFilter implements IUserFilter {
|
export class UserFilter implements IUserFilter {
|
||||||
public readonly filtered = new Signal<IFilterMatches>();
|
public readonly filtered = new Signal<IFilterResult>();
|
||||||
public readonly filterRemoved = new Signal<void>();
|
public readonly filterRemoved = new Signal<void>();
|
||||||
|
|
||||||
constructor(private application: Application) {
|
constructor(private application: Application) {
|
||||||
@@ -15,15 +16,19 @@ export class UserFilter implements IUserFilter {
|
|||||||
if (!filter) {
|
if (!filter) {
|
||||||
throw new Error('Filter must be defined and not empty. Use removeFilter() to remove the filter');
|
throw new Error('Filter must be defined and not empty. Use removeFilter() to remove the filter');
|
||||||
}
|
}
|
||||||
|
const filterLowercase = filter.toLocaleLowerCase();
|
||||||
const filteredScripts = this.application.getAllScripts().filter(
|
const filteredScripts = this.application.getAllScripts().filter(
|
||||||
(script) => script.name.toLowerCase().includes(filter.toLowerCase()) ||
|
(script) =>
|
||||||
script.code.toLowerCase().includes(filter.toLowerCase()));
|
script.name.toLowerCase().includes(filterLowercase) ||
|
||||||
|
script.code.toLowerCase().includes(filterLowercase));
|
||||||
|
const filteredCategories = this.application.getAllCategories().filter(
|
||||||
|
(script) => script.name.toLowerCase().includes(filterLowercase));
|
||||||
|
|
||||||
const matches: IFilterMatches = {
|
const matches = new FilterResult(
|
||||||
scriptMatches: filteredScripts,
|
filteredScripts,
|
||||||
categoryMatches: null,
|
filteredCategories,
|
||||||
query: filter,
|
filter,
|
||||||
};
|
);
|
||||||
|
|
||||||
this.filtered.notify(matches);
|
this.filtered.notify(matches);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
name: privacy.sexy
|
name: privacy.sexy
|
||||||
version: 0.3.0
|
version: 0.4.1
|
||||||
|
repositoryUrl: https://github.com/undergroundwires/privacy.sexy
|
||||||
actions:
|
actions:
|
||||||
-
|
-
|
||||||
category: Privacy cleanup
|
category: Privacy cleanup
|
||||||
@@ -255,18 +256,81 @@ actions:
|
|||||||
name: Clear main telemetry file
|
name: Clear main telemetry file
|
||||||
recommend: true
|
recommend: true
|
||||||
code: echo "" > %ProgramData%\Microsoft\Diagnosis\ETLTraces\AutoLogger\AutoLogger-Diagtrack-Listener.etl
|
code: echo "" > %ProgramData%\Microsoft\Diagnosis\ETLTraces\AutoLogger\AutoLogger-Diagtrack-Listener.etl
|
||||||
|
-
|
||||||
|
name: Clear credentials from Windows Credential Manager
|
||||||
|
recommend: false
|
||||||
|
code: |-
|
||||||
|
cmdkey.exe /list > "%TEMP%\List.txt"
|
||||||
|
findstr.exe Target "%TEMP%\List.txt" > "%TEMP%\tokensonly.txt"
|
||||||
|
FOR /F "tokens=1,2 delims= " %%G IN (%TEMP%\tokensonly.txt) DO cmdkey.exe /delete:%%H
|
||||||
|
del "%TEMP%\List.txt" /s /f /q
|
||||||
|
del "%TEMP%\tokensonly.txt" /s /f /q
|
||||||
-
|
-
|
||||||
name: Empty trash bin
|
name: Empty trash bin
|
||||||
|
recommend: false
|
||||||
code: rd /s %systemdrive%\$Recycle.bin
|
code: rd /s %systemdrive%\$Recycle.bin
|
||||||
|
|
||||||
-
|
-
|
||||||
category: Disable OS data collection
|
category: Disable OS data collection
|
||||||
children:
|
children:
|
||||||
-
|
-
|
||||||
name: Disable ad customization with Advertising ID
|
category: Disable Windows telemetry & data collection
|
||||||
recommend: true
|
children:
|
||||||
code: |-
|
-
|
||||||
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v "Enabled" /t REG_DWORD /d 0 /f
|
name: Disable Customer Experience Improvement (CEIP/SQM)
|
||||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" /v "DisabledByGroupPolicy" /t REG_DWORD /d 1 /f
|
recommend: true
|
||||||
|
code: reg add "HKLM\Software\Policies\Microsoft\SQMClient\Windows" /v "CEIPEnable" /t REG_DWORD /d "0" /f
|
||||||
|
-
|
||||||
|
name: Disable Application Impact Telemetry (AIT)
|
||||||
|
recommend: true
|
||||||
|
code: reg add "HKLM\Software\Policies\Microsoft\Windows\AppCompat" /v "AITEnable" /t REG_DWORD /d "0" /f
|
||||||
|
-
|
||||||
|
name: Disable diagnostics telemetry
|
||||||
|
recommend: true
|
||||||
|
code: |-
|
||||||
|
reg add "HKLM\SYSTEM\ControlSet001\Services\DiagTrack" /v "Start" /t REG_DWORD /d 4 /f
|
||||||
|
reg add "HKLM\SYSTEM\ControlSet001\Services\dmwappushsvc" /v "Start" /t REG_DWORD /d 4 /f
|
||||||
|
reg add "HKLM\SYSTEM\CurrentControlSet\Services\dmwappushservice" /v "Start" /t REG_DWORD /d 4 /f
|
||||||
|
reg add "HKLM\SYSTEM\CurrentControlSet\Services\diagnosticshub.standardcollector.service" /v "Start" /t REG_DWORD /d 4 /f
|
||||||
|
sc config DiagTrack start=disabled
|
||||||
|
sc config dmwappushservice start=disabled
|
||||||
|
sc config diagnosticshub.standardcollector.service start=disabled
|
||||||
|
sc config diagsvc start=disabled REM Disable Diagnostic Execution Service
|
||||||
|
-
|
||||||
|
name: Disable Customer Experience Improvement Program
|
||||||
|
recommend: true
|
||||||
|
code: |-
|
||||||
|
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator" /DISABLE
|
||||||
|
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" /DISABLE
|
||||||
|
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" /DISABLE
|
||||||
|
-
|
||||||
|
name: Disabling Data Logging Services
|
||||||
|
recommend: true
|
||||||
|
code: |-
|
||||||
|
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator" /DISABLE
|
||||||
|
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" /DISABLE
|
||||||
|
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" /DISABLE
|
||||||
|
-
|
||||||
|
name: Disable telemetry in data collection policy
|
||||||
|
recommend: true
|
||||||
|
code: |-
|
||||||
|
reg add "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /d 0 /t REG_DWORD /f
|
||||||
|
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f
|
||||||
|
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f
|
||||||
|
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v "LimitEnhancedDiagnosticDataWindowsAnalytics" /t REG_DWORD /d 0 /f
|
||||||
|
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f
|
||||||
|
-
|
||||||
|
name: Disable license telemetry
|
||||||
|
recommend: true
|
||||||
|
code: reg add "HKLM\Software\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" /v "NoGenTicket" /t "REG_DWORD" /d "1" /f
|
||||||
|
-
|
||||||
|
name: Disable error reporting
|
||||||
|
recommend: true
|
||||||
|
code: |-
|
||||||
|
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting" /v "Disabled" /t REG_DWORD /d "1" /f
|
||||||
|
reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting" /v "Disabled" /t "REG_DWORD" /d "1" /f
|
||||||
|
sc config WerSvc start=disabled
|
||||||
|
sc config wercplsupport start=disabled
|
||||||
-
|
-
|
||||||
name: Disable online device metadata collection
|
name: Disable online device metadata collection
|
||||||
recommend: true
|
recommend: true
|
||||||
@@ -279,20 +343,6 @@ actions:
|
|||||||
code: |-
|
code: |-
|
||||||
reg add "HKCU\SOFTWARE\Microsoft\Personalization\Settings" /v "AcceptedPrivacyPolicy" /t REG_DWORD /d 0 /f
|
reg add "HKCU\SOFTWARE\Microsoft\Personalization\Settings" /v "AcceptedPrivacyPolicy" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKU\DefaultUser\Software\Microsoft\Personalization\Settings" /v "AcceptedPrivacyPolicy" /d "0" /t REG_DWORD /f
|
reg add "HKU\DefaultUser\Software\Microsoft\Personalization\Settings" /v "AcceptedPrivacyPolicy" /d "0" /t REG_DWORD /f
|
||||||
-
|
|
||||||
name: Disable windows telemetry & data collection
|
|
||||||
recommend: true
|
|
||||||
code: |-
|
|
||||||
reg add "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /d 0 /t REG_DWORD /f
|
|
||||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f
|
|
||||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f
|
|
||||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v "LimitEnhancedDiagnosticDataWindowsAnalytics" /t REG_DWORD /d 0 /f
|
|
||||||
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f
|
|
||||||
reg add "HKLM\SYSTEM\ControlSet001\Services\DiagTrack" /v "Start" /t REG_DWORD /d 4 /f
|
|
||||||
reg add "HKLM\SYSTEM\ControlSet001\Services\dmwappushsvc" /v "Start" /t REG_DWORD /d 4 /f
|
|
||||||
reg add "HKLM\SYSTEM\CurrentControlSet\Services\dmwappushservice" /v "Start" /t REG_DWORD /d 4 /f
|
|
||||||
reg add "HKLM\SYSTEM\CurrentControlSet\Services\diagnosticshub.standardcollector.service" /v "Start" /t REG_DWORD /d 4 /ff
|
|
||||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /v "AITEnable" /t REG_DWORD /d 0 /f
|
|
||||||
-
|
-
|
||||||
name: Disable Windows feedback
|
name: Disable Windows feedback
|
||||||
recommend: true
|
recommend: true
|
||||||
@@ -465,6 +515,7 @@ actions:
|
|||||||
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "CortanaEnabled" /t REG_DWORD /d 0 /f
|
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "CortanaEnabled" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "CortanaEnabled" /t REG_DWORD /d 0 /f
|
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "CortanaEnabled" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "CanCortanaBeEnabled" /t REG_DWORD /d 0 /f
|
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "CanCortanaBeEnabled" /t REG_DWORD /d 0 /f
|
||||||
|
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v BingSearchEnabled /t REG_DWORD /d 0 /f
|
||||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCloudSearch" /t REG_DWORD /d 0 /f
|
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCloudSearch" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortana" /t REG_DWORD /d 0 /f
|
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortana" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortanaAboveLock" /t REG_DWORD /d 0 /f
|
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortanaAboveLock" /t REG_DWORD /d 0 /f
|
||||||
@@ -491,18 +542,36 @@ actions:
|
|||||||
name: Disable language detection
|
name: Disable language detection
|
||||||
recommend: true
|
recommend: true
|
||||||
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AlwaysUseAutoLangDetection /t REG_DWORD /d 0 /f
|
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AlwaysUseAutoLangDetection /t REG_DWORD /d 0 /f
|
||||||
name: Turn Off Suggested Content in Settings app
|
|
||||||
recommend: true
|
|
||||||
docs: https://www.tenforums.com/tutorials/100541-turn-off-suggested-content-settings-app-windows-10-a.html
|
|
||||||
code: |-
|
|
||||||
reg add HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager /v "SubscribedContent-338393Enabled" /d "0" /t REG_DWORD /f
|
|
||||||
reg add HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager /v "SubscribedContent-353694Enabled" /d "0" /t REG_DWORD /f
|
|
||||||
reg add HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager /v "SubscribedContent-353696Enabled" /d "0" /t REG_DWORD /f
|
|
||||||
-
|
-
|
||||||
|
category: Disable targeted ads & marketing
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: Disable ad customization with Advertising ID
|
||||||
|
recommend: true
|
||||||
|
code: |-
|
||||||
|
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v "Enabled" /t REG_DWORD /d 0 /f
|
||||||
|
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" /v "DisabledByGroupPolicy" /t REG_DWORD /d 1 /f
|
||||||
|
-
|
||||||
|
name: Disable targeted tips
|
||||||
|
recommend: true
|
||||||
|
code: |-
|
||||||
|
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableSoftLanding" /t REG_DWORD /d 1 /f
|
||||||
|
reg add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsSpotlightFeatures" /t "REG_DWORD" /d "1" /f
|
||||||
|
reg add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t "REG_DWORD" /d "1" /f
|
||||||
|
-
|
||||||
|
name: Turn Off Suggested Content in Settings app
|
||||||
|
recommend: true
|
||||||
|
docs: https://www.tenforums.com/tutorials/100541-turn-off-suggested-content-settings-app-windows-10-a.html
|
||||||
|
code: |-
|
||||||
|
reg add HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager /v "SubscribedContent-338393Enabled" /d "0" /t REG_DWORD /f
|
||||||
|
reg add HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager /v "SubscribedContent-353694Enabled" /d "0" /t REG_DWORD /f
|
||||||
|
reg add HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager /v "SubscribedContent-353696Enabled" /d "0" /t REG_DWORD /f
|
||||||
|
-
|
||||||
name: Disable biometrics
|
name: Disable biometrics
|
||||||
recommend: true
|
recommend: true
|
||||||
code: |-
|
code: |-
|
||||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\Biometrics" /v "Enabled" /t REG_DWORD /d 0 /f
|
reg add "HKLM\SOFTWARE\Policies\Microsoft\Biometrics" /v "Enabled" /t REG_DWORD /d 0 /f
|
||||||
|
reg add "HKLM\SOFTWARE\Policies\Microsoft\Biometrics\Credential Provider" /v "Enabled" /t "REG_DWORD" /d "0" /f
|
||||||
reg add "HKLM\SYSTEM\CurrentControlSet\Services\WbioSrvc" /v "Start" /t REG_DWORD /d 4 /f
|
reg add "HKLM\SYSTEM\CurrentControlSet\Services\WbioSrvc" /v "Start" /t REG_DWORD /d 4 /f
|
||||||
-
|
-
|
||||||
name: Disable Wi-Fi sense
|
name: Disable Wi-Fi sense
|
||||||
@@ -526,10 +595,6 @@ actions:
|
|||||||
code: |-
|
code: |-
|
||||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Maps" /v "AllowUntriggeredNetworkTrafficOnSettingsPage" /t REG_DWORD /d 0 /f
|
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Maps" /v "AllowUntriggeredNetworkTrafficOnSettingsPage" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Maps" /v "AutoDownloadAndUpdateMapData" /t REG_DWORD /d 0 /f
|
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Maps" /v "AutoDownloadAndUpdateMapData" /t REG_DWORD /d 0 /f
|
||||||
-
|
|
||||||
name: Disable targeted tips
|
|
||||||
recommend: true
|
|
||||||
code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableSoftLanding" /t REG_DWORD /d 1 /f
|
|
||||||
-
|
-
|
||||||
name: Disable steps recorder
|
name: Disable steps recorder
|
||||||
recommend: true
|
recommend: true
|
||||||
@@ -562,6 +627,9 @@ actions:
|
|||||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" /v "AllowBuildPreview" /t REG_DWORD /d 0 /f
|
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" /v "AllowBuildPreview" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" /v "EnableConfigFlighting" /t REG_DWORD /d 0 /f
|
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" /v "EnableConfigFlighting" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" /v "EnableExperimentation" /t REG_DWORD /d 0 /f
|
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" /v "EnableExperimentation" /t REG_DWORD /d 0 /f
|
||||||
|
reg add "HKLM\SOFTWARE\Microsoft\PolicyManager\default\System\AllowExperimentation" /v "value" /t "REG_DWORD" /d 0 /f
|
||||||
|
reg add "HKLM\SOFTWARE\Microsoft\WindowsSelfHost\UI\Visibility" /v "HideInsiderPage" /t "REG_DWORD" /d "1" /f
|
||||||
|
sc config wisvc start=disabled
|
||||||
-
|
-
|
||||||
name: Disable the Windows Connect Now wizard
|
name: Disable the Windows Connect Now wizard
|
||||||
recommend: false
|
recommend: false
|
||||||
@@ -674,7 +742,7 @@ actions:
|
|||||||
code: |-
|
code: |-
|
||||||
sc stop "VSStandardCollectorService150"
|
sc stop "VSStandardCollectorService150"
|
||||||
net stop VSStandardCollectorService150 2>nul
|
net stop VSStandardCollectorService150 2>nul
|
||||||
sc config "VSStandardCollectorService150" start= disabled
|
sc config "VSStandardCollectorService150" start=disabled
|
||||||
-
|
-
|
||||||
category: Configure Windows Defender
|
category: Configure Windows Defender
|
||||||
children:
|
children:
|
||||||
@@ -734,6 +802,8 @@ actions:
|
|||||||
recommend: true
|
recommend: true
|
||||||
docs: https://docs.microsoft.com/en-us/deployoffice/compat/manage-the-privacy-of-data-monitored-by-telemetry-in-office
|
docs: https://docs.microsoft.com/en-us/deployoffice/compat/manage-the-privacy-of-data-monitored-by-telemetry-in-office
|
||||||
code: |-
|
code: |-
|
||||||
|
reg add "HKCU\SOFTWARE\Policies\Microsoft\Office\15.0\osm" /v "Enablelogging" /t REG_DWORD /d 0 /f
|
||||||
|
reg add "HKCU\SOFTWARE\Policies\Microsoft\Office\15.0\osm" /v "EnableUpload" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKCU\SOFTWARE\Policies\Microsoft\Office\16.0\osm" /v "Enablelogging" /t REG_DWORD /d 0 /f
|
reg add "HKCU\SOFTWARE\Policies\Microsoft\Office\16.0\osm" /v "Enablelogging" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKCU\SOFTWARE\Policies\Microsoft\Office\16.0\osm" /v "EnableUpload" /t REG_DWORD /d 0 /f
|
reg add "HKCU\SOFTWARE\Policies\Microsoft\Office\16.0\osm" /v "EnableUpload" /t REG_DWORD /d 0 /f
|
||||||
-
|
-
|
||||||
@@ -817,34 +887,37 @@ actions:
|
|||||||
name: Disable Google update service
|
name: Disable Google update service
|
||||||
recommend: true
|
recommend: true
|
||||||
code: |-
|
code: |-
|
||||||
sc config gupdate start= disabled
|
sc config gupdate start=disabled
|
||||||
sc config gupdatem start= disabled
|
sc config gupdatem start=disabled
|
||||||
schtasks /Change /DISABLE /TN "GoogleUpdateTaskMachineCore"
|
schtasks /Change /DISABLE /TN "GoogleUpdateTaskMachineCore"
|
||||||
schtasks /Change /DISABLE /TN "GoogleUpdateTaskMachineUA"
|
schtasks /Change /DISABLE /TN "GoogleUpdateTaskMachineUA"
|
||||||
-
|
-
|
||||||
name: Disable Adobe Acrobat update service
|
name: Disable Adobe Acrobat update service
|
||||||
recommend: true
|
recommend: true
|
||||||
code: |-
|
code: |-
|
||||||
sc config AdobeARMservice start= disabled
|
sc config AdobeARMservice start=disabled
|
||||||
schtasks /Change /DISABLE /TN "Adobe Acrobat Update Task"
|
sc config adobeupdateservice start=disabled
|
||||||
|
sc config adobeflashplayerupdatesvc start=disabled
|
||||||
|
schtasks /change /tn "Adobe Acrobat Update Task" /disable
|
||||||
|
schtasks /change /tn "Adobe Flash Player Updater" /disable
|
||||||
-
|
-
|
||||||
name: Disable Razer Game Scanner Service
|
name: Disable Razer Game Scanner Service
|
||||||
recommend: true
|
recommend: true
|
||||||
code: |-
|
code: |-
|
||||||
sc stop "Razer Game Scanner Service"
|
sc stop "Razer Game Scanner Service"
|
||||||
sc config "Razer Game Scanner Service" start= disabled
|
sc config "Razer Game Scanner Service" start=disabled
|
||||||
-
|
-
|
||||||
name: Disable Logitech Gaming Registry Service
|
name: Disable Logitech Gaming Registry Service
|
||||||
recommend: true
|
recommend: true
|
||||||
code: |-
|
code: |-
|
||||||
sc stop "LogiRegistryService"
|
sc stop "LogiRegistryService"
|
||||||
sc config "LogiRegistryService" start= disabled
|
sc config "LogiRegistryService" start=disabled
|
||||||
-
|
-
|
||||||
name: Disable Dropbox auto update service
|
name: Disable Dropbox auto update service
|
||||||
recommend: true
|
recommend: true
|
||||||
code: |-
|
code: |-
|
||||||
sc config dbupdate start= disabled
|
sc config dbupdate start=disabled
|
||||||
sc config dbupdatem start= disabled
|
sc config dbupdatem start=disabled
|
||||||
schtasks /Change /DISABLE /TN "DropboxUpdateTaskMachineCore"
|
schtasks /Change /DISABLE /TN "DropboxUpdateTaskMachineCore"
|
||||||
schtasks /Change /DISABLE /TN "DropboxUpdateTaskMachineUA"
|
schtasks /Change /DISABLE /TN "DropboxUpdateTaskMachineUA"
|
||||||
-
|
-
|
||||||
@@ -862,6 +935,10 @@ actions:
|
|||||||
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\WindowsMediaPlayer" /v "PreventMusicFileMetadataRetrieval" /t REG_DWORD /d 1 /f
|
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\WindowsMediaPlayer" /v "PreventMusicFileMetadataRetrieval" /t REG_DWORD /d 1 /f
|
||||||
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\WindowsMediaPlayer" /v "PreventRadioPresetsRetrieval" /t REG_DWORD /d 1 /f
|
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\WindowsMediaPlayer" /v "PreventRadioPresetsRetrieval" /t REG_DWORD /d 1 /f
|
||||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WMDRM" /v "DisableOnline" /t REG_DWORD /d 1 /f
|
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WMDRM" /v "DisableOnline" /t REG_DWORD /d 1 /f
|
||||||
|
-
|
||||||
|
name: Disable dows Media Player Network Sharing Service
|
||||||
|
recommend: true
|
||||||
|
code: sc config WMPNetworkSvc start=disabled
|
||||||
-
|
-
|
||||||
category: Security improvements
|
category: Security improvements
|
||||||
children:
|
children:
|
||||||
@@ -984,6 +1061,14 @@ actions:
|
|||||||
name: Disable scheduled On Demand anti malware scanner (MRT)
|
name: Disable scheduled On Demand anti malware scanner (MRT)
|
||||||
recommend: false
|
recommend: false
|
||||||
code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MRT" /v "DontOfferThroughWUAU" /t REG_DWORD /d 1 /f
|
code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MRT" /v "DontOfferThroughWUAU" /t REG_DWORD /d 1 /f
|
||||||
|
-
|
||||||
|
name: Disable automatic updates
|
||||||
|
recommend: false
|
||||||
|
code: |-
|
||||||
|
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "NoAutoUpdate" /t "REG_DWORD" /d "0" /f
|
||||||
|
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "AUOptions" /t "REG_DWORD" /d "2" /f
|
||||||
|
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "ScheduledInstallDay" /t "REG_DWORD" /d "0" /f
|
||||||
|
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "ScheduledInstallTime" /t "REG_DWORD" /d "3" /f
|
||||||
-
|
-
|
||||||
category: UI for privacy
|
category: UI for privacy
|
||||||
children:
|
children:
|
||||||
@@ -1025,15 +1110,447 @@ actions:
|
|||||||
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\HomeFolderDesktop\NameSpace\DelegateFolders\{3134ef9c-6b18-4996-ad04-ed5912e00eb5} /f
|
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\HomeFolderDesktop\NameSpace\DelegateFolders\{3134ef9c-6b18-4996-ad04-ed5912e00eb5} /f
|
||||||
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HomeFolderDesktop\NameSpace\DelegateFolders\{3134ef9c-6b18-4996-ad04-ed5912e00eb5} /f
|
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HomeFolderDesktop\NameSpace\DelegateFolders\{3134ef9c-6b18-4996-ad04-ed5912e00eb5} /f
|
||||||
)
|
)
|
||||||
|
-
|
||||||
|
category: Disable OS services
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: Delivery Optimization (P2P Windows Updates)
|
||||||
|
recommend: true
|
||||||
|
code: sc config DoSvc start=disabled
|
||||||
|
-
|
||||||
|
name: Microsoft Windows Live ID Service
|
||||||
|
recommend: true
|
||||||
|
code: sc config wlidsvc start=demand
|
||||||
|
-
|
||||||
|
name: Program Compatibility Assistant Service
|
||||||
|
recommend: true
|
||||||
|
code: sc config PcaSvc start=disabled
|
||||||
|
-
|
||||||
|
name: Downloaded Maps Manager
|
||||||
|
recommend: true
|
||||||
|
code: sc config MapsBroker start=disabled
|
||||||
|
-
|
||||||
|
name: Microsoft Retail Demo experience
|
||||||
|
recommend: true
|
||||||
|
code: sc config RetailDemo start=disabled
|
||||||
|
-
|
||||||
|
name: Mail, contact, calendar & user data synchronization.
|
||||||
|
recommend: false
|
||||||
|
code: |-
|
||||||
|
sc config OneSyncSvc start=disabled
|
||||||
|
sc config UnistoreSvc start=disabled
|
||||||
|
-
|
||||||
|
name: Contact data indexing
|
||||||
|
recommend: false
|
||||||
|
code: |-
|
||||||
|
sc config PimIndexMaintenanceSvc start=disabled
|
||||||
|
-
|
||||||
|
name: App user data access
|
||||||
|
recommend: false
|
||||||
|
code: sc config UserDataSvc start=disabled
|
||||||
|
-
|
||||||
|
name: Text messaging
|
||||||
|
recommend: false
|
||||||
|
code: sc config MessagingService start=disabled
|
||||||
|
-
|
||||||
|
category: Uninstall apps
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
category: Provisioned Windows apps
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: Microsoft 3D Builder
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.3DBuilder | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
category: Bing
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: Bing Weather
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.BingWeather | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Bing Sports
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.BingSports | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Bing News
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.BingNews | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Bing Finance
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.BingFinance | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: App Installer
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.DesktopAppInstaller | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Get Help
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.GetHelp | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Microsoft Tips
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Getstarted | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
category: Extensions
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: HEIF Image Extensions
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.HEIFImageExtension | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: VP9 Video Extensions
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.VP9VideoExtensions | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Web Media Extensions
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.WebMediaExtensions | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Webp Image Extension
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.WebpImageExtension | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Microsoft Messaging
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Messaging | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
category: Mixed Reality
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: Mixed Reality Portal
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.MixedReality.Portal | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Mixed Reality Viewer
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Microsoft3DViewer | Remove-AppxPackage"
|
||||||
|
|
||||||
|
-
|
||||||
|
category: Microsoft Office
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: My Office
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.MicrosoftOfficeHub | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: OneNote
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Office.OneNote | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Sway
|
||||||
|
docs: https://docs.microsoft.com/en-us/windows/application-management/apps-in-windows-10
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Office.Sway | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Feedback Hub
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.WindowsFeedbackHub | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Windows Alarms & Clock
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.WindowsAlarms | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Windows Camera
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.WindowsCamera | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Paint 3D
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.MSPaint | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Windows Maps
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.WindowsMaps | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Minecraft
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.MinecraftUWP | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Microsoft Store
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.WindowsStore | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Microsoft People
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.People | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Microsoft Pay
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Wallet | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Store Purchase App
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.StorePurchaseApp | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Snip & Sketch
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.ScreenSketch | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Print3D
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Print3D | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Paid Wi-Fi & Cellular
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.OneConnect | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Microsoft Solitaire Collection
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.MicrosoftSolitaireCollection | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Microsoft Sticky Notes
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.MicrosoftStickyNotes | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
category: Xbox
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: Xbox
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.XboxApp | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Xbox TCUI
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Xbox.TCUI | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Xbox Game Bar
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.XboxGameOverlay | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Xbox Gaming Overlay
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.XboxGamingOverlay | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Xbox Identity Provider
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.XboxIdentityProvider | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Xbox Speech To Text Overlay
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.XboxSpeechToTextOverlay | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Mail and Calendar
|
||||||
|
code: PowerShell -Command "Get-AppxPackage microsoft.windowscommunicationsapps | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
category: Zune
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: Music
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.ZuneMusic | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Video
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.ZuneVideo | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Windows Calculator
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.WindowsCalculator | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Microsoft Photos
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Windows.Photos | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Skype
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.SkypeApp | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Windows Voice Recorder
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.WindowsSoundRecorder | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
category: Phone
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: Windows Phone
|
||||||
|
code: |-
|
||||||
|
PowerShell -Command "Get-AppxPackage Microsoft.WindowsPhone | Remove-AppxPackage"
|
||||||
|
PowerShell -Command "Get-AppxPackage Microsoft.Windows.Phone | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Comms Phone
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.CommsPhone | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Your Phone
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.YourPhone | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
category: Installed Windows apps
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: Microsoft Advertising
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Advertising.Xaml | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Remote Desktop
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.RemoteDesktop | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Network Speed Test
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.NetworkSpeedTest | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
category: Third party
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: Shazam
|
||||||
|
code: PowerShell -Command "Get-AppxPackage ShazamEntertainmentLtd.Shazam | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Candy Crush Saga
|
||||||
|
code: |-
|
||||||
|
PowerShell -Command "Get-AppxPackage king.com.CandyCrushSaga | Remove-AppxPackage"
|
||||||
|
PowerShell -Command "Get-AppxPackage king.com.CandyCrushSodaSaga | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Flipboard
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Flipboard.Flipboard | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Twitter
|
||||||
|
code: PowerShell -Command "Get-AppxPackage 9E2F88E3.Twitter | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: iHeartRadio
|
||||||
|
code: PowerShell -Command "Get-AppxPackage ClearChannelRadioDigital.iHeartRadio | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Duolingo
|
||||||
|
code: PowerShell -Command "Get-AppxPackage D5EA27B7.Duolingo-LearnLanguagesforFree | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Photoshop Express
|
||||||
|
code: PowerShell -Command "Get-AppxPackage AdobeSystemIncorporated.AdobePhotoshop | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Pandora
|
||||||
|
code: PowerShell -Command "Get-AppxPackage PandoraMediaInc.29680B314EFC2 | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Eclipse Manager
|
||||||
|
code: PowerShell -Command "Get-AppxPackage 46928bounde.EclipseManager | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Code Writer
|
||||||
|
code: PowerShell -Command "Get-AppxPackage ActiproSoftwareLLC.562882FEEB491 | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
category: System apps
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: File Picker
|
||||||
|
code: PowerShell -Command "Get-AppxPackage 1527c705-839a-4832-9118-54d4Bd6a0c89 | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: File Explorer
|
||||||
|
code: PowerShell -Command "Get-AppxPackage c5e2524a-ea46-4f67-841f-6a9465d9d515 | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: App Resolver UX
|
||||||
|
code: PowerShell -Command "Get-AppxPackage E2A4F912-2574-4A75-9BB0-0D023378592B | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Add Suggested Folders To Library
|
||||||
|
recommend: true
|
||||||
|
code: |-
|
||||||
|
PowerShell -Command "Get-AppxPackage F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE | Remove-AppxPackage"
|
||||||
|
PowerShell -Command "Get-AppxPackage InputApp | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Microsoft.AAD.Broker.Plugin
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.AAD.Broker.Plugin | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Microsoft.AccountsControl
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.AccountsControl | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Microsoft.AsyncTextService
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.AsyncTextService | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
category: Hello setup UI
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: Bio enrollment
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.BioEnrollment | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Cred Dialog Host
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.CredDialogHost | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: EC App
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.ECApp | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Lock App
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.LockApp | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
category: Microsoft Edge
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: Microsoft Edge
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.MicrosoftEdge | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Microsoft Edge Dev Tools Client
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.MicrosoftEdgeDevToolsClient | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Microsoft PPI Projection
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.PPIProjection | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Win32 Web View Host
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Win32WebViewHost | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: ChxApp
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Windows.Apprep.ChxApp | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Assigned Access Lock App
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Windows.AssignedAccessLockApp | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Capture Picker
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Windows.CapturePicker | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Cloud Experience Host
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Windows.CloudExperienceHost | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Content Delivery Manager
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Windows.ContentDeliveryManager | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
category: Cortana
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: Cortana
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Windows.Cortana | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Holographic First Run
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Windows.Holographic.FirstRun | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: OOBE Network Captive Port
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Windows.OOBENetworkCaptivePort | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: OOBE Network Connection Flow
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Windows.OOBENetworkConnectionFlow | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Parental Controls
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Windows.ParentalControls | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
category: People Hub
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: People Experience Host
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Microsoft.Windows.PeopleExperienceHost | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Pinning Confirmation Dialog
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Microsoft.Windows.PinningConfirmationDialog | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Sec Health UI
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Microsoft.Windows.SecHealthUI | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Secondary Tile Experience
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Microsoft.Windows.SecondaryTileExperience | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Secure Assessment Browser
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Microsoft.Windows.SecureAssessmentBrowser | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Start
|
||||||
|
code: PowerShell -Command "Microsoft.Windows.ShellExperienceHost | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
category: Windows Feedback
|
||||||
|
children:
|
||||||
|
-
|
||||||
|
name: Windows Feedback
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Microsoft.WindowsFeedback | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Xbox Game Callable UI
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Microsoft.XboxGameCallableUI | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: CBS Preview
|
||||||
|
recommend: true
|
||||||
|
code: PowerShell -Command "Windows.CBSPreview | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Contact Support
|
||||||
|
code: PowerShell -Command "Windows.ContactSupport | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Settings
|
||||||
|
code: PowerShell -Command "Windows.immersivecontrolpanel | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Windows Print 3D
|
||||||
|
code: PowerShell -Command "Windows.Print3D | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: Print UI
|
||||||
|
code: PowerShell -Command "Windows.PrintDialog | Remove-AppxPackage"
|
||||||
|
-
|
||||||
|
name: App Connector
|
||||||
|
code: PowerShell -Command "Get-AppxPackage Microsoft.Appconnector | Remove-AppxPackage"
|
||||||
-
|
-
|
||||||
category: Advanced settings
|
category: Advanced settings
|
||||||
children:
|
children:
|
||||||
# -
|
|
||||||
# name: Run script on start-up (EXPERIMENTAL)
|
|
||||||
# recommend: false
|
|
||||||
# code: |-
|
|
||||||
# del /f /q %AppData%\Microsoft\Windows\Start Menu\Programs\Startup\privacy-cleanup.bat
|
|
||||||
# copy "%~dpnx0" "%AppData%\Microsoft\Windows\Start Menu\Programs\Startup\privacy-cleanup"
|
|
||||||
-
|
-
|
||||||
name: Change NTP (time) server to pool.ntp.org
|
name: Change NTP (time) server to pool.ntp.org
|
||||||
recommend: false
|
recommend: false
|
||||||
@@ -1044,10 +1561,16 @@ actions:
|
|||||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "EventLogFlags" /t REG_DWORD /d 0 /f
|
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "EventLogFlags" /t REG_DWORD /d 0 /f
|
||||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "ResolvePeerBackoffMaxTimes" /t REG_DWORD /d 7 /f
|
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "ResolvePeerBackoffMaxTimes" /t REG_DWORD /d 7 /f
|
||||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "ResolvePeerBackoffMinutes" /t REG_DWORD /d 15 /f
|
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "ResolvePeerBackoffMinutes" /t REG_DWORD /d 15 /f
|
||||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "SpecialPollInterval" /t REG_DWORD /d 1024 /f
|
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "SpecialPollInterval" /t REG_DWORD /d 1024 /f
|
||||||
-
|
-
|
||||||
name: Apply settings for all future users (EXPERIMENTAL)
|
name: Run script on start-up [EXPERIMENTAL]
|
||||||
|
recommend: false
|
||||||
|
code: |-
|
||||||
|
del /f /q %AppData%\Microsoft\Windows\Start Menu\Programs\Startup\privacy-cleanup.bat
|
||||||
|
copy "%~dpnx0" "%AppData%\Microsoft\Windows\Start Menu\Programs\Startup\privacy-cleanup.bat"
|
||||||
|
-
|
||||||
|
name: Apply settings for all future users [EXPERIMENTAL]
|
||||||
recommend: false
|
recommend: false
|
||||||
code: |-
|
code: |-
|
||||||
REG UNLOAD HKU\DefaultUser
|
REG UNLOAD HKU\DefaultUser
|
||||||
reg load HKU\DefaultUser %SystemDrive%\Users\Default\NTUSER.DAT
|
reg load HKU\DefaultUser %SystemDrive%\Users\Default\NTUSER.DAT
|
||||||
1
src/application/application.yaml.d.ts
vendored
1
src/application/application.yaml.d.ts
vendored
@@ -20,6 +20,7 @@ declare module 'js-yaml-loader!*' {
|
|||||||
interface ApplicationYaml {
|
interface ApplicationYaml {
|
||||||
name: string;
|
name: string;
|
||||||
version: number;
|
version: number;
|
||||||
|
repositoryUrl: string;
|
||||||
actions: ReadonlyArray<YamlCategory>;
|
actions: ReadonlyArray<YamlCategory>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,14 +11,12 @@ export class Application implements IApplication {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public readonly name: string,
|
public readonly name: string,
|
||||||
|
public readonly repositoryUrl: string,
|
||||||
public readonly version: number,
|
public readonly version: number,
|
||||||
public readonly categories: ReadonlyArray<ICategory>) {
|
public readonly categories: ReadonlyArray<ICategory>) {
|
||||||
if (!name) {
|
if (!name) { throw Error('Application has no name'); }
|
||||||
throw Error('Application has no name');
|
if (!repositoryUrl) { throw Error('Application has no repository url'); }
|
||||||
}
|
if (!version) { throw Error('Version cannot be zero'); }
|
||||||
if (!version) {
|
|
||||||
throw Error('Version cannot be zero');
|
|
||||||
}
|
|
||||||
this.flattened = flatten(categories);
|
this.flattened = flatten(categories);
|
||||||
if (this.flattened.allCategories.length === 0) {
|
if (this.flattened.allCategories.length === 0) {
|
||||||
throw new Error('Application must consist of at least one category');
|
throw new Error('Application must consist of at least one category');
|
||||||
@@ -48,6 +46,10 @@ export class Application implements IApplication {
|
|||||||
public getAllScripts(): IScript[] {
|
public getAllScripts(): IScript[] {
|
||||||
return this.flattened.allScripts;
|
return this.flattened.allScripts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getAllCategories(): ICategory[] {
|
||||||
|
return this.flattened.allCategories;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function ensureNoDuplicates<TKey>(entities: ReadonlyArray<IEntity<TKey>>) {
|
function ensureNoDuplicates<TKey>(entities: ReadonlyArray<IEntity<TKey>>) {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { ICategory } from '@/domain/ICategory';
|
|||||||
|
|
||||||
export interface IApplication {
|
export interface IApplication {
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
|
readonly repositoryUrl: string;
|
||||||
readonly version: number;
|
readonly version: number;
|
||||||
readonly categories: ReadonlyArray<ICategory>;
|
readonly categories: ReadonlyArray<ICategory>;
|
||||||
readonly totalScripts: number;
|
readonly totalScripts: number;
|
||||||
@@ -12,6 +13,7 @@ export interface IApplication {
|
|||||||
findCategory(categoryId: number): ICategory | undefined;
|
findCategory(categoryId: number): ICategory | undefined;
|
||||||
findScript(scriptId: string): IScript | undefined;
|
findScript(scriptId: string): IScript | undefined;
|
||||||
getAllScripts(): ReadonlyArray<IScript>;
|
getAllScripts(): ReadonlyArray<IScript>;
|
||||||
|
getAllCategories(): ReadonlyArray<ICategory>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export { IScript } from '@/domain/IScript';
|
export { IScript } from '@/domain/IScript';
|
||||||
|
|||||||
14
src/global.d.ts
vendored
14
src/global.d.ts
vendored
@@ -37,6 +37,18 @@ declare module 'liquor-tree' {
|
|||||||
children: ReadonlyArray<ILiquorTreeNewNode> | undefined;
|
children: ReadonlyArray<ILiquorTreeNewNode> | undefined;
|
||||||
data: ICustomLiquorTreeData;
|
data: ICustomLiquorTreeData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://amsik.github.io/liquor-tree/#Component-Options
|
||||||
|
export interface ILiquorTreeOptions {
|
||||||
|
multiple: boolean;
|
||||||
|
checkbox: boolean;
|
||||||
|
checkOnSelect: boolean;
|
||||||
|
autoCheckChildren: boolean;
|
||||||
|
parentSelect: boolean;
|
||||||
|
keyboardNavigation: boolean;
|
||||||
|
deletion: (node: ILiquorTreeExistingNode) => void;
|
||||||
|
filter: ILiquorTreeFilter;
|
||||||
|
}
|
||||||
|
|
||||||
// https://github.com/amsik/liquor-tree/blob/master/src/lib/Node.js
|
// https://github.com/amsik/liquor-tree/blob/master/src/lib/Node.js
|
||||||
interface ILiquorTreeNodeState {
|
interface ILiquorTreeNodeState {
|
||||||
@@ -58,7 +70,7 @@ declare module 'liquor-tree' {
|
|||||||
// https://github.com/amsik/liquor-tree/blob/master/src/components/TreeRoot.vue
|
// https://github.com/amsik/liquor-tree/blob/master/src/components/TreeRoot.vue
|
||||||
interface ILiquorTreeFilter {
|
interface ILiquorTreeFilter {
|
||||||
emptyText: string;
|
emptyText: string;
|
||||||
matcher(query: string, node: ILiquorTreeNewNode): boolean;
|
matcher(query: string, node: ILiquorTreeExistingNode): boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LiquorTree: PluginObject<any> & VueClass<any>;
|
const LiquorTree: PluginObject<any> & VueClass<any>;
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ export default class CardListItem extends StatefulVue {
|
|||||||
this.cardTitle = value ? await this.getCardTitleAsync(value) : undefined;
|
this.cardTitle = value ? await this.getCardTitleAsync(value) : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private async getCardTitleAsync(categoryId: number): Promise<string | undefined> {
|
private async getCardTitleAsync(categoryId: number): Promise<string | undefined> {
|
||||||
const state = await this.getCurrentStateAsync();
|
const state = await this.getCurrentStateAsync();
|
||||||
const category = state.app.findCategory(this.categoryId);
|
const category = state.app.findCategory(this.categoryId);
|
||||||
|
|||||||
@@ -4,12 +4,12 @@
|
|||||||
<span class="part">
|
<span class="part">
|
||||||
<span
|
<span
|
||||||
class="part"
|
class="part"
|
||||||
v-bind:class="{ 'disabled': isGrouped, 'enabled': !isGrouped}"
|
v-bind:class="{ 'disabled': cardsSelected, 'enabled': !cardsSelected}"
|
||||||
@click="!isGrouped ? toggleGrouping() : undefined">Cards</span>
|
@click="groupByCard()">Cards</span>
|
||||||
<span class="part">|</span>
|
<span class="part">|</span>
|
||||||
<span class="part"
|
<span class="part"
|
||||||
v-bind:class="{ 'disabled': !isGrouped, 'enabled': isGrouped}"
|
v-bind:class="{ 'disabled': noneSelected, 'enabled': !noneSelected}"
|
||||||
@click="isGrouped ? toggleGrouping() : undefined">None</span>
|
@click="groupByNone()">None</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -20,14 +20,35 @@ import { StatefulVue } from '@/presentation/StatefulVue';
|
|||||||
import { IApplicationState } from '@/application/State/IApplicationState';
|
import { IApplicationState } from '@/application/State/IApplicationState';
|
||||||
import { Grouping } from './Grouping';
|
import { Grouping } from './Grouping';
|
||||||
|
|
||||||
|
const DefaultGrouping = Grouping.Cards;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
export default class TheGrouper extends StatefulVue {
|
export default class TheGrouper extends StatefulVue {
|
||||||
public currentGrouping: Grouping;
|
|
||||||
public isGrouped = true;
|
|
||||||
|
|
||||||
public toggleGrouping() {
|
public cardsSelected = false;
|
||||||
this.currentGrouping = this.currentGrouping === Grouping.None ? Grouping.Cards : Grouping.None;
|
public noneSelected = false;
|
||||||
this.isGrouped = this.currentGrouping === Grouping.Cards;
|
|
||||||
|
private currentGrouping: Grouping;
|
||||||
|
|
||||||
|
public mounted() {
|
||||||
|
this.changeGrouping(DefaultGrouping);
|
||||||
|
}
|
||||||
|
|
||||||
|
public groupByCard() {
|
||||||
|
this.changeGrouping(Grouping.Cards);
|
||||||
|
}
|
||||||
|
|
||||||
|
public groupByNone() {
|
||||||
|
this.changeGrouping(Grouping.None);
|
||||||
|
}
|
||||||
|
|
||||||
|
private changeGrouping(newGrouping: Grouping) {
|
||||||
|
if (this.currentGrouping === newGrouping) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.currentGrouping = newGrouping;
|
||||||
|
this.cardsSelected = newGrouping === Grouping.Cards;
|
||||||
|
this.noneSelected = newGrouping === Grouping.None;
|
||||||
this.$emit('groupingChanged', this.currentGrouping);
|
this.$emit('groupingChanged', this.currentGrouping);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,41 +1,46 @@
|
|||||||
import { IApplicationState, IUserSelection } from '@/application/State/IApplicationState';
|
import { IApplication } from './../../../domain/IApplication';
|
||||||
import { ICategory, IScript } from '@/domain/ICategory';
|
import { ICategory, IScript } from '@/domain/ICategory';
|
||||||
import { INode } from './SelectableTree/INode';
|
import { INode } from './SelectableTree/INode';
|
||||||
|
|
||||||
export function parseAllCategories(state: IApplicationState): INode[] | undefined {
|
export function parseAllCategories(app: IApplication): INode[] | undefined {
|
||||||
const nodes = new Array<INode>();
|
const nodes = new Array<INode>();
|
||||||
for (const category of state.app.categories) {
|
for (const category of app.categories) {
|
||||||
const children = parseCategoryRecursively(category, state.selection);
|
const children = parseCategoryRecursively(category);
|
||||||
nodes.push(convertCategoryToNode(category, children));
|
nodes.push(convertCategoryToNode(category, children));
|
||||||
}
|
}
|
||||||
return nodes;
|
return nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function parseSingleCategory(categoryId: number, state: IApplicationState): INode[] | undefined {
|
export function parseSingleCategory(categoryId: number, app: IApplication): INode[] | undefined {
|
||||||
const category = state.app.findCategory(categoryId);
|
const category = app.findCategory(categoryId);
|
||||||
if (!category) {
|
if (!category) {
|
||||||
throw new Error(`Category with id ${categoryId} does not exist`);
|
throw new Error(`Category with id ${categoryId} does not exist`);
|
||||||
}
|
}
|
||||||
const tree = parseCategoryRecursively(category, state.selection);
|
const tree = parseCategoryRecursively(category);
|
||||||
return tree;
|
return tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getScriptNodeId(script: IScript): string {
|
||||||
|
return script.id;
|
||||||
|
}
|
||||||
|
export function getCategoryNodeId(category: ICategory): string {
|
||||||
|
return `Category${category.id}`;
|
||||||
|
}
|
||||||
|
|
||||||
function parseCategoryRecursively(
|
function parseCategoryRecursively(
|
||||||
parentCategory: ICategory,
|
parentCategory: ICategory): INode[] {
|
||||||
selection: IUserSelection): INode[] {
|
|
||||||
if (!parentCategory) { throw new Error('parentCategory is undefined'); }
|
if (!parentCategory) { throw new Error('parentCategory is undefined'); }
|
||||||
if (!selection) { throw new Error('selection is undefined'); }
|
|
||||||
|
|
||||||
const nodes = new Array<INode>();
|
const nodes = new Array<INode>();
|
||||||
if (parentCategory.subCategories && parentCategory.subCategories.length > 0) {
|
if (parentCategory.subCategories && parentCategory.subCategories.length > 0) {
|
||||||
for (const subCategory of parentCategory.subCategories) {
|
for (const subCategory of parentCategory.subCategories) {
|
||||||
const subCategoryNodes = parseCategoryRecursively(subCategory, selection);
|
const subCategoryNodes = parseCategoryRecursively(subCategory);
|
||||||
nodes.push(convertCategoryToNode(subCategory, subCategoryNodes));
|
nodes.push(convertCategoryToNode(subCategory, subCategoryNodes));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (parentCategory.scripts && parentCategory.scripts.length > 0) {
|
if (parentCategory.scripts && parentCategory.scripts.length > 0) {
|
||||||
for (const script of parentCategory.scripts) {
|
for (const script of parentCategory.scripts) {
|
||||||
nodes.push(convertScriptToNode(script, selection));
|
nodes.push(convertScriptToNode(script));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nodes;
|
return nodes;
|
||||||
@@ -44,19 +49,17 @@ function parseCategoryRecursively(
|
|||||||
function convertCategoryToNode(
|
function convertCategoryToNode(
|
||||||
category: ICategory, children: readonly INode[]): INode {
|
category: ICategory, children: readonly INode[]): INode {
|
||||||
return {
|
return {
|
||||||
id: `${category.id}`,
|
id: getCategoryNodeId(category),
|
||||||
text: category.name,
|
text: category.name,
|
||||||
selected: false,
|
|
||||||
children,
|
children,
|
||||||
documentationUrls: category.documentationUrls,
|
documentationUrls: category.documentationUrls,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertScriptToNode(script: IScript, selection: IUserSelection): INode {
|
function convertScriptToNode(script: IScript): INode {
|
||||||
return {
|
return {
|
||||||
id: `${script.id}`,
|
id: getScriptNodeId(script),
|
||||||
text: script.name,
|
text: script.name,
|
||||||
selected: selection.isSelected(script),
|
|
||||||
children: undefined,
|
children: undefined,
|
||||||
documentationUrls: script.documentationUrls,
|
documentationUrls: script.documentationUrls,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<span id="container">
|
<span id="container">
|
||||||
<span v-if="nodes != null && nodes.length > 0">
|
<span v-if="nodes != null && nodes.length > 0">
|
||||||
<SelectableTree
|
<SelectableTree
|
||||||
:nodes="nodes"
|
:initialNodes="nodes"
|
||||||
:selectedNodeIds="selectedNodeIds"
|
:selectedNodeIds="selectedNodeIds"
|
||||||
:filterPredicate="filterPredicate"
|
:filterPredicate="filterPredicate"
|
||||||
:filterText="filterText"
|
:filterText="filterText"
|
||||||
v-on:nodeSelected="checkNodeAsync($event)">
|
v-on:nodeSelected="checkNodeAsync($event)">
|
||||||
</SelectableTree>
|
</SelectableTree>
|
||||||
</span>
|
</span>
|
||||||
<span v-else>Nooo 😢</span>
|
<span v-else>Nooo 😢</span>
|
||||||
@@ -19,9 +19,10 @@
|
|||||||
import { Category } from '@/domain/Category';
|
import { Category } from '@/domain/Category';
|
||||||
import { IRepository } from '@/infrastructure/Repository/IRepository';
|
import { IRepository } from '@/infrastructure/Repository/IRepository';
|
||||||
import { IScript } from '@/domain/IScript';
|
import { IScript } from '@/domain/IScript';
|
||||||
|
import { ICategory } from '@/domain/ICategory';
|
||||||
import { IApplicationState, IUserSelection } from '@/application/State/IApplicationState';
|
import { IApplicationState, IUserSelection } from '@/application/State/IApplicationState';
|
||||||
import { IFilterMatches } from '@/application/State/Filter/IFilterMatches';
|
import { IFilterResult } from '@/application/State/Filter/IFilterResult';
|
||||||
import { parseAllCategories, parseSingleCategory } from './ScriptNodeParser';
|
import { parseAllCategories, parseSingleCategory, getScriptNodeId, getCategoryNodeId } from './ScriptNodeParser';
|
||||||
import SelectableTree, { FilterPredicate } from './SelectableTree/SelectableTree.vue';
|
import SelectableTree, { FilterPredicate } from './SelectableTree/SelectableTree.vue';
|
||||||
import { INode } from './SelectableTree/INode';
|
import { INode } from './SelectableTree/INode';
|
||||||
|
|
||||||
@@ -33,15 +34,15 @@
|
|||||||
export default class ScriptsTree extends StatefulVue {
|
export default class ScriptsTree extends StatefulVue {
|
||||||
@Prop() public categoryId?: number;
|
@Prop() public categoryId?: number;
|
||||||
|
|
||||||
public nodes?: INode[] = null;
|
public nodes?: ReadonlyArray<INode> = null;
|
||||||
public selectedNodeIds?: string[] = null;
|
public selectedNodeIds?: ReadonlyArray<string> = [];
|
||||||
public filterText?: string = null;
|
public filterText?: string = null;
|
||||||
|
|
||||||
private matches?: IFilterMatches;
|
private filtered?: IFilterResult;
|
||||||
|
|
||||||
public async mounted() {
|
public async mounted() {
|
||||||
// React to state changes
|
|
||||||
const state = await this.getCurrentStateAsync();
|
const state = await this.getCurrentStateAsync();
|
||||||
|
// React to state changes
|
||||||
state.selection.changed.on(this.handleSelectionChanged);
|
state.selection.changed.on(this.handleSelectionChanged);
|
||||||
state.filter.filterRemoved.on(this.handleFilterRemoved);
|
state.filter.filterRemoved.on(this.handleFilterRemoved);
|
||||||
state.filter.filtered.on(this.handleFiltered);
|
state.filter.filtered.on(this.handleFiltered);
|
||||||
@@ -54,7 +55,7 @@
|
|||||||
return; // only interested in script nodes
|
return; // only interested in script nodes
|
||||||
}
|
}
|
||||||
const state = await this.getCurrentStateAsync();
|
const state = await this.getCurrentStateAsync();
|
||||||
if (node.selected) {
|
if (!this.selectedNodeIds.some((id) => id === node.id)) {
|
||||||
state.selection.addSelectedScript(node.id);
|
state.selection.addSelectedScript(node.id);
|
||||||
} else {
|
} else {
|
||||||
state.selection.removeSelectedScript(node.id);
|
state.selection.removeSelectedScript(node.id);
|
||||||
@@ -65,40 +66,36 @@
|
|||||||
public async initializeNodesAsync(categoryId?: number) {
|
public async initializeNodesAsync(categoryId?: number) {
|
||||||
const state = await this.getCurrentStateAsync();
|
const state = await this.getCurrentStateAsync();
|
||||||
if (categoryId) {
|
if (categoryId) {
|
||||||
this.nodes = parseSingleCategory(categoryId, state);
|
this.nodes = parseSingleCategory(categoryId, state.app);
|
||||||
} else {
|
} else {
|
||||||
this.nodes = parseAllCategories(state);
|
this.nodes = parseAllCategories(state.app);
|
||||||
}
|
}
|
||||||
|
this.selectedNodeIds = state.selection.selectedScripts
|
||||||
|
.map((script) => getScriptNodeId(script));
|
||||||
}
|
}
|
||||||
|
|
||||||
public filterPredicate(node: INode): boolean {
|
public filterPredicate(node: INode): boolean {
|
||||||
return this.matches.scriptMatches.some((script: IScript) => script.id === node.id);
|
return this.filtered.scriptMatches.some(
|
||||||
|
(script: IScript) => node.id === getScriptNodeId(script))
|
||||||
|
|| this.filtered.categoryMatches.some(
|
||||||
|
(category: ICategory) => node.id === getCategoryNodeId(category));
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleSelectionChanged(selectedScripts: ReadonlyArray<IScript>) {
|
private handleSelectionChanged(selectedScripts: ReadonlyArray<IScript>): void {
|
||||||
this.nodes = this.nodes.map((node: INode) => updateNodeSelection(node, selectedScripts));
|
this.selectedNodeIds = selectedScripts
|
||||||
|
.map((node) => node.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleFilterRemoved() {
|
private handleFilterRemoved() {
|
||||||
this.filterText = '';
|
this.filterText = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleFiltered(matches: IFilterMatches) {
|
private handleFiltered(result: IFilterResult) {
|
||||||
this.filterText = matches.query;
|
this.filterText = result.query;
|
||||||
this.matches = matches;
|
this.filtered = result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateNodeSelection(node: INode, selectedScripts: ReadonlyArray<IScript>): INode {
|
|
||||||
return {
|
|
||||||
id: node.id,
|
|
||||||
text: node.text,
|
|
||||||
selected: selectedScripts.some((script) => script.id === node.id),
|
|
||||||
children: node.children ? node.children.map((child) => updateNodeSelection(child, selectedScripts)) : [],
|
|
||||||
documentationUrls: node.documentationUrls,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
@@ -3,5 +3,4 @@ export interface INode {
|
|||||||
readonly text: string;
|
readonly text: string;
|
||||||
readonly documentationUrls: ReadonlyArray<string>;
|
readonly documentationUrls: ReadonlyArray<string>;
|
||||||
readonly children?: ReadonlyArray<INode>;
|
readonly children?: ReadonlyArray<INode>;
|
||||||
readonly selected: boolean;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<a :href="url"
|
<a :href="url"
|
||||||
:alt="url"
|
:alt="url"
|
||||||
target="_blank" class="docs"
|
target="_blank" class="docs"
|
||||||
v-tooltip.top-center="url"
|
v-tooltip.top-center="url"
|
||||||
v-on:click.stop>
|
v-on:click.stop>
|
||||||
<font-awesome-icon :icon="['fas', 'info-circle']" />
|
<font-awesome-icon :icon="['fas', 'info-circle']" />
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import { ILiquorTreeNewNode, ILiquorTreeExistingNode } from 'liquor-tree';
|
||||||
|
import { INode } from './INode';
|
||||||
|
|
||||||
|
// Functions to translate INode to LiqourTree models and vice versa for anti-corruption
|
||||||
|
|
||||||
|
export function convertExistingToNode(liquorTreeNode: ILiquorTreeExistingNode): INode {
|
||||||
|
if (!liquorTreeNode) { throw new Error('liquorTreeNode is undefined'); }
|
||||||
|
return {
|
||||||
|
id: liquorTreeNode.id,
|
||||||
|
text: liquorTreeNode.data.text,
|
||||||
|
// selected: liquorTreeNode.states && liquorTreeNode.states.checked,
|
||||||
|
children: (!liquorTreeNode.children || liquorTreeNode.children.length === 0)
|
||||||
|
? [] : liquorTreeNode.children.map((childNode) => convertExistingToNode(childNode)),
|
||||||
|
documentationUrls: liquorTreeNode.data.documentationUrls,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function toNewLiquorTreeNode(node: INode): ILiquorTreeNewNode {
|
||||||
|
if (!node) { throw new Error('node is undefined'); }
|
||||||
|
return {
|
||||||
|
id: node.id,
|
||||||
|
text: node.text,
|
||||||
|
state: {
|
||||||
|
checked: false,
|
||||||
|
},
|
||||||
|
children: (!node.children || node.children.length === 0) ? [] :
|
||||||
|
node.children.map((childNode) => toNewLiquorTreeNode(childNode)),
|
||||||
|
data: {
|
||||||
|
documentationUrls: node.documentationUrls,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<span>
|
<span>
|
||||||
<span v-if="initialNodes != null && initialNodes.length > 0">
|
<span v-if="initialLiquourTreeNodes != null && initialLiquourTreeNodes.length > 0">
|
||||||
<tree :options="liquorTreeOptions"
|
<tree :options="liquorTreeOptions"
|
||||||
:data="this.initialNodes"
|
:data="initialLiquourTreeNodes"
|
||||||
v-on:node:checked="nodeSelected($event)"
|
v-on:node:checked="nodeSelected($event)"
|
||||||
v-on:node:unchecked="nodeSelected($event)"
|
v-on:node:unchecked="nodeSelected($event)"
|
||||||
ref="treeElement"
|
ref="treeElement"
|
||||||
@@ -18,9 +18,10 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Component, Prop, Vue, Emit, Watch } from 'vue-property-decorator';
|
import { Component, Prop, Vue, Emit, Watch } from 'vue-property-decorator';
|
||||||
import LiquorTree, { ILiquorTreeNewNode, ILiquorTreeExistingNode, ILiquorTree } from 'liquor-tree';
|
import LiquorTree, { ILiquorTreeNewNode, ILiquorTreeExistingNode, ILiquorTree, ILiquorTreeOptions } from 'liquor-tree';
|
||||||
import Node from './Node.vue';
|
import Node from './Node.vue';
|
||||||
import { INode } from './INode';
|
import { INode } from './INode';
|
||||||
|
import { convertExistingToNode, toNewLiquorTreeNode } from './NodeTranslator';
|
||||||
export type FilterPredicate = (node: INode) => boolean;
|
export type FilterPredicate = (node: INode) => boolean;
|
||||||
|
|
||||||
/** Wrapper for Liquor Tree, reveals only abstracted INode for communication */
|
/** Wrapper for Liquor Tree, reveals only abstracted INode for communication */
|
||||||
@@ -33,28 +34,31 @@
|
|||||||
export default class SelectableTree extends Vue {
|
export default class SelectableTree extends Vue {
|
||||||
@Prop() public filterPredicate?: FilterPredicate;
|
@Prop() public filterPredicate?: FilterPredicate;
|
||||||
@Prop() public filterText?: string;
|
@Prop() public filterText?: string;
|
||||||
@Prop() public nodes?: INode[];
|
@Prop() public selectedNodeIds?: ReadonlyArray<string>;
|
||||||
|
@Prop() public initialNodes?: ReadonlyArray<INode>;
|
||||||
|
|
||||||
public initialNodes?: ILiquorTreeNewNode[] = null;
|
public initialLiquourTreeNodes?: ILiquorTreeNewNode[] = null;
|
||||||
public liquorTreeOptions = this.getLiquorTreeOptions();
|
public liquorTreeOptions = this.getDefaults();
|
||||||
|
public convertExistingToNode = convertExistingToNode;
|
||||||
|
|
||||||
public mounted() {
|
public mounted() {
|
||||||
// console.log('Mounted', 'initial nodes', this.nodes);
|
if (this.initialNodes) {
|
||||||
// console.log('Mounted', 'initial model', this.getLiquorTreeApi().model);
|
const initialNodes = this.initialNodes.map((node) => toNewLiquorTreeNode(node));
|
||||||
|
if (this.selectedNodeIds) {
|
||||||
if (this.nodes) {
|
recurseDown(initialNodes,
|
||||||
this.initialNodes = this.nodes.map((node) => this.toLiquorTreeNode(node));
|
(node) => node.state.checked = this.selectedNodeIds.includes(node.id));
|
||||||
|
}
|
||||||
|
this.initialLiquourTreeNodes = initialNodes;
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Initial nodes are null or empty');
|
throw new Error('Initial nodes are null or empty');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.filterText) {
|
if (this.filterText) {
|
||||||
this.updateFilterText(this.filterText);
|
this.updateFilterText(this.filterText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public nodeSelected(node: ILiquorTreeExistingNode) {
|
public nodeSelected(node: ILiquorTreeExistingNode) {
|
||||||
this.$emit('nodeSelected', this.convertExistingToNode(node));
|
this.$emit('nodeSelected', convertExistingToNode(node));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,104 +68,28 @@
|
|||||||
if (!filterText) {
|
if (!filterText) {
|
||||||
api.clearFilter();
|
api.clearFilter();
|
||||||
} else {
|
} else {
|
||||||
api.filter('filtered'); // text does not matter, it'll trigger the predicate
|
api.filter('filtered'); // text does not matter, it'll trigger the filterPredicate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Watch('nodes', {deep: true})
|
@Watch('selectedNodeIds')
|
||||||
public setSelectedStatus(nodes: |ReadonlyArray<INode>) {
|
public setSelectedStatus(selectedNodeIds: ReadonlyArray<string>) {
|
||||||
if (!nodes || nodes.length === 0) {
|
if (!selectedNodeIds) {
|
||||||
throw new Error('Updated nodes are null or empty');
|
throw new Error('Selected nodes are undefined');
|
||||||
}
|
}
|
||||||
// Update old node properties, re-setting it changes expanded status etc.
|
const newNodes = updateCheckedState(this.getLiquorTreeApi().model, selectedNodeIds);
|
||||||
// It'll not be needed when this is merged: https://github.com/amsik/liquor-tree/pull/141
|
this.getLiquorTreeApi().setModel(newNodes);
|
||||||
const updateCheckedState = (
|
/* Alternative:
|
||||||
oldNodes: ReadonlyArray<ILiquorTreeExistingNode>,
|
this.getLiquorTreeApi().recurseDown((node) => {
|
||||||
updatedNodes: ReadonlyArray<INode>): ILiquorTreeNewNode[] => {
|
node.states.checked = selectedNodeIds.includes(node.id);
|
||||||
const newNodes = new Array<ILiquorTreeNewNode>();
|
});
|
||||||
for (const oldNode of oldNodes) {
|
Problem: Does not check their parent if all children are checked, because it does not
|
||||||
for (const updatedNode of updatedNodes) {
|
trigger update on parent as we work with scripts not categories. */
|
||||||
if (oldNode.id === updatedNode.id) {
|
/* Alternative:
|
||||||
const newState = oldNode.states;
|
this.getLiquorTreeApi().recurseDown((node) => {
|
||||||
newState.checked = updatedNode.selected;
|
if(selectedNodeIds.includes(node.id)) { node.select(); } else { node.unselect(); }
|
||||||
newNodes.push({
|
});
|
||||||
id: oldNode.id,
|
Problem: Emits nodeSelected() event again which will cause an infinite loop. */
|
||||||
text: updatedNode.text,
|
|
||||||
children: oldNode.children == null ? [] :
|
|
||||||
updateCheckedState(
|
|
||||||
oldNode.children,
|
|
||||||
updatedNode.children),
|
|
||||||
state: newState,
|
|
||||||
data: {
|
|
||||||
documentationUrls: oldNode.data.documentationUrls,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return newNodes;
|
|
||||||
};
|
|
||||||
const newModel = updateCheckedState(
|
|
||||||
this.getLiquorTreeApi().model, nodes);
|
|
||||||
this.getLiquorTreeApi().setModel(newModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
private convertItem(liquorTreeNode: ILiquorTreeNewNode): INode {
|
|
||||||
if (!liquorTreeNode) { throw new Error('liquorTreeNode is undefined'); }
|
|
||||||
return {
|
|
||||||
id: liquorTreeNode.id,
|
|
||||||
text: liquorTreeNode.text,
|
|
||||||
selected: liquorTreeNode.state && liquorTreeNode.state.checked,
|
|
||||||
children: (!liquorTreeNode.children || liquorTreeNode.children.length === 0)
|
|
||||||
? [] : liquorTreeNode.children.map((childNode) => this.convertItem(childNode)),
|
|
||||||
documentationUrls: liquorTreeNode.data.documentationUrls,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private convertExistingToNode(liquorTreeNode: ILiquorTreeExistingNode): INode {
|
|
||||||
if (!liquorTreeNode) { throw new Error('liquorTreeNode is undefined'); }
|
|
||||||
return {
|
|
||||||
id: liquorTreeNode.id,
|
|
||||||
text: liquorTreeNode.data.text,
|
|
||||||
selected: liquorTreeNode.states && liquorTreeNode.states.checked,
|
|
||||||
children: (!liquorTreeNode.children || liquorTreeNode.children.length === 0)
|
|
||||||
? [] : liquorTreeNode.children.map((childNode) => this.convertExistingToNode(childNode)),
|
|
||||||
documentationUrls: liquorTreeNode.data.documentationUrls,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private toLiquorTreeNode(node: INode): ILiquorTreeNewNode {
|
|
||||||
if (!node) { throw new Error('node is undefined'); }
|
|
||||||
return {
|
|
||||||
id: node.id,
|
|
||||||
text: node.text,
|
|
||||||
state: {
|
|
||||||
checked: node.selected,
|
|
||||||
},
|
|
||||||
children: (!node.children || node.children.length === 0) ? [] :
|
|
||||||
node.children.map((childNode) => this.toLiquorTreeNode(childNode)),
|
|
||||||
data: {
|
|
||||||
documentationUrls: node.documentationUrls,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private getLiquorTreeOptions(): any {
|
|
||||||
return {
|
|
||||||
checkbox: true,
|
|
||||||
checkOnSelect: true,
|
|
||||||
deletion: (node) => !node.children || node.children.length === 0,
|
|
||||||
filter: {
|
|
||||||
matcher: (query: string, node: ILiquorTreeExistingNode) => {
|
|
||||||
if (!this.filterPredicate) {
|
|
||||||
throw new Error('Cannot filter as predicate is null');
|
|
||||||
}
|
|
||||||
return this.filterPredicate(this.convertExistingToNode(node));
|
|
||||||
},
|
|
||||||
emptyText: '🕵️Hmm.. Can not see one 🧐',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private getLiquorTreeApi(): ILiquorTree {
|
private getLiquorTreeApi(): ILiquorTree {
|
||||||
@@ -170,8 +98,61 @@
|
|||||||
}
|
}
|
||||||
return (this.$refs.treeElement as any).tree;
|
return (this.$refs.treeElement as any).tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getDefaults(): ILiquorTreeOptions {
|
||||||
|
return {
|
||||||
|
multiple: true,
|
||||||
|
checkbox: true,
|
||||||
|
checkOnSelect: true,
|
||||||
|
autoCheckChildren: true,
|
||||||
|
parentSelect: false,
|
||||||
|
keyboardNavigation: true,
|
||||||
|
deletion: (node) => !node.children || node.children.length === 0,
|
||||||
|
filter: {
|
||||||
|
matcher: (query: string, node: ILiquorTreeExistingNode) => {
|
||||||
|
if (!this.filterPredicate) {
|
||||||
|
throw new Error('Cannot filter as predicate is null');
|
||||||
|
}
|
||||||
|
return this.filterPredicate(convertExistingToNode(node));
|
||||||
|
},
|
||||||
|
emptyText: '🕵️Hmm.. Can not see one 🧐',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function recurseDown(
|
||||||
|
nodes: ReadonlyArray<ILiquorTreeNewNode>,
|
||||||
|
handler: (node: ILiquorTreeNewNode) => void) {
|
||||||
|
for (const node of nodes) {
|
||||||
|
handler(node);
|
||||||
|
if (node.children) {
|
||||||
|
recurseDown(node.children, handler);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateCheckedState(
|
||||||
|
oldNodes: ReadonlyArray<ILiquorTreeExistingNode>,
|
||||||
|
selectedNodeIds: ReadonlyArray<string>): ReadonlyArray<ILiquorTreeNewNode> {
|
||||||
|
const result = new Array<ILiquorTreeNewNode>();
|
||||||
|
for (const oldNode of oldNodes) {
|
||||||
|
const newState = oldNode.states;
|
||||||
|
newState.checked = selectedNodeIds.some((id) => id === oldNode.id);
|
||||||
|
const newNode: ILiquorTreeNewNode = {
|
||||||
|
id: oldNode.id,
|
||||||
|
text: oldNode.data.text,
|
||||||
|
data: {
|
||||||
|
documentationUrls: oldNode.data.documentationUrls,
|
||||||
|
},
|
||||||
|
children: oldNode.children == null ? [] :
|
||||||
|
updateCheckedState(oldNode.children, selectedNodeIds),
|
||||||
|
state: newState,
|
||||||
|
};
|
||||||
|
result.push(newNode);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,23 @@
|
|||||||
<div class="help-container">
|
<div class="help-container">
|
||||||
<TheSelector class="left" />
|
<TheSelector class="left" />
|
||||||
<TheGrouper class="right"
|
<TheGrouper class="right"
|
||||||
v-on:groupingChanged="onGroupingChanged($event)" />
|
v-on:groupingChanged="onGroupingChanged($event)"
|
||||||
|
v-show="!this.isSearching" />
|
||||||
|
</div>
|
||||||
|
<div class="scripts">
|
||||||
|
<div v-if="!isSearching || searchHasMatches">
|
||||||
|
<CardList v-if="this.showCards" />
|
||||||
|
<div v-else-if="this.showList" class="tree">
|
||||||
|
<div v-if="this.isSearching" class="search-query">
|
||||||
|
Searching for "{{this.searchQuery | threeDotsTrim}}"</div>
|
||||||
|
<ScriptsTree />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else class="search-no-matches">
|
||||||
|
Sorry, no matches for "{{this.searchQuery | threeDotsTrim}}" 😞
|
||||||
|
Feel free to extend the scripts <a :href="repositoryUrl" target="_blank" class="child github" >here</a>.
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<CardList v-if="showCards" />
|
|
||||||
<ScriptsTree v-if="showList" />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -14,11 +27,13 @@
|
|||||||
import { Component, Prop, Vue, Emit } from 'vue-property-decorator';
|
import { Component, Prop, Vue, Emit } from 'vue-property-decorator';
|
||||||
import { Category } from '@/domain/Category';
|
import { Category } from '@/domain/Category';
|
||||||
import { StatefulVue } from '@/presentation/StatefulVue';
|
import { StatefulVue } from '@/presentation/StatefulVue';
|
||||||
|
import { Grouping } from './Grouping/Grouping';
|
||||||
|
import { IFilterResult } from '@/application/State/Filter/IFilterResult';
|
||||||
import TheGrouper from '@/presentation/Scripts/Grouping/TheGrouper.vue';
|
import TheGrouper from '@/presentation/Scripts/Grouping/TheGrouper.vue';
|
||||||
import TheSelector from '@/presentation/Scripts/Selector/TheSelector.vue';
|
import TheSelector from '@/presentation/Scripts/Selector/TheSelector.vue';
|
||||||
import ScriptsTree from '@/presentation/Scripts/ScriptsTree/ScriptsTree.vue';
|
import ScriptsTree from '@/presentation/Scripts/ScriptsTree/ScriptsTree.vue';
|
||||||
import CardList from '@/presentation/Scripts/Cards/CardList.vue';
|
import CardList from '@/presentation/Scripts/Cards/CardList.vue';
|
||||||
import { Grouping } from './Grouping/Grouping';
|
|
||||||
|
|
||||||
/** Shows content of single category or many categories */
|
/** Shows content of single category or many categories */
|
||||||
@Component({
|
@Component({
|
||||||
@@ -28,35 +43,89 @@
|
|||||||
ScriptsTree,
|
ScriptsTree,
|
||||||
CardList,
|
CardList,
|
||||||
},
|
},
|
||||||
|
filters: {
|
||||||
|
threeDotsTrim(query: string) {
|
||||||
|
const threshold = 30;
|
||||||
|
if (query.length <= threshold - 3) {
|
||||||
|
return query;
|
||||||
|
}
|
||||||
|
return `${query.substr(0, threshold)}...`;
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
export default class TheScripts extends StatefulVue {
|
export default class TheScripts extends StatefulVue {
|
||||||
public showCards = true;
|
public showCards = false;
|
||||||
public showList = false;
|
public showList = false;
|
||||||
|
public repositoryUrl = '';
|
||||||
|
private searchQuery = '';
|
||||||
|
private isSearching = false;
|
||||||
|
private searchHasMatches = false;
|
||||||
|
|
||||||
@Prop() public data!: Category | Category[];
|
private currentGrouping: Grouping;
|
||||||
|
|
||||||
|
public async mounted() {
|
||||||
|
const state = await this.getCurrentStateAsync();
|
||||||
|
this.repositoryUrl = state.app.repositoryUrl;
|
||||||
|
state.filter.filterRemoved.on(() => {
|
||||||
|
this.isSearching = false;
|
||||||
|
this.updateGroups();
|
||||||
|
});
|
||||||
|
state.filter.filtered.on((result: IFilterResult) => {
|
||||||
|
this.searchQuery = result.query;
|
||||||
|
this.isSearching = true;
|
||||||
|
this.searchHasMatches = result.hasAnyMatches();
|
||||||
|
this.updateGroups();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public onGroupingChanged(group: Grouping) {
|
public onGroupingChanged(group: Grouping) {
|
||||||
switch (group) {
|
this.currentGrouping = group;
|
||||||
case Grouping.Cards:
|
this.updateGroups();
|
||||||
this.showCards = true;
|
}
|
||||||
this.showList = false;
|
|
||||||
break;
|
private updateGroups(): void {
|
||||||
case Grouping.None:
|
this.showCards = !this.isSearching && this.currentGrouping === Grouping.Cards;
|
||||||
this.showCards = false;
|
this.showList = this.isSearching || this.currentGrouping === Grouping.None;
|
||||||
this.showList = true;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new Error('Unknown grouping');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
@import "@/presentation/styles/colors.scss";
|
||||||
|
@import "@/presentation/styles/fonts.scss";
|
||||||
|
.scripts {
|
||||||
|
margin-top:10px;
|
||||||
|
.search-no-matches {
|
||||||
|
word-break:break-word;
|
||||||
|
color: $white;
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: $light-gray;
|
||||||
|
font-size: 1.5em;
|
||||||
|
background-color: $slate;
|
||||||
|
padding:5%;
|
||||||
|
text-align:center;
|
||||||
|
> a {
|
||||||
|
color: $gray;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tree {
|
||||||
|
padding-left: 3%;
|
||||||
|
padding-top: 15px;
|
||||||
|
padding-bottom: 15px;
|
||||||
|
.search-query {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
color: $gray;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.help-container {
|
.help-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
.center {
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
.left {
|
.left {
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
}
|
}
|
||||||
@@ -64,4 +133,5 @@
|
|||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div id="container">
|
<div id="container">
|
||||||
<h1 class="child title" >{{ title }}</h1>
|
<h1 class="child title" >{{ title }}</h1>
|
||||||
<h2 class="child subtitle">{{ subtitle }}</h2>
|
<h2 class="child subtitle">{{ subtitle }}</h2>
|
||||||
<a :href="githubUrl" target="_blank" class="child github" >
|
<a :href="repositoryUrl" target="_blank" class="child github" >
|
||||||
<font-awesome-icon :icon="['fab', 'github']" size="3x" />
|
<font-awesome-icon :icon="['fab', 'github']" size="3x" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -14,14 +14,15 @@ import { StatefulVue } from './StatefulVue';
|
|||||||
|
|
||||||
@Component
|
@Component
|
||||||
export default class TheHeader extends StatefulVue {
|
export default class TheHeader extends StatefulVue {
|
||||||
private title: string = '';
|
public title = '';
|
||||||
private subtitle: string = '';
|
public subtitle = '';
|
||||||
@Prop() private githubUrl!: string;
|
public repositoryUrl = '';
|
||||||
|
|
||||||
public async mounted() {
|
public async mounted() {
|
||||||
const state = await this.getCurrentStateAsync();
|
const state = await this.getCurrentStateAsync();
|
||||||
this.title = state.app.name;
|
this.title = state.app.name;
|
||||||
this.subtitle = 'Enforce privacy & security on Windows';
|
this.subtitle = 'Enforce privacy & security on Windows';
|
||||||
|
this.repositoryUrl = state.app.repositoryUrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="search">
|
<div class="search">
|
||||||
<input type="text" class="searchTerm" placeholder="Search for configurations"
|
<input type="search" class="searchTerm" placeholder="Search"
|
||||||
@input="updateFilterAsync($event.target.value)" >
|
@input="updateFilterAsync($event.target.value)" >
|
||||||
<div class="iconWrapper">
|
<div class="iconWrapper">
|
||||||
<font-awesome-icon :icon="['fas', 'search']" />
|
<font-awesome-icon :icon="['fas', 'search']" />
|
||||||
@@ -16,8 +16,6 @@ import { StatefulVue } from './StatefulVue';
|
|||||||
|
|
||||||
@Component
|
@Component
|
||||||
export default class TheSearchBar extends StatefulVue {
|
export default class TheSearchBar extends StatefulVue {
|
||||||
|
|
||||||
|
|
||||||
public async updateFilterAsync(filter: |string) {
|
public async updateFilterAsync(filter: |string) {
|
||||||
const state = await this.getCurrentStateAsync();
|
const state = await this.getCurrentStateAsync();
|
||||||
if (!filter) {
|
if (!filter) {
|
||||||
@@ -35,9 +33,6 @@ export default class TheSearchBar extends StatefulVue {
|
|||||||
@import "@/presentation/styles/fonts.scss";
|
@import "@/presentation/styles/fonts.scss";
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
padding-top: 30px;
|
|
||||||
padding-right: 30%;
|
|
||||||
padding-left: 30%;
|
|
||||||
font: $normal-font;
|
font: $normal-font;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,6 +44,7 @@ export default class TheSearchBar extends StatefulVue {
|
|||||||
|
|
||||||
.searchTerm {
|
.searchTerm {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
min-width: 60px;
|
||||||
border: 1.5px solid $gray;
|
border: 1.5px solid $gray;
|
||||||
border-right: none;
|
border-right: none;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ describe('Application', () => {
|
|||||||
new ScriptStub('S3').withIsRecommended(true),
|
new ScriptStub('S3').withIsRecommended(true),
|
||||||
new ScriptStub('S4').withIsRecommended(true),
|
new ScriptStub('S4').withIsRecommended(true),
|
||||||
];
|
];
|
||||||
const sut = new Application('name', 2, [
|
const sut = new Application('name', 'repo', 2, [
|
||||||
new CategoryStub(3).withScripts(expected[0], new ScriptStub('S1').withIsRecommended(false)),
|
new CategoryStub(3).withScripts(expected[0], new ScriptStub('S1').withIsRecommended(false)),
|
||||||
new CategoryStub(2).withScripts(expected[1], new ScriptStub('S2').withIsRecommended(false)),
|
new CategoryStub(2).withScripts(expected[1], new ScriptStub('S2').withIsRecommended(false)),
|
||||||
]);
|
]);
|
||||||
@@ -28,7 +28,7 @@ describe('Application', () => {
|
|||||||
const categories = [];
|
const categories = [];
|
||||||
|
|
||||||
// act
|
// act
|
||||||
function construct() { return new Application('name', 2, categories); }
|
function construct() { return new Application('name', 'repo', 2, categories); }
|
||||||
|
|
||||||
// assert
|
// assert
|
||||||
expect(construct).to.throw('Application must consist of at least one category');
|
expect(construct).to.throw('Application must consist of at least one category');
|
||||||
@@ -41,7 +41,7 @@ describe('Application', () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
// act
|
// act
|
||||||
function construct() { return new Application('name', 2, categories); }
|
function construct() { return new Application('name', 'repo', 2, categories); }
|
||||||
|
|
||||||
// assert
|
// assert
|
||||||
expect(construct).to.throw('Application must consist of at least one script');
|
expect(construct).to.throw('Application must consist of at least one script');
|
||||||
@@ -54,7 +54,7 @@ describe('Application', () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
// act
|
// act
|
||||||
function construct() { return new Application('name', 2, categories); }
|
function construct() { return new Application('name', 'repo', 2, categories); }
|
||||||
|
|
||||||
// assert
|
// assert
|
||||||
expect(construct).to.throw('Application must consist of at least one recommended script');
|
expect(construct).to.throw('Application must consist of at least one recommended script');
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export class ApplicationStub implements IApplication {
|
|||||||
public readonly totalScripts = 0;
|
public readonly totalScripts = 0;
|
||||||
public readonly totalCategories = 0;
|
public readonly totalCategories = 0;
|
||||||
public readonly name = 'StubApplication';
|
public readonly name = 'StubApplication';
|
||||||
|
public readonly repositoryUrl = 'https://privacy.sexy';
|
||||||
public readonly version = 1;
|
public readonly version = 1;
|
||||||
public readonly categories = new Array<ICategory>();
|
public readonly categories = new Array<ICategory>();
|
||||||
|
|
||||||
@@ -23,4 +24,7 @@ export class ApplicationStub implements IApplication {
|
|||||||
public getAllScripts(): ReadonlyArray<IScript> {
|
public getAllScripts(): ReadonlyArray<IScript> {
|
||||||
throw new Error('Method not implemented.');
|
throw new Error('Method not implemented.');
|
||||||
}
|
}
|
||||||
|
public getAllCategories(): ReadonlyArray<ICategory> {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user