Skip to content

Commit

Permalink
VersionInfo and settings folder (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe Birbaum committed May 7, 2021
1 parent 5b82848 commit 5122320
Show file tree
Hide file tree
Showing 15 changed files with 92 additions and 13 deletions.
2 changes: 2 additions & 0 deletions src/Tool/src/Boost.Abstractions/Boost.Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>Boost.Abstractions</AssemblyName>
<RootNamespace>Boost</RootNamespace>
<PackageId>Boost.Tool.Abstractions</PackageId>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/Tool/src/Boost.AzureDevOps/Boost.AzureDevOps.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>Boost.AzureDevOps</RootNamespace>
<PackageId>Boost.Tool.AzureDevOps</PackageId>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Tool/src/Boost.Core/Boost.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<AssemblyName>Boost.Core</AssemblyName>
<RootNamespace>Boost</RootNamespace>
<Nullable>enable</Nullable>
<ApplicationIcon />
<OutputType>Library</OutputType>
<StartupObject />
<PackageId>Boost.Tool.Core</PackageId>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public static IServiceCollection AddNuget(this IServiceCollection services)
.AddType<GitRemoteRepositoryType>()
.AddType<LocalGitRepositoryType>()
.AddType<PipelineType>()
.AddType<UserSettingsType>()
.AddDataLoader<ConnectedServiceByIdDataLoader>();

return builder;
Expand Down
16 changes: 16 additions & 0 deletions src/Tool/src/Boost.Core/GraphQL/Settings/UserSettingsType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Boost.Core.Settings;
using Boost.Settings;
using HotChocolate.Types;

namespace Boost.Core.GraphQL
{
public class UserSettingsType : ObjectType<UserSettings>
{
protected override void Configure(
IObjectTypeDescriptor<UserSettings> descriptor)
{
descriptor.Field("location")
.Resolve(c => SettingsStore.GetUserDirectory());
}
}
}
2 changes: 2 additions & 0 deletions src/Tool/src/Boost.GitHub/Boost.GitHub.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>Boost.GitHub</RootNamespace>
<PackageId>Boost.Tool.GitHub</PackageId>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/Tool/src/Boost.Snapshooter/Boost.Snapshooter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>Boost.Snapshooter</AssemblyName>
<RootNamespace>Boost.Snapshooter</RootNamespace>
<PackageId>Boost.Tool.Snapshooter</PackageId>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
13 changes: 8 additions & 5 deletions src/UI/boost-ui/src/core/components/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@
>mdi-alert</v-icon
>
</div>
<span class="mr-4" v-if="version">v{{ version.installed }}</span>
<v-icon @click="dialog = !dialog">mdi-console</v-icon>
<v-icon @click="onAccountClick">mdi-account</v-icon>
<span @click="onAccountClick" v-if="me">{{ me.name }}</span>

<div style="cursor: pointer" @click="$router.push({ name: 'Info' })">
<v-icon class="mt-n1">mdi-information-outline</v-icon>
<span class="mr-2" v-if="version">{{ version.installed }}</span>
</div>
</v-system-bar>
<v-navigation-drawer width="62" class="nav" app>
<div
Expand Down Expand Up @@ -167,7 +168,9 @@ export default {
},
watch: {
version: function () {
this.versionSnack = true;
if (this.version.newerAvailable) {
this.versionSnack = true;
}
},
},
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

{{ tab.name }}
</router-link>
<slot></slot>
</v-system-bar>
<div class="ma-2 pa-0">
<router-view></router-view>
Expand Down
2 changes: 1 addition & 1 deletion src/UI/boost-ui/src/core/components/Info/InfoPage.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-row class="ma-4">
<v-row class="ma-2">
<v-col md="6"> <version-info-card></version-info-card></v-col>
</v-row>
</template>
Expand Down
22 changes: 21 additions & 1 deletion src/UI/boost-ui/src/core/components/Info/VersionInfoCard.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<v-card elevation="1">
<v-toolbar light color="grey lighten-2" elevation="0" height="42">
<v-toolbar-title>Boost Version</v-toolbar-title>
<v-toolbar-title>Boost version info</v-toolbar-title>
<v-spacer></v-spacer>
</v-toolbar>
<v-card-text v-if="version">
Expand Down Expand Up @@ -37,6 +37,26 @@
></v-col
>
</v-row>
<v-row v-if="version.newerAvailable">
<v-col>
<v-alert type="info" outlined>
A new version is available:<br /><br />
<pre>dotnet tool update -g {{ version.packageId }}</pre>
</v-alert>
</v-col>
</v-row>
<v-row v-if="version.newerPreReleaseAvailable">
<v-col>
<v-alert type="info" outlined>
A new pre-release is available:<br /><br />
<pre>
dotnet tool update -g {{ version.packageId }} --version {{
version.latest.version
}}</pre
>
</v-alert>
</v-col>
</v-row>
</v-card-text>
</v-card>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ export default {
data() {
return {
request: {
authority: "https://demo.identityserver.io",
clientId: "m2m",
secret: "secret",
authority: null,
clientId: null,
secret: null,
scopes: [],
saveTokens: false,
grantType: "client_credentials",
Expand Down
29 changes: 28 additions & 1 deletion src/UI/boost-ui/src/core/components/Settings/SettingsPage.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
<template>
<sub-navigation-bar :tabs="tabs"></sub-navigation-bar>
<sub-navigation-bar :tabs="tabs">
<template>
<v-spacer></v-spacer>
<v-tooltip bottom v-if="userSettings">
<template v-slot:activator="{ on, attrs }">
<v-icon
@click="onClickLocation"
v-bind="attrs"
v-on="on"
color="white"
>mdi-folder</v-icon
>
</template>
<span>{{ userSettings.location }}</span>
</v-tooltip>
</template>
</sub-navigation-bar>
</template>

<script>
import { mapState } from "vuex";
import SubNavigationBar from "../Common/SubNavigationBar.vue";
import workspaceMixins from "../workspaceMixins";
export default {
components: { SubNavigationBar },
mixins: [workspaceMixins],
created() {
if (this.$route.name === "Settings") {
this.$router.replace({ name: this.tabs[0].route });
Expand All @@ -19,5 +38,13 @@ export default {
],
};
},
computed: {
...mapState("app", ["userSettings"]),
},
methods: {
onClickLocation: function () {
this.openDirectoryInCode(this.userSettings.location);
},
},
};
</script>
2 changes: 2 additions & 0 deletions src/UI/boost-ui/src/core/graphql/App/GetVersion.gql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ query version {
version {
installed
packageId
newerAvailable
newerPreReleaseAvailable
latest {
published
version
Expand Down
1 change: 1 addition & 0 deletions src/UI/boost-ui/src/core/graphql/InitialData.gql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
query initalData {
userSettings {
location
defaultShell
workRoots {
name
Expand Down

0 comments on commit 5122320

Please sign in to comment.