From 7f0d8a5ffde06cd529be856bcdd08ffc5d8cf6a8 Mon Sep 17 00:00:00 2001 From: DE BAERDEMAEKER Mathieu Date: Wed, 17 Feb 2021 13:48:04 +0100 Subject: [PATCH] fix(projects): unified azure dev ops and github repositories --- package-lock.json | 11 ++ package.json | 2 + public/global.css | 17 +- .../AccountSummary/AccountSummary.svelte | 105 ++---------- src/components/AddAccount/AddAccount.svelte | 4 +- src/components/AzureDevOps/AzureDevOps.svelte | 71 +++++---- src/components/Comment/Comment.svelte | 31 ++-- .../CustomListSettings.svelte | 2 - .../FollowedRepositories.svelte | 2 +- src/components/Header/Header.svelte | 6 +- src/components/Header/MacosBar.svelte | 2 +- src/components/Header/WindowsBar.svelte | 2 +- .../ImportExport/ImportExport.svelte | 79 +++++---- src/components/Main/Main.svelte | 2 +- src/components/Pullrequest/Pullrequest.svelte | 118 +++++++++----- .../SearchResults/SearchResults.svelte | 121 +------------- src/components/Tabs/Tabs.svelte | 48 +++--- src/electron/electron.ts | 2 + src/mappers/Organization.mapper.ts | 7 - src/mappers/Project.mapper.ts | 5 - src/mappers/PullRequest.mapper.ts | 3 + src/mappers/Repository.mapper.ts | 11 +- src/models/api/PullRequestsApiType.ts | 4 + src/models/skizzle/OrganizationType.ts | 4 +- src/models/skizzle/ProjectType.ts | 1 - src/models/skizzle/PullRequestType.ts | 3 + src/models/skizzle/RepositoryType.ts | 1 - src/requesters/Requester.ts | 15 +- src/services/OAuthAzureDevOps.service.ts | 76 ++++----- src/services/Service.ts | 24 --- src/shared/stores/default.store.ts | 150 +++++++----------- src/utils.ts | 116 ++------------ tsconfig.json | 2 +- 33 files changed, 370 insertions(+), 677 deletions(-) diff --git a/package-lock.json b/package-lock.json index bc89c72..d214dba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1061,6 +1061,12 @@ "@types/node": "*" } }, + "@types/marked": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@types/marked/-/marked-1.2.2.tgz", + "integrity": "sha512-wLfw1hnuuDYrFz97IzJja0pdVsC0oedtS4QsKH1/inyW9qkLQbXgMUqEQT0MVtUBx3twjWeInUfjQbhBVLECXw==", + "dev": true + }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", @@ -4141,6 +4147,11 @@ "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", "dev": true }, + "marked": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-2.0.0.tgz", + "integrity": "sha512-NqRSh2+LlN2NInpqTQnS614Y/3NkVMFFU6sJlRFEpxJ/LHuK/qJECH7/fXZjk4VZstPW/Pevjil/VtSONsLc7Q==" + }, "matcher": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", diff --git a/package.json b/package.json index 845ddf8..2d7cfb7 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "@rollup/plugin-node-resolve": "^11.0.0", "@rollup/plugin-typescript": "^8.0.0", "@tsconfig/svelte": "^1.0.10", + "@types/marked": "^1.2.2", "@types/node": "^14.14.13", "@types/superagent": "^4.1.10", "@types/superagent-proxy": "^2.0.0", @@ -73,6 +74,7 @@ "electron-log": "^4.3.0", "electron-updater": "4.3.5", "ky": "^0.26.0", + "marked": "^2.0.0", "sirv-cli": "^1.0.10", "superagent": "^6.1.0", "superagent-proxy": "^2.1.0", diff --git a/public/global.css b/public/global.css index b9a5f07..de0b51d 100644 --- a/public/global.css +++ b/public/global.css @@ -54,14 +54,15 @@ input:disabled { ::-webkit-scrollbar { width: 10px; + background-color: #333; } ::-webkit-scrollbar-thumb { - background: #ccc; + background: #666; } ::-webkit-scrollbar-corner { - background-color: #fff; + background-color: #444; } .btn { @@ -105,16 +106,4 @@ button.link:hover { .skz-splashscreen__label { color: #fff; } - - ::-webkit-scrollbar-thumb { - background: #666; - } - - ::-webkit-scrollbar-corner { - background-color: #444; - } - - ::-webkit-scrollbar { - background-color: #333; - } } diff --git a/src/components/AccountSummary/AccountSummary.svelte b/src/components/AccountSummary/AccountSummary.svelte index f39c922..94c91af 100644 --- a/src/components/AccountSummary/AccountSummary.svelte +++ b/src/components/AccountSummary/AccountSummary.svelte @@ -1,29 +1,17 @@ +
+
+ {profile.name} +
+
+ {profile.name} + {#if profile.email}{/if} +
+ +
+ - -
-
- {profile.name} -
-
- {profile.name} - {#if profile.email}{/if} -
- {#if withSettings} - - {/if} - -
-{#if isSettingsDisplayed} - - {#await Service.getOrganizations(profile.provider, { profile })} -

Chargement...

- {:then organizations} -
-
- {#await Service.getAvatar(profile.provider, profile.descriptor, organizations[0].organizationName) then avatar} - {profile.name} - {/await} -
-
- {profile.name} - -
-
- Organisations - - {/await} -
-{/if} + \ No newline at end of file diff --git a/src/components/AddAccount/AddAccount.svelte b/src/components/AddAccount/AddAccount.svelte index 248ed41..d24079f 100644 --- a/src/components/AddAccount/AddAccount.svelte +++ b/src/components/AddAccount/AddAccount.svelte @@ -1,6 +1,6 @@ {#if $isLoading} -

Chargement...

+

Chargement de l'application...

{:else if $clientAuthenticated.isAzureDevOpsAuthenticated} {#await Service.getProfile(ProviderEnum.AzureDevOps)} -

Chargement...

+

Chargement du profile

{:then profile} -
- Votre compte Azure DevOps - -
-
-
- Suivre un nouveau repository -

Cherchez le nom de son projet associé.

- - - {#if search} - - {/if} -
+ {#await Service.getRepositories(ProviderEnum.AzureDevOps, { profile })} +

Chargement de la liste des repositories

+ {:then repositories}
- + Votre compte Azure DevOps +
-
+
+
+ Suivre un nouveau repository +

Cherchez le nom de son projet et/ou repository associé.

+ + + {#if search} + + {/if} +
+
+ +
+
+ {:catch} +

Fetching profile failed.

+ {/await} {:catch}

Fetching profile failed.

{/await} diff --git a/src/components/Comment/Comment.svelte b/src/components/Comment/Comment.svelte index 853a90d..5e91b1e 100644 --- a/src/components/Comment/Comment.svelte +++ b/src/components/Comment/Comment.svelte @@ -1,8 +1,23 @@ +
+ {#await Service.getAvatar(comment.provider, comment.author.avatar, comment.organizationName) then avatar} +
+ {comment.author.displayName} +
+ {/await} +
+

{comment.author.displayName} {comment.date}

+
{@html marked(comment.text)}
+
+
+ - -
- {#await Service.getAvatar(comment.provider, comment.author.avatar, comment.organizationName) then avatar} -
- {comment.author.displayName} -
- {/await} -
-

{comment.author.displayName} {comment.date}

-

{comment.text}

-
-
diff --git a/src/components/CustomListSettings/CustomListSettings.svelte b/src/components/CustomListSettings/CustomListSettings.svelte index f2472de..641220d 100644 --- a/src/components/CustomListSettings/CustomListSettings.svelte +++ b/src/components/CustomListSettings/CustomListSettings.svelte @@ -122,7 +122,6 @@ {#if $repositories.filter(repo => repo.provider === ProviderEnum.AzureDevOps).length} {#each $repositories - .filter(({ checked }) => checked) .filter( repo => repo.provider === ProviderEnum.AzureDevOps, ) as repository} @@ -140,7 +139,6 @@ {#if $repositories.filter(repo => repo.provider === ProviderEnum.Github).length} {#each $repositories - .filter(({ checked }) => checked) .filter(repo => repo.provider === ProviderEnum.Github) as repository}