-
-
Notifications
You must be signed in to change notification settings - Fork 447
Detect URL and install using Plugin Manager #823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
092b459
Detect URL and install
Garulf 8c50d13
Use correct icon
Garulf cf056a9
Filename as title for result
Garulf 2e2d259
Block install if manual install exists
Garulf 9940539
add plugin installation notifications
jjw24 73c1031
append new guid as zip and file name, update error messaging
jjw24 4eeaaec
fix naming when installed from url source
jjw24 a796ac4
add capability to only load unique plugins with the highest version
jjw24 ebf9ef1
add check downloaded plugin zip has same or lesser version
jjw24 a07252c
add ability to switch off warning when unknown source
jjw24 c7e77e3
add tests for loading unique metadata method
jjw24 7868d62
update test
jjw24 48c0f21
only msg plugin download & install succes/failure
jjw24 76efdfc
version bump PluginsManager
jjw24 2edc345
Fix or condition
Garulf ea179e5
shorten version compare logic
jjw24 07aebae
Merge branch 'dev' into install-from-url
jjw24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
using NUnit.Framework; | ||
using Flow.Launcher.Core.Plugin; | ||
using Flow.Launcher.Plugin; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Flow.Launcher.Test | ||
{ | ||
[TestFixture] | ||
class PluginLoadTest | ||
{ | ||
[Test] | ||
public void GivenDuplicatePluginMetadatasWhenLoadedThenShouldReturnOnlyUniqueList() | ||
{ | ||
// Given | ||
var duplicateList = new List<PluginMetadata> | ||
{ | ||
new PluginMetadata | ||
{ | ||
ID = "CEA0TYUC6D3B4085823D60DC76F28855", | ||
Version = "1.0.0" | ||
}, | ||
new PluginMetadata | ||
{ | ||
ID = "CEA0TYUC6D3B4085823D60DC76F28855", | ||
Version = "1.0.1" | ||
}, | ||
new PluginMetadata | ||
{ | ||
ID = "CEA0TYUC6D3B4085823D60DC76F28855", | ||
Version = "1.0.2" | ||
}, | ||
new PluginMetadata | ||
{ | ||
ID = "CEA0TYUC6D3B4085823D60DC76F28855", | ||
Version = "1.0.0" | ||
}, | ||
new PluginMetadata | ||
{ | ||
ID = "CEA0TYUC6D3B4085823D60DC76F28855", | ||
Version = "1.0.0" | ||
}, | ||
new PluginMetadata | ||
{ | ||
ID = "ABC0TYUC6D3B7855823D60DC76F28855", | ||
Version = "1.0.0" | ||
}, | ||
new PluginMetadata | ||
{ | ||
ID = "ABC0TYUC6D3B7855823D60DC76F28855", | ||
Version = "1.0.0" | ||
} | ||
}; | ||
|
||
// When | ||
(var unique, var duplicates) = PluginConfig.GetUniqueLatestPluginMetadata(duplicateList); | ||
|
||
// Then | ||
Assert.True(unique.FirstOrDefault().ID == "CEA0TYUC6D3B4085823D60DC76F28855" && unique.FirstOrDefault().Version == "1.0.2"); | ||
Assert.True(unique.Count() == 1); | ||
|
||
Assert.False(duplicates.Any(x => x.Version == "1.0.2" && x.ID == "CEA0TYUC6D3B4085823D60DC76F28855")); | ||
Assert.True(duplicates.Count() == 6); | ||
} | ||
|
||
[Test] | ||
public void GivenDuplicatePluginMetadatasWithNoUniquePluginWhenLoadedThenShouldReturnEmptyList() | ||
{ | ||
// Given | ||
var duplicateList = new List<PluginMetadata> | ||
{ | ||
new PluginMetadata | ||
{ | ||
ID = "CEA0TYUC6D3B7855823D60DC76F28855", | ||
Version = "1.0.0" | ||
}, | ||
new PluginMetadata | ||
{ | ||
ID = "CEA0TYUC6D3B7855823D60DC76F28855", | ||
Version = "1.0.0" | ||
} | ||
}; | ||
|
||
// When | ||
(var unique, var duplicates) = PluginConfig.GetUniqueLatestPluginMetadata(duplicateList); | ||
|
||
// Then | ||
Assert.True(unique.Count() == 0); | ||
Assert.True(duplicates.Count() == 2); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @taooceros can you see a better way of doing this loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok I will take a try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm I think it is good enough. The plugin count will be relatively small, so no need to preoptimize it until we reach a bottleneck for that.