diff --git a/src/Tool/src/Boost.Core/GraphQL/BoostQueries.cs b/src/Tool/src/Boost.Core/GraphQL/BoostQueries.cs index db917c7..63b397e 100644 --- a/src/Tool/src/Boost.Core/GraphQL/BoostQueries.cs +++ b/src/Tool/src/Boost.Core/GraphQL/BoostQueries.cs @@ -37,6 +37,7 @@ public static IServiceCollection AddGraphQLServices( Action? configure = null) { IRequestExecutorBuilder builder = services.AddGraphQLServer() + .ModifyRequestOptions(m => m.IncludeExceptionDetails = true) .AddQueryType(d => d.Name(RootTypes.Query)) .AddMutationType(d => d.Name(RootTypes.Mutation)) .AddBoostTypes(); diff --git a/src/Tool/src/Boost.Core/Infrastructure/BoostApplicationContext.cs b/src/Tool/src/Boost.Core/Infrastructure/BoostApplicationContext.cs index 68d2602..cf8a4e9 100644 --- a/src/Tool/src/Boost.Core/Infrastructure/BoostApplicationContext.cs +++ b/src/Tool/src/Boost.Core/Infrastructure/BoostApplicationContext.cs @@ -10,8 +10,8 @@ public class BoostApplicationContext : IBoostApplicationContext public DirectoryInfo WorkingDirectory => GetWorkingDirectory(); - public string? Version => typeof(BoostApplicationContext) - .Assembly? + public string? Version => + Assembly.GetExecutingAssembly() .GetCustomAttribute()? .InformationalVersion; diff --git a/src/Tool/src/Boost.Core/Infrastructure/CertificateDataProtector.cs b/src/Tool/src/Boost.Core/Infrastructure/CertificateDataProtector.cs index 41523d5..db0b39e 100644 --- a/src/Tool/src/Boost.Core/Infrastructure/CertificateDataProtector.cs +++ b/src/Tool/src/Boost.Core/Infrastructure/CertificateDataProtector.cs @@ -86,7 +86,7 @@ public void Setup(EncryptionKeySetting settings) EncryptionKeySetting settings) { var thumb = settings.Parameters[ThumbprintParameterName]; - X509Certificate2? cert = null; + X509Certificate2? cert; if (settings.Parameters.ContainsKey("Pass")) { diff --git a/src/Tool/src/Boost.Core/Infrastructure/LogConfiguration.cs b/src/Tool/src/Boost.Core/Infrastructure/LogConfiguration.cs index 6a49705..0a8d442 100644 --- a/src/Tool/src/Boost.Core/Infrastructure/LogConfiguration.cs +++ b/src/Tool/src/Boost.Core/Infrastructure/LogConfiguration.cs @@ -1,5 +1,7 @@ using System.Diagnostics; +using Boost.Core.Settings; using Serilog; +using Serilog.Events; namespace Boost.Infrastructure { @@ -7,18 +9,19 @@ public class LogConfiguration { public static void CreateLogger() { - LoggerConfiguration logBuilder = new LoggerConfiguration() - .WriteTo.Console(); + var logPath = SettingsStore.GetUserDirectory("logs"); + LogEventLevel minLevel = LogEventLevel.Information; if (Debugger.IsAttached) { - logBuilder.MinimumLevel.Debug(); - } - else - { - logBuilder.MinimumLevel.Warning(); + minLevel = LogEventLevel.Debug; } + LoggerConfiguration logBuilder = new LoggerConfiguration() + .WriteTo.File($"{logPath}/boost.txt", rollingInterval: RollingInterval.Day) + .WriteTo.Console(restrictedToMinimumLevel: minLevel); + + logBuilder.MinimumLevel.Debug(); Log.Logger = logBuilder.CreateLogger(); } } diff --git a/src/Tool/src/Boost.Core/Web/WebApp/WebServer.cs b/src/Tool/src/Boost.Core/Web/WebApp/WebServer.cs index 0b34fff..a1176d1 100644 --- a/src/Tool/src/Boost.Core/Web/WebApp/WebServer.cs +++ b/src/Tool/src/Boost.Core/Web/WebApp/WebServer.cs @@ -2,7 +2,6 @@ using System.Diagnostics; using System.Threading.Tasks; using Boost.AuthApp; -using Boost.Core.GraphQL; using Boost.Data; using Boost.Infrastructure; using Boost.Security; diff --git a/src/Tool/src/Boost.Snapshooter/Services/SnapshooterService.cs b/src/Tool/src/Boost.Snapshooter/Services/SnapshooterService.cs index 515978f..2ac8382 100644 --- a/src/Tool/src/Boost.Snapshooter/Services/SnapshooterService.cs +++ b/src/Tool/src/Boost.Snapshooter/Services/SnapshooterService.cs @@ -24,6 +24,11 @@ public IEnumerable GetSnapshots(bool withMismatchOnly) foreach (FileInfo? ss in _boostApplicationContext.WorkingDirectory .GetFiles("*.snap", SearchOption.AllDirectories)) { + if (ss.FullName.Contains("node_modules")) + { + continue; + } + if (ss.Directory.Name.Contains("__snapshots__")) { snapshots.Add(new SnapshotInfo diff --git a/src/UI/boost-ui/src/core/components/Git/GitPage.vue b/src/UI/boost-ui/src/core/components/Git/GitPage.vue index 8f181bb..dba975c 100644 --- a/src/UI/boost-ui/src/core/components/Git/GitPage.vue +++ b/src/UI/boost-ui/src/core/components/Git/GitPage.vue @@ -8,7 +8,7 @@ export default { components: { SubNavigationBar }, created() { if (this.$route.name === "Git") { - this.$router.push({ name: this.tabs[0].route }); + this.$router.replace({ name: this.tabs[0].route }); } }, data() { diff --git a/src/UI/boost-ui/src/core/components/Git/LocalRepositoriesPage.vue b/src/UI/boost-ui/src/core/components/Git/LocalRepositoriesPage.vue index 2cbc031..7355a3d 100644 --- a/src/UI/boost-ui/src/core/components/Git/LocalRepositoriesPage.vue +++ b/src/UI/boost-ui/src/core/components/Git/LocalRepositoriesPage.vue @@ -35,7 +35,21 @@ - + + + Looks like you have not indexed you local repositories. Make sure you + have configured at least 1 work root and you did execute indexing. +
+
+ Index now +
+ + +
@@ -55,6 +69,7 @@ export default { ...mapState("git", { repos: (state) => state.local.items, listLoading: (state) => state.local.loading, + indexEmptyWarning: (state) => state.local.indexEmptyWarning, }), }, methods: { diff --git a/src/UI/boost-ui/src/core/components/Git/RepositoriesPage.vue b/src/UI/boost-ui/src/core/components/Git/RepositoriesPage.vue index bdf89ec..71645cd 100644 --- a/src/UI/boost-ui/src/core/components/Git/RepositoriesPage.vue +++ b/src/UI/boost-ui/src/core/components/Git/RepositoriesPage.vue @@ -36,7 +36,27 @@ - + + +
+

Remote git repositories

+

+ You can search and view your configured remote git repositories here. +

+ +
+ +

+ + Look like you don't have any connected services setup. :-( +

+ Setup now +
+

+
+ + +
@@ -44,10 +64,15 @@ import { mapActions, mapState } from "vuex"; export default { - created() {}, + created() { + if (this.connectedServices.length === 0) { + this.loadConnectedServices(); + } + }, data() { return { searchText: "", + firstLoad: true, }; }, computed: { @@ -55,9 +80,13 @@ export default { repos: (state) => state.list.items, listLoading: (state) => state.list.loading, }), + ...mapState("app", { + connectedServices: (state) => state.connectedServices, + }), }, methods: { ...mapActions("git", ["searchRepos"]), + ...mapActions("app", ["loadConnectedServices"]), onSelectRepo: function (repo) { this.$router.push({ name: "Git.Repo.Details", @@ -65,6 +94,7 @@ export default { }); }, onSearch: function () { + this.firstLoad = false; this.searchRepos({ term: this.searchText }); }, serviceImage: function (repo) { diff --git a/src/UI/boost-ui/src/core/components/Security/SecurityPage.vue b/src/UI/boost-ui/src/core/components/Security/SecurityPage.vue index 175e4df..aa1c525 100644 --- a/src/UI/boost-ui/src/core/components/Security/SecurityPage.vue +++ b/src/UI/boost-ui/src/core/components/Security/SecurityPage.vue @@ -8,7 +8,7 @@ export default { components: { SubNavigationBar }, created() { if (this.$route.name === "Security") { - this.$router.push({ name: this.tabs[0].route }); + this.$router.replace({ name: this.tabs[0].route }); } }, data() { diff --git a/src/UI/boost-ui/src/core/components/Settings/SettingsPage.vue b/src/UI/boost-ui/src/core/components/Settings/SettingsPage.vue index b27c811..4176e43 100644 --- a/src/UI/boost-ui/src/core/components/Settings/SettingsPage.vue +++ b/src/UI/boost-ui/src/core/components/Settings/SettingsPage.vue @@ -8,7 +8,7 @@ export default { components: { SubNavigationBar }, created() { if (this.$route.name === "Settings") { - this.$router.push({ name: this.tabs[0].route }); + this.$router.replace({ name: this.tabs[0].route }); } }, data() { diff --git a/src/UI/boost-ui/src/core/components/Utils/UtilsPage.vue b/src/UI/boost-ui/src/core/components/Utils/UtilsPage.vue index 662f74a..05875b9 100644 --- a/src/UI/boost-ui/src/core/components/Utils/UtilsPage.vue +++ b/src/UI/boost-ui/src/core/components/Utils/UtilsPage.vue @@ -8,7 +8,7 @@ export default { components: { SubNavigationBar }, created() { if (this.$route.name === "Utils") { - this.$router.push({ name: this.tabs[0].route }); + this.$router.replace({ name: this.tabs[0].route }); } }, data() { diff --git a/src/UI/boost-ui/src/core/gitStore.js b/src/UI/boost-ui/src/core/gitStore.js index 63664b9..56d3a8d 100644 --- a/src/UI/boost-ui/src/core/gitStore.js +++ b/src/UI/boost-ui/src/core/gitStore.js @@ -10,6 +10,7 @@ const workspaceStore = { }, local: { loading: false, + indexEmptyWarning: false, items: [] }, details: { @@ -29,6 +30,12 @@ const workspaceStore = { REPOS_LOCAL_LOADED(state, repos) { state.local.items = repos; state.local.loading = false; + if (repos.length > 0) { + state.local.indexEmptyWarning = false; + } + }, + REPO_LOCAL_INDEX_EMPTY_SET(state, value) { + state.local.indexEmptyWarning = value; }, REPOS_LIST_LOADING(state, loading) { state.list.loading = loading; @@ -68,6 +75,10 @@ const workspaceStore = { const result = await excuteGraphQL(() => searchLocalRepos(input), dispatch); if (result.success) { commit("REPOS_LOCAL_LOADED", result.data.searchLocalRepositories); + + if (result.data.searchLocalRepositories.length === 0 && input.term.length == 0) { + commit("REPO_LOCAL_INDEX_EMPTY_SET", true); + } } return null; diff --git a/src/UI/boost-ui/src/store/appStore.js b/src/UI/boost-ui/src/store/appStore.js index d06fe2b..6871cbd 100644 --- a/src/UI/boost-ui/src/store/appStore.js +++ b/src/UI/boost-ui/src/store/appStore.js @@ -1,6 +1,6 @@ import { getInitialData } from "../core/appService"; -import { saveConnectedService, saveTokenRequestor, saveWorkRoots } from "../core/settingsService"; +import { saveConnectedService, saveTokenRequestor, saveWorkRoots, getConnectedServices } from "../core/settingsService"; import { excuteGraphQL } from "./graphqlClient"; const appStore = { @@ -10,6 +10,7 @@ const appStore = { console: [], userSettings: null, app: null, + connectedServices: [] }), mutations: { MESSAGE_ADDED(state, message) { @@ -34,6 +35,9 @@ const appStore = { }, CONNECTED_SERVICE_SAVED(state, service) { console.log(state, service); + }, + CONNECTED_SERVICES_LOADED(state, services) { + state.connectedServices = services; } }, actions: { @@ -68,6 +72,17 @@ const appStore = { ); } }, + async loadConnectedServices({ commit, dispatch }) { + const result = await excuteGraphQL(() => getConnectedServices(), dispatch); + if (result.success) { + const { connectedServices } = result.data; + commit("CONNECTED_SERVICES_LOADED", connectedServices); + + return connectedServices; + } + + return null; + }, async saveConnectedService({ commit, dispatch }, service) { const result = await excuteGraphQL(() => saveConnectedService(service), dispatch); if (result.success) {