Skip to content
Snippets Groups Projects
Commit e1423291 authored by Daniel Göbel's avatar Daniel Göbel
Browse files

Merge branch 'feature/32-migrate-to-new-service-architecture' into 'development'

Resolve "Migrate to new service architecture"

Closes #32

See merge request !27
parents 9aabe703 96df9598
No related branches found
No related tags found
2 merge requests!84Remove development branch,!27Resolve "Migrate to new service architecture"
......@@ -2,8 +2,8 @@
import { reactive, watch } from "vue";
import BootstrapModal from "@/components/Modals/BootstrapModal.vue";
import BootstrapIcon from "@/components/BootstrapIcon.vue";
import { UserService } from "@/client";
import type { User } from "@/client";
import { UserService } from "@/client/auth";
import type { User } from "@/client/auth";
import { useAuthStore } from "@/stores/auth";
const props = defineProps<{
......@@ -55,7 +55,7 @@ function modalClosed() {
function searchUser(name: string) {
formState.error = false;
UserService.userSearchUsers(name)
UserService.userListUsers(name)
.then((userSuggestions) => {
formState.potentialUsers = userSuggestions.filter(
(user) => store.user?.uid != user.uid
......
......@@ -4,7 +4,7 @@ import { Upload } from "@aws-sdk/lib-storage";
import BootstrapModal from "@/components/Modals/BootstrapModal.vue";
import { computed, onMounted, reactive, watch } from "vue";
import type { ComputedRef } from "vue";
import type { S3ObjectMetaInformation } from "@/client";
import type { S3ObjectMetaInformation } from "@/client/s3proxy";
import dayjs from "dayjs";
import { filesize } from "filesize";
import { Modal, Toast } from "bootstrap";
......
<script setup lang="ts">
import BootstrapIcon from "@/components/BootstrapIcon.vue";
import { reactive, onBeforeUnmount, onMounted } from "vue";
import { MiscellaneousService } from "@/client";
// import { MiscellaneousService } from "@/client/auth";
import { useAuthStore } from "@/stores/auth";
import { useRoute, useRouter } from "vue-router";
import { useCookies } from "vue3-cookies";
......@@ -15,13 +15,13 @@ const route = useRoute();
const api_connection = reactive({ connected: true, timer: null });
let timer: ReturnType<typeof setInterval> | undefined = undefined;
function checkApiHealth() {
MiscellaneousService.miscellaneousHealthCheck()
.then(() => {
api_connection.connected = true;
})
.catch(() => {
api_connection.connected = false;
});
// MiscellaneousService.miscellaneousHealthCheck()
// .then(() => {
// api_connection.connected = true;
// })
// .catch(() => {
// api_connection.connected = false;
// });
}
function logout() {
......
<script setup lang="ts">
import type { S3Key } from "@/client";
import type { S3Key } from "@/client/s3proxy";
import type { Ref } from "vue";
import { ref, watch } from "vue";
import BootstrapIcon from "@/components/BootstrapIcon.vue";
......
......@@ -3,10 +3,14 @@
const windowEnv: Record<string, string> = window["env"];
export const environment: env = {
S3_URL: windowEnv["s3Url"],
API_BASE_URL: windowEnv["apiUrl"],
S3PROXY_API_BASE_URL: windowEnv["s3proxyApiUrl"],
AUTH_API_BASE_URL: windowEnv["authApiUrl"],
WORKFLOW_API_BASE_URL: windowEnv["workflowApiUrl"],
};
type env = {
S3_URL: string;
API_BASE_URL: string;
S3PROXY_API_BASE_URL: string;
AUTH_API_BASE_URL: string;
WORKFLOW_API_BASE_URL: string;
};
import { defineStore } from "pinia";
import type { S3Key, User } from "@/client";
import { KeyService, UserService } from "@/client";
import { OpenAPI } from "@/client";
import type { User } from "@/client/auth";
import { UserService } from "@/client/auth";
import { S3KeyService } from "@/client/s3proxy";
import type { S3Key } from "@/client/s3proxy";
import { OpenAPI as S3ProxyOpenAPI } from "@/client/s3proxy";
import { OpenAPI as AuthOpenAPI } from "@/client/auth";
import { OpenAPI as WorkflowOpenAPI } from "@/client/workflow";
export type RootState = {
token: string | null;
......@@ -23,7 +27,9 @@ export const useAuthStore = defineStore({
actions: {
setToken(token: string | null) {
if (token != null) {
OpenAPI.TOKEN = token;
S3ProxyOpenAPI.TOKEN = token;
AuthOpenAPI.TOKEN = token;
WorkflowOpenAPI.TOKEN = token;
this.token = token;
UserService.userGetLoggedInUser()
.then((user) => {
......@@ -42,7 +48,7 @@ export const useAuthStore = defineStore({
},
updateUser(user: User) {
this.user = user;
KeyService.keyGetUserKeys(user.uid)
S3KeyService.s3KeyGetUserKeys(user.uid)
.then((keys) => {
if (keys.length > 0) {
this.setS3Key(keys[0]);
......
import { defineStore } from "pinia";
import { BucketPermissionsService, BucketService } from "@/client";
import type { BucketOut, BucketIn, BucketPermissionOut } from "@/client";
import { BucketPermissionService, BucketService } from "@/client/s3proxy";
import type {
BucketOut,
BucketIn,
BucketPermissionOut,
} from "@/client/s3proxy";
import { useAuthStore } from "@/stores/auth";
export const useBucketStore = defineStore({
......@@ -49,7 +53,7 @@ export const useBucketStore = defineStore({
) {
const authStore = useAuthStore();
if (authStore.user != null) {
BucketPermissionsService.bucketPermissionsListPermissionsPerUser(
BucketPermissionService.bucketPermissionListPermissionsPerUser(
authStore.user.uid
)
.then((permissions) => {
......
import type { S3ObjectMetaInformation } from "@/client";
import type { S3ObjectMetaInformation } from "@/client/s3proxy";
export interface S3ObjectWithFolder extends S3ObjectMetaInformation {
folder: string[];
......
......@@ -2,9 +2,8 @@
import { onBeforeMount, onMounted } from "vue";
import { useAuthStore } from "@/stores/auth";
import { useRouter, useRoute } from "vue-router";
import { OpenAPI } from "@/client";
import { OpenAPI as AuthOpenAPI } from "@/client/auth";
import { Toast } from "bootstrap";
const router = useRouter();
const route = useRoute();
......@@ -67,7 +66,7 @@ onMounted(() => {
<p class="card-text text-secondary">
Login to this service with LifeScience
</p>
<a :href="OpenAPI.BASE + '/auth/login'" class="m-2">
<a :href="AuthOpenAPI.BASE + '/auth/login'" class="m-2">
<img src="/src/assets/images/ls-login.png" alt="[LS Login]" />
</a>
</div>
......
<script setup lang="ts">
import type { ComputedRef } from "vue";
import { computed, onMounted, reactive } from "vue";
import type { BucketOut } from "@/client";
import type { BucketOut } from "@/client/s3proxy";
import { useRoute, useRouter } from "vue-router";
import BootstrapIcon from "@/components/BootstrapIcon.vue";
import CreateBucketModal from "@/components/Modals/CreateBucketModal.vue";
......
......@@ -3,8 +3,8 @@ import S3KeyView from "@/components/S3KeyView.vue";
import BootstrapIcon from "@/components/BootstrapIcon.vue";
import { reactive, onMounted, computed } from "vue";
import type { ComputedRef } from "vue";
import type { S3Key } from "@/client";
import { KeyService } from "@/client";
import type { S3Key } from "@/client/s3proxy";
import { S3KeyService } from "@/client/s3proxy";
import { useAuthStore } from "@/stores/auth";
import { Toast } from "bootstrap";
......@@ -35,7 +35,7 @@ const allowKeyDeletion: ComputedRef<boolean> = computed(
);
function refreshKeys(uid: string) {
KeyService.keyGetUserKeys(uid)
S3KeyService.s3KeyGetUserKeys(uid)
.then((keys) => {
if (keyState.activeKey >= keys.length) {
keyState.activeKey = keys.length - 1;
......@@ -48,7 +48,7 @@ function refreshKeys(uid: string) {
function deleteKey(accessKey: string) {
if (allowKeyDeletion.value && authStore.user != null) {
KeyService.keyDeleteUserKey(accessKey, authStore.user.uid)
S3KeyService.s3KeyDeleteUserKey(accessKey, authStore.user.uid)
.then(() => {
keyState.deletedKey = accessKey;
keyState.activeKey = 0;
......@@ -64,7 +64,7 @@ function deleteKey(accessKey: string) {
function createKey() {
if (authStore.user != null) {
KeyService.keyCreateUserKey(authStore.user.uid)
S3KeyService.s3KeyCreateUserKey(authStore.user.uid)
.then((s3key) => {
keyState.keys.push(s3key);
keyState.keys = [...keyState.keys].sort((keyA, keyB) =>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment