Skip to content
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

Version Tags #80

Merged
merged 3 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ services:
working_dir: /web
volumes:
- ./web:/web
- ./.git:/web/.git # allow fetching version tag
ports:
- 8080:8080
environment:
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ quote-style = "single"
[tool.ruff.lint.isort]
force-sort-within-sections = true # Sort by name, don't cluster "from" vs "import"
combine-as-imports = true # Combines "as" imports on the same line

[tool.semantic_release]
version_variables = ["setup.py:__version__", "web/package.json:version"]
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from setuptools import find_packages, setup

__version__ = '0.4.1'
annehaley marked this conversation as resolved.
Show resolved Hide resolved

readme_file = Path(__file__).parent / 'README.md'
if readme_file.exists():
with readme_file.open() as f:
Expand All @@ -12,7 +14,7 @@

setup(
name='uvdat',
version='0.1.0',
version=__version__,
description='',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down
53 changes: 53 additions & 0 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"axios": "^1.4.0",
"buffer": "^6.0.3",
"core-js": "^3.8.3",
"git-describe": "^4.1.1",
"lodash": "^4.17.21",
"maplibre-gl": "^4.6.0",
"shpjs": "^4.0.4",
Expand Down
54 changes: 52 additions & 2 deletions web/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { defineComponent, ref, watch, onMounted, computed } from "vue";
import { defineComponent, ref, Ref, watch, onMounted, computed } from "vue";
import {
currentUser,
currentError,
Expand Down Expand Up @@ -31,13 +31,22 @@ export default defineComponent({
setup() {
const drawer = ref(true);
const showError = computed(() => currentError.value !== undefined);
const version = process.env.VUE_APP_VERSION;
const hash = process.env.VUE_APP_HASH;
const copied: Ref<string | undefined> = ref();

function onReady() {
if (currentUser.value) {
loadProjects();
}
}

function copyToClipboard(content: string) {
navigator.clipboard.writeText(content).then(() => {
copied.value = content;
});
}

const login = () => {
oauthClient.redirectToLogin();
};
Expand All @@ -49,6 +58,9 @@ export default defineComponent({
return {
login,
logout,
version,
hash,
copied,
currentUser,
drawer,
currentProject,
Expand All @@ -59,6 +71,7 @@ export default defineComponent({
currentChart,
currentSimulationType,
projectConfigMode,
copyToClipboard,
};
},
});
Expand Down Expand Up @@ -103,7 +116,44 @@ export default defineComponent({
@click.stop="drawer = !drawer"
v-if="!projectConfigMode"
/>
<v-toolbar-title>UVDAT</v-toolbar-title>
<v-toolbar-title>
UVDAT
<v-menu
activator="parent"
:open-on-hover="true"
:close-on-content-click="false"
@update:model-value="copied = undefined"
>
<v-card class="pa-3" style="width: fit-content">
<v-card-subtitle>
<a
href="https://github.com/OpenGeoscience/uvdat"
target="_blank"
style="text-decoration: none"
>
<v-icon icon="mdi-github" />
Source
</a>
</v-card-subtitle>
<v-card-subtitle>
<v-icon
:icon="copied === version ? 'mdi-check' : 'mdi-content-copy'"
:color="copied === version ? 'green' : 'black'"
@click="copyToClipboard(version)"
/>
Version: {{ version }}
</v-card-subtitle>
<v-card-subtitle>
<v-icon
:icon="copied === hash ? 'mdi-check' : 'mdi-content-copy'"
:color="copied === hash ? 'green' : 'black'"
@click="copyToClipboard(hash)"
/>
Hash: {{ hash }}
</v-card-subtitle>
</v-card>
</v-menu>
</v-toolbar-title>
<v-spacer />
<div v-if="currentUser" class="px-3">
{{ currentUser.first_name }}
Expand Down
5 changes: 5 additions & 0 deletions web/vue.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const { ProvidePlugin } = require("webpack");

const { gitDescribeSync } = require("git-describe");
const describe = gitDescribeSync();
process.env.VUE_APP_VERSION = describe.dirty ? describe.raw : describe.tag;
process.env.VUE_APP_HASH = describe.hash;

module.exports = {
transpileDependencies: true,
configureWebpack: {
Expand Down
Loading