Skip to content

Commit

Permalink
Added more colorful icons as default
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschwendener committed Sep 26, 2018
1 parent 5e8f7f6 commit 3974deb
Show file tree
Hide file tree
Showing 27 changed files with 160 additions and 131 deletions.
7 changes: 6 additions & 1 deletion main.html
Expand Up @@ -29,7 +29,7 @@
</div>

<div class="search-results-container" v-if="searchResults.length > 0">
<div :id="searchResult.id" class="search-result" :style="searchResultHeight()" :class="{ 'active' : searchResult.active }"
<div :id="searchResult.id" class="search-result" :style="searchResultStyle()" :class="{ 'active' : searchResult.active }"
v-for="(searchResult, searchIndex) in searchResults" v-on:click="handleClick" v-on:mouseenter="handleMouseEnter(searchIndex)">
<div class="search-result-icon">
<div class="search-result-icon-container" :style="searchResultIconStyle()" :class="{ 'active' : searchResult.active }" v-html="searchResult.icon"></div>
Expand Down Expand Up @@ -282,6 +282,11 @@ <h1 class="setting-section-title">User Settings</h1>
<td class="text-center" v-html="config.iconSet.emailIcon"></td>
<td><input class="setting-text-input" type="text" v-model="config.iconSet.emailIcon" v-on:blur="updateUserConfig"></td>
</tr>
<tr>
<td>Environment variable icon</td>
<td class="text-center" v-html="config.iconSet.environmentVariableIcon"></td>
<td><input class="setting-text-input" type="text" v-model="config.iconSet.environmentVariableIcon" v-on:blur="updateUserConfig"></td>
</tr>
<tr>
<td>File icon</td>
<td class="text-center" v-html="config.iconSet.fileIcon"></td>
Expand Down
Expand Up @@ -109,8 +109,6 @@ describe(FileSearchPlugin.name, (): void => {
for (const item of actual) {
expect(item.name.length).toBeGreaterThan(0);
expect(item.executionArgument.length).toBeGreaterThan(0);
expect(item.tags).not.toBeUndefined();
expect(item.tags.length).toBe(0);
}
});

Expand Down
2 changes: 0 additions & 2 deletions src/tests/unit/builders/web-search-builder.test.ts
Expand Up @@ -30,7 +30,6 @@ describe(WebSearchBuilder.name, (): void => {
expect(actual.executionArgument).toBe(WebSearchBuilder.buildExecutionUrl(userInput, webSearch));
expect(actual.icon).toBe(webSearch.icon);
expect(actual.name).toBe(`Search ${webSearch.name} for '${userInput}'`);
expect(actual.tags.length).toBe(0);
});

it("should build the search result item correctly if userinput is an empty string", (): void => {
Expand All @@ -48,7 +47,6 @@ describe(WebSearchBuilder.name, (): void => {
expect(actual.executionArgument).toBe(WebSearchBuilder.buildExecutionUrl(userInput, webSearch));
expect(actual.icon).toBe(webSearch.icon);
expect(actual.name).toBe(`Search ${webSearch.name}`);
expect(actual.tags.length).toBe(0);
});
});

Expand Down
15 changes: 0 additions & 15 deletions src/tests/unit/search-engine.test.ts
Expand Up @@ -23,21 +23,6 @@ describe("SearchEngine", (): void => {
expect(actual.length).toBeGreaterThan(0);
});

it("should find items with their tags", (): void => {
const fakeItems = [
{ searchable: ["x"], tags: ["abc"] },
{ searchable: ["xy"], tags: ["abcd"] },
{ searchable: ["xyz"], tags: ["abcde"] },
] as SearchResultItem[];

const searchEngine = new SearchEngine(fakeItems, threshold);
const userInput = "abc";

const actual = searchEngine.search(userInput);

expect(actual.length).toBeGreaterThan(0);
});

it("should return empty array when user input doesnt match any of the plugin items", (): void => {
const fakeItems = [
{ searchable: ["abc"] },
Expand Down
@@ -1,4 +1,5 @@
import { EnvironmentVariablePlugin } from "../../../ts/search-plugins/environment-variable-plugin";
import { testIconSet } from "../../../ts/icon-sets/test-icon-set";

describe(EnvironmentVariablePlugin.name, (): void => {
const fakeEnvironmentVariableCollection = {
Expand All @@ -7,7 +8,7 @@ describe(EnvironmentVariablePlugin.name, (): void => {
path3: "path-3",
};

const plugin = new EnvironmentVariablePlugin(fakeEnvironmentVariableCollection);
const plugin = new EnvironmentVariablePlugin(fakeEnvironmentVariableCollection, testIconSet);

describe(plugin.getAllItems.name, (): void => {
it("should return an search result item for each item in the environment variable collection", (): void => {
Expand Down
1 change: 0 additions & 1 deletion src/tests/unit/search-plugins/programs-plugin.test.ts
Expand Up @@ -38,7 +38,6 @@ describe("ProgramsPlugin", (): void => {
expect(filtered.length).toBe(1);
expect(filtered[0].name).toBe(fakeProgram.name);
expect(filtered[0].executionArgument).toBe(fakeProgram.executionArgument);
expect(filtered[0].tags.length).toBe(0);
}
});
});
Expand Down
1 change: 0 additions & 1 deletion src/tests/unit/searcher/custom-command-searcher.test.ts
Expand Up @@ -61,7 +61,6 @@ describe(CustomCommandSearcher.name, (): void => {
expect(actual[0].name).toBe(`Open with command prompt: ipconfig /all`);
expect(actual[0].description).toBe(UeliHelpers.customCommandDescription);
expect(actual[0].searchable.length).toBe(0);
expect(actual[0].tags.length).toBe(0);
}
});
});
Expand Down
1 change: 1 addition & 0 deletions src/ts/icon-sets/icon-set.ts
@@ -1,5 +1,6 @@
export interface IconSet {
appIcon: string;
environmentVariableIcon: string;
emailIcon: string;
fileIcon: string;
folderIcon: string;
Expand Down

0 comments on commit 3974deb

Please sign in to comment.