From 708f54811211ad9751c3c27adf22f56ed9a05085 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Fri, 1 Jul 2022 22:57:37 -0400 Subject: [PATCH 01/20] delete existing models --- DeskHubSharpRevised/Models/Branch.cs | 14 -- DeskHubSharpRevised/Models/Email.cs | 34 --- DeskHubSharpRevised/Models/License.cs | 25 -- DeskHubSharpRevised/Models/Owner.cs | 77 ------ DeskHubSharpRevised/Models/RepoDetail.cs | 294 ---------------------- DeskHubSharpRevised/Models/RequestList.cs | 21 -- DeskHubSharpRevised/Models/Search.cs | 151 ----------- DeskHubSharpRevised/Models/Sort.cs | 22 -- DeskHubSharpRevised/Models/User.cs | 36 --- 9 files changed, 674 deletions(-) delete mode 100644 DeskHubSharpRevised/Models/Branch.cs delete mode 100644 DeskHubSharpRevised/Models/Email.cs delete mode 100644 DeskHubSharpRevised/Models/License.cs delete mode 100644 DeskHubSharpRevised/Models/Owner.cs delete mode 100644 DeskHubSharpRevised/Models/RepoDetail.cs delete mode 100644 DeskHubSharpRevised/Models/RequestList.cs delete mode 100644 DeskHubSharpRevised/Models/Search.cs delete mode 100644 DeskHubSharpRevised/Models/Sort.cs delete mode 100644 DeskHubSharpRevised/Models/User.cs diff --git a/DeskHubSharpRevised/Models/Branch.cs b/DeskHubSharpRevised/Models/Branch.cs deleted file mode 100644 index 7085c8c..0000000 --- a/DeskHubSharpRevised/Models/Branch.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DeskHubSharpRevised.Models; - -public class Branch -{ - public string name { get; set; } - - public Commit commit { get; set; } - - public class Commit - { - public string sha { get; set; } - public string url { get; set; } - } -} \ No newline at end of file diff --git a/DeskHubSharpRevised/Models/Email.cs b/DeskHubSharpRevised/Models/Email.cs deleted file mode 100644 index 40b1931..0000000 --- a/DeskHubSharpRevised/Models/Email.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace DeskHubSharpRevised.Models; - -public class Email -{ - private string _toEmail = "wjmiller2016@gmail.com"; - private string _fromEmail = "wjmiller2016@gmail.com"; - private string _passwordEmail = "password"; - - public string Password - { - get { return _passwordEmail; } - set { _passwordEmail = value; } - } - - public string FromEmail - { - get { return _fromEmail; } - set { _fromEmail = value; } - } - - public string ToEmail - { - get { return _toEmail; } - set { _toEmail = value; } - } - - /// - /// Constructor for the Email class - /// - public Email() - { - - } -} \ No newline at end of file diff --git a/DeskHubSharpRevised/Models/License.cs b/DeskHubSharpRevised/Models/License.cs deleted file mode 100644 index 4984bb0..0000000 --- a/DeskHubSharpRevised/Models/License.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace DeskHubSharpRevised.Models; - -public class License -{ - /// - /// - /// - public string key { get; set; } - /// - /// - /// - public string name { get; set; } - /// - /// - /// - public string spdx_id { get; set; } - /// - /// - /// - public string url { get; set; } - /// - /// - /// - public string node_id { get; set; } -} \ No newline at end of file diff --git a/DeskHubSharpRevised/Models/Owner.cs b/DeskHubSharpRevised/Models/Owner.cs deleted file mode 100644 index 75dcfd8..0000000 --- a/DeskHubSharpRevised/Models/Owner.cs +++ /dev/null @@ -1,77 +0,0 @@ -namespace DeskHubSharpRevised.Models; - -public class Owner -{ - /// - /// - /// - public string login { get; set; } - /// - /// - /// - public int id { get; set; } - /// - /// - /// - public string node_id { get; set; } - /// - /// - /// - public string avatar_url { get; set; } - /// - /// - /// - public string gravatar_id { get; set; } - /// - /// - /// - public string url { get; set; } - /// - /// - /// - public string html_url { get; set; } - /// - /// - /// - public string followers_url { get; set; } - /// - /// - /// - public string following_url { get; set; } - /// - /// - /// - public string gists_url { get; set; } - /// - /// - /// - public string starred_url { get; set; } - /// - /// - /// - public string subscriptions_url { get; set; } - /// - /// - /// - public string organizations_url { get; set; } - /// - /// - /// - public string repos_url { get; set; } - /// - /// - /// - public string events_url { get; set; } - /// - /// - /// - public string received_events_url { get; set; } - /// - /// - /// - public string type { get; set; } - /// - /// - /// - public string site_admin { get; set; } -} \ No newline at end of file diff --git a/DeskHubSharpRevised/Models/RepoDetail.cs b/DeskHubSharpRevised/Models/RepoDetail.cs deleted file mode 100644 index 6ee2621..0000000 --- a/DeskHubSharpRevised/Models/RepoDetail.cs +++ /dev/null @@ -1,294 +0,0 @@ -namespace DeskHubSharpRevised.Models; - -public class RepoDetail -{ - public Owner Owner { get; set; } - - public License License { get; set; } - - public int id { get; set; } - /// - /// - /// - public string node_id { get; set; } - /// - /// - /// - public string name { get; set; } - /// - /// - /// - public string full_name { get; set; } - /// - /// - /// - //public string private { get; set; } - /// - /// - /// - public Owner owner { get; set; } - /// - /// - /// - public string html_url { get; set; } - /// - /// - /// - public string description { get; set; } - /// - /// - /// - public string fork { get; set; } - /// - /// - /// - public string url { get; set; } - /// - /// - /// - public string forks_url { get; set; } - /// - /// - /// - public string keys_url { get; set; } - /// - /// - /// - public string collaborators_url { get; set; } - /// - /// - /// - public string teams_url { get; set; } - /// - /// - /// - public string hooks_url { get; set; } - /// - /// - /// - public string issue_events_url { get; set; } - /// - /// - /// - public string events_url { get; set; } - /// - /// - /// - public string assignees_url { get; set; } - /// - /// - /// - public string branches_url { get; set; } - /// - /// - /// - public string tags_url { get; set; } - /// - /// - /// - public string blobs_url { get; set; } - /// - /// - /// - public string git_tags_url { get; set; } - /// - /// - /// - public string git_refs_url { get; set; } - /// - /// - /// - public string trees_url { get; set; } - /// - /// - /// - public string statuses_url { get; set; } - /// - /// - /// - public string languages_url { get; set; } - /// - /// - /// - public string stargazers_url { get; set; } - /// - /// - /// - public string contributors_url { get; set; } - /// - /// - /// - public string subscribers_url { get; set; } - /// - /// - /// - public string subscription_url { get; set; } - /// - /// - /// - public string commits_url { get; set; } - /// - /// - /// - public string git_commits_url { get; set; } - /// - /// - /// - public string comments_url { get; set; } - /// - /// - /// - public string issue_comment_url { get; set; } - /// - /// - /// - public string contents_url { get; set; } - /// - /// - /// - public string compare_url { get; set; } - /// - /// - /// - public string merges_url { get; set; } - /// - /// - /// - public string archive_url { get; set; } - /// - /// - /// - public string downloads_url { get; set; } - /// - /// - /// - public string issues_url { get; set; } - /// - /// - /// - public string pulls_url { get; set; } - /// - /// - /// - public string milestones_url { get; set; } - /// - /// - /// - public string notifications_url { get; set; } - /// - /// - /// - public string labels_url { get; set; } - /// - /// - /// - public string releases_url { get; set; } - /// - /// - /// - public string deployments_url { get; set; } - /// - /// - /// - public string created_at { get; set; } - /// - /// - /// - public string updated_at { get; set; } - /// - /// - /// - public string pushed_at { get; set; } - /// - /// - /// - public string git_url { get; set; } - /// - /// - /// - public string ssh_url { get; set; } - /// - /// - /// - public string clone_url { get; set; } - /// - /// - /// - public string svn_url { get; set; } - /// - /// - /// - public string homepage { get; set; } - /// - /// - /// - public int size { get; set; } - /// - /// - /// - public int stargazers_count { get; set; } - /// - /// - /// - public int watchers_count { get; set; } - /// - /// - /// - public string? language { get; set; } - /// - /// - /// - public string has_issues { get; set; } - /// - /// - /// - public string has_projects { get; set; } - /// - /// - /// - public string has_downloads { get; set; } - /// - /// - /// - public string has_wiki { get; set; } - /// - /// - /// - public string has_pages { get; set; } - /// - /// - /// - public int forks_count { get; set; } - /// - /// - /// - public string mirror_url { get; set; } - /// - /// - /// - public string archived { get; set; } - /// - /// - /// - public int open_issues_count { get; set; } - /// - /// - /// - public License license { get; set; } - /// - /// - /// - public int forks { get; set; } - /// - /// - /// - public int open_issues { get; set; } - /// - /// - /// - public int watchers { get; set; } - /// - /// - /// - public string default_branch { get; set; } -} \ No newline at end of file diff --git a/DeskHubSharpRevised/Models/RequestList.cs b/DeskHubSharpRevised/Models/RequestList.cs deleted file mode 100644 index 8a91d14..0000000 --- a/DeskHubSharpRevised/Models/RequestList.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.ObjectModel; - -namespace DeskHubSharpRevised.Models; - -public class RequestList -{ - /// - /// Stores everything in User, typically from the request - /// - public static User userDetail { get; set; } - - /// - /// Stores everything sent in Branch, typically from request - /// - public static ObservableCollection branchDetail { get; set; } - - /// - /// Stores everything sent in RepoDetail, typically from request - /// - public static ObservableCollection repoDetail { get; set; } -} \ No newline at end of file diff --git a/DeskHubSharpRevised/Models/Search.cs b/DeskHubSharpRevised/Models/Search.cs deleted file mode 100644 index 625fcd5..0000000 --- a/DeskHubSharpRevised/Models/Search.cs +++ /dev/null @@ -1,151 +0,0 @@ -using System.Collections.Generic; - -namespace DeskHubSharpRevised.Models; - -public class Search -{ - public class Owner - { - /// - /// - /// - public string login { get; set; } - /// - /// - /// - public int id { get; set; } - /// - /// - /// - public string node_id { get; set; } - /// - /// - /// - public string avatar_url { get; set; } - /// - /// - /// - public string gravatar_id { get; set; } - /// - /// - /// - public string url { get; set; } - /// - /// - /// - public string received_events_url { get; set; } - /// - /// - /// - public string type { get; set; } - } - - public class ItemsItem - { - /// - /// - /// - public int id { get; set; } - /// - /// - /// - public string node_id { get; set; } - /// - /// - /// - public string name { get; set; } - /// - /// - /// - public string full_name { get; set; } - /// - /// - /// - public Owner owner { get; set; } - /// - /// - /// - public string privates { get; set; } - /// - /// - /// - public string html_url { get; set; } - /// - /// - /// - public string description { get; set; } - /// - /// - /// - public string fork { get; set; } - /// - /// - /// - public string url { get; set; } - /// - /// - /// - public string created_at { get; set; } - /// - /// - /// - public string updated_at { get; set; } - /// - /// - /// - public string pushed_at { get; set; } - /// - /// - /// - public string homepage { get; set; } - /// - /// - /// - public int size { get; set; } - /// - /// - /// - public int stargazers_count { get; set; } - /// - /// - /// - public int watchers_count { get; set; } - /// - /// - /// - public string language { get; set; } - /// - /// - /// - public int forks_count { get; set; } - /// - /// - /// - public int open_issues_count { get; set; } - /// - /// - /// - public string master_branch { get; set; } - /// - /// - /// - public string default_branch { get; set; } - /// - /// - /// - public double score { get; set; } - } - - /// - /// - /// - public int total_count { get; set; } - /// - /// - /// - public string incomplete_results { get; set; } - /// - /// - /// - public List items { get; set; } -} \ No newline at end of file diff --git a/DeskHubSharpRevised/Models/Sort.cs b/DeskHubSharpRevised/Models/Sort.cs deleted file mode 100644 index a8cdbd3..0000000 --- a/DeskHubSharpRevised/Models/Sort.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections.Generic; - -namespace DeskHubSharpRevised.Models; - -public class Sort -{ - public Sort() - { - - } - - public List GetSortTerms() - { - List sortTerms = new List(); - sortTerms.Add("A - Z"); - sortTerms.Add("Least to most Stars"); - sortTerms.Add("Least to most Forks"); - sortTerms.Add("Least to most Watchers"); - - return sortTerms; - } -} \ No newline at end of file diff --git a/DeskHubSharpRevised/Models/User.cs b/DeskHubSharpRevised/Models/User.cs deleted file mode 100644 index 0c680be..0000000 --- a/DeskHubSharpRevised/Models/User.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace DeskHubSharpRevised.Models; - -public class User -{ - public string login { get; set; } - public int id { get; set; } - public string node_id { get; set; } - public string avatar_url { get; set; } - public string gravatar_id { get; set; } - public string url { get; set; } - public string html_url { get; set; } - public string followers_url { get; set; } - public string following_url { get; set; } - public string gists_url { get; set; } - public string starred_url { get; set; } - public string subscriptions_url { get; set; } - public string organizations_url { get; set; } - public string repos_url { get; set; } - public string events_url { get; set; } - public string received_events_url { get; set; } - public string type { get; set; } - public string site_admin { get; set; } - public string name { get; set; } - public string company { get; set; } - public string blog { get; set; } - public string location { get; set; } - public string email { get; set; } - public string hireable { get; set; } - public string bio { get; set; } - public int public_repos { get; set; } - public int public_gists { get; set; } - public int followers { get; set; } - public int following { get; set; } - public string created_at { get; set; } - public string updated_at { get; set; } -} \ No newline at end of file From b35f4e87514812ae3eb1e6eb48303e55e0c6b155 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Fri, 1 Jul 2022 22:58:36 -0400 Subject: [PATCH 02/20] added fsharp library used for models --- ModelsLib/Email.fs | 16 ++++++++++++++++ ModelsLib/ModelsLib.fsproj | 26 ++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 ModelsLib/Email.fs create mode 100644 ModelsLib/ModelsLib.fsproj diff --git a/ModelsLib/Email.fs b/ModelsLib/Email.fs new file mode 100644 index 0000000..cb50bfa --- /dev/null +++ b/ModelsLib/Email.fs @@ -0,0 +1,16 @@ +namespace DeskHubSharpRevised.Models + +type Email() = + let mutable _toEmail: string = "wjmiller2016@gmail.com" + let mutable _fromEmail: string = "wjmiller2016@gmail.com" + let mutable _password: string = "password" + + member this.ToEmail + with get() = _toEmail + and set(value: string) = _toEmail <- value + member this.FromEmail + with get() = _fromEmail + and set(value: string) = _fromEmail <- value + member this.Password + with get() = _password + and set(value: string) = _password <- value \ No newline at end of file diff --git a/ModelsLib/ModelsLib.fsproj b/ModelsLib/ModelsLib.fsproj new file mode 100644 index 0000000..bdfff38 --- /dev/null +++ b/ModelsLib/ModelsLib.fsproj @@ -0,0 +1,26 @@ + + + + net6.0 + true + DeskHubSharpRevised.Models + + + + + + + + + + + + + + + + + + From 0f455e0e904054c9d69e2a2197c8b78984c3b4aa Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Fri, 1 Jul 2022 22:59:09 -0400 Subject: [PATCH 03/20] added reference --- DeskHubSharpRevised.sln | 6 ++++++ DeskHubSharpRevised/DeskHubSharpRevised.csproj | 3 +++ 2 files changed, 9 insertions(+) diff --git a/DeskHubSharpRevised.sln b/DeskHubSharpRevised.sln index 7e7bd25..a4e469c 100644 --- a/DeskHubSharpRevised.sln +++ b/DeskHubSharpRevised.sln @@ -2,6 +2,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeskHubSharpRevised", "DeskHubSharpRevised\DeskHubSharpRevised.csproj", "{4A987749-B593-4051-A55C-F011080AFC78}" EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "ModelsLib", "ModelsLib\ModelsLib.fsproj", "{3E51ADA6-475A-4A27-B0D3-93BB319B761D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -12,5 +14,9 @@ Global {4A987749-B593-4051-A55C-F011080AFC78}.Debug|Any CPU.Build.0 = Debug|Any CPU {4A987749-B593-4051-A55C-F011080AFC78}.Release|Any CPU.ActiveCfg = Release|Any CPU {4A987749-B593-4051-A55C-F011080AFC78}.Release|Any CPU.Build.0 = Release|Any CPU + {3E51ADA6-475A-4A27-B0D3-93BB319B761D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3E51ADA6-475A-4A27-B0D3-93BB319B761D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3E51ADA6-475A-4A27-B0D3-93BB319B761D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3E51ADA6-475A-4A27-B0D3-93BB319B761D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/DeskHubSharpRevised/DeskHubSharpRevised.csproj b/DeskHubSharpRevised/DeskHubSharpRevised.csproj index f9bf618..a69151a 100644 --- a/DeskHubSharpRevised/DeskHubSharpRevised.csproj +++ b/DeskHubSharpRevised/DeskHubSharpRevised.csproj @@ -29,4 +29,7 @@ + + + From dc34b7eccd23651ffc91652cda43fb834269b3b2 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Fri, 1 Jul 2022 23:01:08 -0400 Subject: [PATCH 04/20] added branch model --- ModelsLib/Branch.fs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 ModelsLib/Branch.fs diff --git a/ModelsLib/Branch.fs b/ModelsLib/Branch.fs new file mode 100644 index 0000000..d2f5695 --- /dev/null +++ b/ModelsLib/Branch.fs @@ -0,0 +1,9 @@ +namespace DeskHubSharpRevised.Models + +type Branch() = + member this.name: string = null + member this.commit with get(): obj = null + + type Commit() = + member this.sha with get(): string = null + member this.url with get(): string = null \ No newline at end of file From f119b44551a319962f2fcca175fd2cb471073f7b Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Fri, 1 Jul 2022 23:01:20 -0400 Subject: [PATCH 05/20] added license model --- ModelsLib/License.fs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 ModelsLib/License.fs diff --git a/ModelsLib/License.fs b/ModelsLib/License.fs new file mode 100644 index 0000000..ff2a6a1 --- /dev/null +++ b/ModelsLib/License.fs @@ -0,0 +1,8 @@ +namespace DeskHubSharpRevised.Models + +type License() = + member this.key with get() = null + member this.name with get() = null + member this.spdx_id with get() = null + member this.url with get() = null + member this.node_id with get() = null \ No newline at end of file From 7caaa6c00b1e79fc88be26df605438c72281130a Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Fri, 1 Jul 2022 23:01:28 -0400 Subject: [PATCH 06/20] added owner model --- ModelsLib/Owner.fs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ModelsLib/Owner.fs diff --git a/ModelsLib/Owner.fs b/ModelsLib/Owner.fs new file mode 100644 index 0000000..7a4e001 --- /dev/null +++ b/ModelsLib/Owner.fs @@ -0,0 +1,21 @@ +namespace DeskHubSharpRevised.Models + +type Owner() = + member this.login with get() = null + member this.id with get() = null + member this.node_id with get() = null + member this.avatar_url with get() = null + member this.gravatar_url with get() = null + member this.html_url with get() = null + member this.followers_url with get() = null + member this.following_url with get() = null + member this.gists_url with get() = null + member this.starred_url with get() = null + member this.subscriptions_url with get() = null + member this.organizations_url with get() = null + member this.repos_url with get() = null + member this.events_url with get() = null + member this.received_events_url with get() = null + member this.types with get() = null + member this.site_admin with get() = null + \ No newline at end of file From c2270f23d1039e5d179ee419929474cfe2ebdfed Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Fri, 1 Jul 2022 23:01:46 -0400 Subject: [PATCH 07/20] added requestlist model --- ModelsLib/RequestList.fs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 ModelsLib/RequestList.fs diff --git a/ModelsLib/RequestList.fs b/ModelsLib/RequestList.fs new file mode 100644 index 0000000..d665074 --- /dev/null +++ b/ModelsLib/RequestList.fs @@ -0,0 +1,14 @@ +namespace DeskHubSharpRevised.Models + +open System.Collections.ObjectModel + +type RequestList = + static member userDetail + with get(): obj = null + and set(value) = RequestList.userDetail <- value + static member branchDetail + with get(): ObservableCollection = null + and set(value: ObservableCollection) = RequestList.branchDetail <- value + static member repoDetail + with get(): ObservableCollection = null + and set(value: ObservableCollection) = RequestList.repoDetail <- value \ No newline at end of file From 31baffc78c71806761863d56e625a853bd9a9b18 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Fri, 1 Jul 2022 23:02:06 -0400 Subject: [PATCH 08/20] added search model --- ModelsLib/Search.fs | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 ModelsLib/Search.fs diff --git a/ModelsLib/Search.fs b/ModelsLib/Search.fs new file mode 100644 index 0000000..c6f22ce --- /dev/null +++ b/ModelsLib/Search.fs @@ -0,0 +1,52 @@ +namespace DeskHubSharpRevised.Models + +open System.Collections.Generic + +type Search() = + member this.total_count with get(): int = 0 + member this.incomplete_results with get(): int = 0 + member this.items with get(): List = null + + type Owner() = + member this.login + with get(): string = null + and set(value: string) = this.login <- value + member this.id + with get(): int = 0 + and set(value: int) = this.id <- value + member this.node_id + with get(): string = null + member this.avatar_url + with get(): string = null + member this.gravatar_url + with get(): string = null + member this.url + with get(): string = null + member this.received_events_url + with get(): string = null + member this.types + with get(): string = null + + type ItemsItem() = + member this.id with get(): int = 0 + member this.node_id with get(): string = null + member this.name with get(): string = null + member this.full_name with get(): string = null + member this.owner with get(): obj = null + member this.privates with get(): string = null + member this.url with get(): string = null + member this.created_at with get(): string = null + member this.updated_at with get(): string = null + member this.pushed_at: string = null + member this.homepage: string = null + member this.size: int = 0 + member this.stargazers_count: int = 0 + member this.watchers_count: int = 0 + member this.language: string = null + member this.forks_count: string = null + member this.open_issues_count: int = 0 + member this.master_branch: string = null + member this.default_branch: string = null + member this.score: double = 0.0 + + \ No newline at end of file From 5555451d26a443dd24516fcb6d9d70f60a9963b6 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Fri, 1 Jul 2022 23:02:20 -0400 Subject: [PATCH 09/20] added sort model --- ModelsLib/Sort.fs | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 ModelsLib/Sort.fs diff --git a/ModelsLib/Sort.fs b/ModelsLib/Sort.fs new file mode 100644 index 0000000..0d76db3 --- /dev/null +++ b/ModelsLib/Sort.fs @@ -0,0 +1,7 @@ +namespace DeskHubSharpRevised.Models + +type public Sort() = + let terms = + ["A - Z"; "Least to Most Stars"; "Least to Most Forks"; "Least to Most Watchers"] + + member this.GetSortTerms = ResizeArray terms \ No newline at end of file From 18d1162485f98af67801f6a07d8e83ec9f036d9b Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Fri, 1 Jul 2022 23:02:43 -0400 Subject: [PATCH 10/20] added library readme --- ModelsLib/README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 ModelsLib/README.md diff --git a/ModelsLib/README.md b/ModelsLib/README.md new file mode 100644 index 0000000..5a19b70 --- /dev/null +++ b/ModelsLib/README.md @@ -0,0 +1,19 @@ +# Models Library + +Written by Wyatt J. Miller, 2022 + +Licensed by the Mozilla Public License version 2 + +## Ehh? + +I decided to rip out the existing models that were written in C# and replace them with the exact same models. The only difference is that these models are written in F#. + +## Why F#? + +1. .NET + 1. I didn't have to move forward and learn how everything worked +2. Curiosity + 1. Never messed with F# + 2. Messed with it's functional cousins (i.e. Kotlin, Rust, etc.) + +# I HAD TO WRITE ALL THESE FILES BY HAND \ No newline at end of file From 98ba5b4722f497233c16bbb1733a4d9fc7679121 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sat, 2 Jul 2022 14:32:45 -0400 Subject: [PATCH 11/20] updated branch model --- ModelsLib/Branch.fs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ModelsLib/Branch.fs b/ModelsLib/Branch.fs index d2f5695..9c2e78d 100644 --- a/ModelsLib/Branch.fs +++ b/ModelsLib/Branch.fs @@ -1,9 +1,8 @@ namespace DeskHubSharpRevised.Models type Branch() = - member this.name: string = null - member this.commit with get(): obj = null + member val name: string = null + with get, set - type Commit() = - member this.sha with get(): string = null - member this.url with get(): string = null \ No newline at end of file + member val commit = new Commit() + with get, set \ No newline at end of file From 14dfb31317b37a069913bc403f3b62a9d7a176ad Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sat, 2 Jul 2022 14:33:11 -0400 Subject: [PATCH 12/20] updated commit model --- ModelsLib/Commit.fs | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 ModelsLib/Commit.fs diff --git a/ModelsLib/Commit.fs b/ModelsLib/Commit.fs new file mode 100644 index 0000000..8e8d4b1 --- /dev/null +++ b/ModelsLib/Commit.fs @@ -0,0 +1,5 @@ +namespace DeskHubSharpRevised.Models + +type Commit() = + member this.sha with get(): string = null + member this.url with get(): string = null \ No newline at end of file From 9ab48ba20a2f07a17184cf76c31b69814239de1a Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sat, 2 Jul 2022 14:33:49 -0400 Subject: [PATCH 13/20] took out set property in password field --- ModelsLib/Email.fs | 1 - 1 file changed, 1 deletion(-) diff --git a/ModelsLib/Email.fs b/ModelsLib/Email.fs index cb50bfa..3f7ac1b 100644 --- a/ModelsLib/Email.fs +++ b/ModelsLib/Email.fs @@ -13,4 +13,3 @@ type Email() = and set(value: string) = _fromEmail <- value member this.Password with get() = _password - and set(value: string) = _password <- value \ No newline at end of file From e7a277db2e2df2941906d7e4b6c8a72cc585447c Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sat, 2 Jul 2022 14:34:07 -0400 Subject: [PATCH 14/20] added repodetail model --- ModelsLib/RepoDetail.fs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ModelsLib/RepoDetail.fs diff --git a/ModelsLib/RepoDetail.fs b/ModelsLib/RepoDetail.fs new file mode 100644 index 0000000..89296ba --- /dev/null +++ b/ModelsLib/RepoDetail.fs @@ -0,0 +1,27 @@ +namespace DeskHubSharpRevised.Models + +type RepoDetail() = + member val owner: Owner = new Owner() + with get, set + member val license: License = new License() + with get, set + member val id: int = 0 + with get, set + member val node_id: string = null + with get, set + member val name: string = null + with get, set + member val full_name: string = null + with get, set + member val html_url: string = null + with get, set + member val description: string = null + with get, set + member val stargazers_count: int = 0 + with get, set + member val forks_count: int = 0 + with get, set + member val watchers_count: int = 0 + with get, set + member val language: string = null + with get, set \ No newline at end of file From 14fdc11684c7259dcf6af1e7d4698c95b62c627a Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sat, 2 Jul 2022 14:34:38 -0400 Subject: [PATCH 15/20] updated requestlist model --- ModelsLib/RequestList.fs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ModelsLib/RequestList.fs b/ModelsLib/RequestList.fs index d665074..25ee5b6 100644 --- a/ModelsLib/RequestList.fs +++ b/ModelsLib/RequestList.fs @@ -2,13 +2,10 @@ namespace DeskHubSharpRevised.Models open System.Collections.ObjectModel -type RequestList = - static member userDetail - with get(): obj = null - and set(value) = RequestList.userDetail <- value - static member branchDetail - with get(): ObservableCollection = null - and set(value: ObservableCollection) = RequestList.branchDetail <- value - static member repoDetail - with get(): ObservableCollection = null - and set(value: ObservableCollection) = RequestList.repoDetail <- value \ No newline at end of file +type RequestList() = + static member val userDetail = new User() + with get, set + static member val branchDetail = new ObservableCollection() + with get, set + static member val repoDetail = new ObservableCollection() + with get, set \ No newline at end of file From 636349c0624cc452fc54611dede72d1e6012aaee Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sat, 2 Jul 2022 14:35:09 -0400 Subject: [PATCH 16/20] updated search model --- ModelsLib/Search.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ModelsLib/Search.fs b/ModelsLib/Search.fs index c6f22ce..5ff8855 100644 --- a/ModelsLib/Search.fs +++ b/ModelsLib/Search.fs @@ -7,7 +7,7 @@ type Search() = member this.incomplete_results with get(): int = 0 member this.items with get(): List = null - type Owner() = + type SearchOwner() = member this.login with get(): string = null and set(value: string) = this.login <- value From a333807c0313af40b663031fde789a08c8469111 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sat, 2 Jul 2022 14:35:17 -0400 Subject: [PATCH 17/20] added user model --- ModelsLib/User.fs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 ModelsLib/User.fs diff --git a/ModelsLib/User.fs b/ModelsLib/User.fs new file mode 100644 index 0000000..1ef8de7 --- /dev/null +++ b/ModelsLib/User.fs @@ -0,0 +1,32 @@ +namespace DeskHubSharpRevised.Models + +type User() = + member val login = "" + with get, set + member val id = 0 + with get, set + member val node_id = "" + with get, set + member val avatar_url = "" + with get, set + member val gravatar_url = "" + with get, set + member val url = "" + with get, set + member val html_url = "" + with get, set + member val followers_url = "" + with get, set + member val following_url = "" + with get, set + member val gists_url = "" + with get, set + member val blog = "" + with get, set + member val bio = "" + with get, set + member val name = "" + with get, set + member val public_repos = "" + with get, set + \ No newline at end of file From d73f21d7ace7b3e1d1685098e12ef1374a7c2b5c Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sat, 2 Jul 2022 14:35:54 -0400 Subject: [PATCH 18/20] modified application source files to fit library --- DeskHubSharpRevised/BLL/Request.cs | 5 ++--- DeskHubSharpRevised/DAL/ApiDataService.cs | 2 +- DeskHubSharpRevised/DAL/JsonDataService.cs | 2 +- DeskHubSharpRevised/DetailWindow.axaml.cs | 3 ++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DeskHubSharpRevised/BLL/Request.cs b/DeskHubSharpRevised/BLL/Request.cs index 6f7628e..0ce5bc9 100644 --- a/DeskHubSharpRevised/BLL/Request.cs +++ b/DeskHubSharpRevised/BLL/Request.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using DeskHubSharpRevised.DAL; using DeskHubSharpRevised.Models; @@ -63,8 +64,6 @@ public class Request public List PerformGetSort() { - Sort sort = new Sort(); - var sortTerms = sort.GetSortTerms(); - return sortTerms; + return new Sort().GetSortTerms; } } \ No newline at end of file diff --git a/DeskHubSharpRevised/DAL/ApiDataService.cs b/DeskHubSharpRevised/DAL/ApiDataService.cs index 1eb284f..3943d99 100644 --- a/DeskHubSharpRevised/DAL/ApiDataService.cs +++ b/DeskHubSharpRevised/DAL/ApiDataService.cs @@ -10,7 +10,7 @@ namespace DeskHubSharpRevised.DAL; public class ApiDataService : IDataService { - private string _apiEndpoint; + private string _apiEndpoint; private string _query; public List RepoDetail { get; set; } diff --git a/DeskHubSharpRevised/DAL/JsonDataService.cs b/DeskHubSharpRevised/DAL/JsonDataService.cs index b9bb616..e409916 100644 --- a/DeskHubSharpRevised/DAL/JsonDataService.cs +++ b/DeskHubSharpRevised/DAL/JsonDataService.cs @@ -24,7 +24,7 @@ public class JsonDataService : IDataService { string jsonString = sr.ReadToEnd(); - Search.ItemsItem users = JsonConvert.DeserializeObject(_dataConfig); + ItemsItem users = JsonConvert.DeserializeObject(_dataConfig); //user = users.items; } diff --git a/DeskHubSharpRevised/DetailWindow.axaml.cs b/DeskHubSharpRevised/DetailWindow.axaml.cs index d11ee44..928c714 100644 --- a/DeskHubSharpRevised/DetailWindow.axaml.cs +++ b/DeskHubSharpRevised/DetailWindow.axaml.cs @@ -42,6 +42,7 @@ public partial class DetailWindow : Window _repoDetail = repoDetail; _request = new Request(_repoDetail.name); + _owner = new Owner(); _cmbbox_branches_items = this.Find("cmbbox_branches"); _txtblk_language_text = this.Find("txtblk_language"); _txtblk_watchers_text = this.Find("txtblk_watchers"); @@ -86,7 +87,7 @@ public partial class DetailWindow : Window else { _owner = new Owner(); - string link = "https://github.com/" + _repoDetail.owner.login + "/" + _repoDetail.name + "/archive/" + cmbbox_branches.SelectedItem + ".zip"; + string link = "https://github.com/" + _owner.login + "/" + _repoDetail.name + "/archive/" + cmbbox_branches.SelectedItem + ".zip"; Process.Start(link); } From 818dd66f8891c3384801768786a4040672e357dc Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sat, 2 Jul 2022 14:36:59 -0400 Subject: [PATCH 19/20] modified library fsproj figured out that whatever is not compiled before call will result in a failure --- ModelsLib/ModelsLib.fsproj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ModelsLib/ModelsLib.fsproj b/ModelsLib/ModelsLib.fsproj index bdfff38..6a49cab 100644 --- a/ModelsLib/ModelsLib.fsproj +++ b/ModelsLib/ModelsLib.fsproj @@ -7,15 +7,16 @@ + - - - + + + From b70c89745e3dd9eb75a8810b5d3edc566e8694a8 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sat, 2 Jul 2022 14:37:15 -0400 Subject: [PATCH 20/20] updated readme --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 4bc5466..e12913e 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,10 @@ I also ripped out the legacy .NET Framework and put .NET 6 in it's place, which Think WPF but cross platform. Avalonia still runs your favorite declarative language, XAML, but applies a different drawing library, Skia (SkiaSharp). What Skia allows Avalonia to do is draw windows, buttons, and other widgets on not just Windows, but macOS, Linux, Android, and iOS. Even Web Assembly! Learn more [here](http://avaloniaui.net/). +###### 🚧👷‍♂️ All developers! Wear your hard hats! 🚧👷‍♂️ + +This application is still in the porting process. Don't worry though! It's being worked on. Please file an [issue]() if find anything that shouldn't be happening. + ## Building ### Requirements @@ -46,6 +50,8 @@ Clone using the following command: ### Deployment +All build tasks go through the `dotnet` command. + If you want to build for development, run: `dotnet run --project DeskHubSharpRevised/DeskHubSharpRevised.csproj` @@ -58,6 +64,8 @@ If you want to build for production for Windows, run: `dotnet publish DeskHubSharpRevised/DeskHubSharpRevised.csproj --configuration Release --framework net6.0 --output publish --self-contained True --runtime win-x64 --verbosity Normal /property:PublishTrimmed=True /property:PublishSingleFile=True /property:IncludeNativeLibrariesForSelfExtract=True /property:DebugType=None /property:DebugSymbols=False` +These tasks are supposed to be replaced with Cake in the near future. + ## Documentation To see the developer documentation, please run the following command in Powershell/bash: @@ -73,3 +81,5 @@ Also note that this step is optional. This step only generates documentation, wh ## Contribution Issues and pull requests are more than welcome. + +I don't have a style guide yet.