Skip to content

Commit

Permalink
refactor: add more tooltips + remove unnessecary logs
Browse files Browse the repository at this point in the history
  • Loading branch information
SalmaElsoly committed Aug 29, 2024
1 parent 0aadaad commit 380c7d1
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ In fl-server dir:

### frontend

- Move to `frontend` directory and execute the following commands to run the frontend:
- Move to `frontend` directory, open new terminal and execute the following commands to run the frontend:

```bash
npm install
Expand Down
4 changes: 0 additions & 4 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
<script setup lang="ts">
import Footer from './components/Footer.vue';
import Navbar from './components/Navbar.vue';
import { useRoute } from 'vue-router';
var path : string | undefined = useRoute().name?.toString()
</script>
<style scoped>
.logo {
Expand Down
9 changes: 6 additions & 3 deletions frontend/src/components/CreateFlist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
density="compact"
><template v-slot:label>
<span class="text-subtitle-2">Private Registery</span>
<v-tooltip activator="parent" location="start">Check this box to pull the Docker image from your private registry instead of the public repository.</v-tooltip>
</template>
</v-checkbox>

Expand All @@ -52,7 +53,7 @@
<v-radio value="token">
<template v-slot:label>
<span class="text-subtitle-2">Identity Token</span>
<v-tooltip activator="parent" location="bottom">Token generated from private registery</v-tooltip>
<v-tooltip activator="parent" location="bottom">Token you can as an alternative to your email/username password</v-tooltip>
</template>
</v-radio>
</v-radio-group>
Expand Down Expand Up @@ -149,6 +150,8 @@
density="compact"
><template v-slot:label>
<span class="text-subtitle-2">Self Hosted Registery</span>
<v-tooltip activator="parent" location="start">Check this box to pull the Docker image from your self-hosted registry using registery address</v-tooltip>

</template>
</v-checkbox>
<div v-if="registeryAddress">
Expand All @@ -175,6 +178,8 @@
hide-details
><template v-slot:label>
<span class="text-subtitle-2">Web Registery Token</span>
<v-tooltip activator="parent" location="start">Check this box to use web registry token to pull image from your registry with secure authentication</v-tooltip>

</template>
</v-checkbox>
<div v-if="registeryToken">
Expand Down Expand Up @@ -249,7 +254,6 @@ const pullLists = async () => {
router.push({name: "flists"})
}
} catch (error: any) {
console.error("failed to fetch flist status", error);
pending.value = false;
stopPolling.value = true;
toast.error(error.response?.data)
Expand Down Expand Up @@ -288,7 +292,6 @@ const create = async () => {
polling = setInterval(pullLists, 1 * 10000);
} catch (error: any) {
console.error("Failed to create flist", error);
toast.error(error.response?.data || "error occured");
const errors: Number[] = [401, 403];
if (errors.includes(error.response?.status)) {
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ onMounted(async () => {
getUserNames();
filteredFlistFn();
} catch (error: any) {
console.error("Failed to fetch flists", error);
toast.error(error.response?.data);
}
});
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/components/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ const visible = ref<boolean>(false);
const token = response.data.access_token;
sessionStorage.setItem("token", token);
sessionStorage.setItem("username", user.value.username);
//emit event for auth
api.interceptors.request.use((config) => {
if (token) {
config.headers["Authorization"] = `Bearer ${token}`;
Expand All @@ -107,7 +106,6 @@ const visible = ref<boolean>(false);
});
router.push("/flists")
} catch (error: any) {
console.error("Failed to login", error);
toast.error(error.response?.data || "error occured");
}
};
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</template>

<script setup lang="ts">
import { ref, watch } from "vue";
import { ref } from "vue";
import whiteLogo from "../assets/logo_white.png";
import { toast } from "vue3-toastify";
import router from "../router";
Expand All @@ -57,7 +57,6 @@ const logout = async () => {
auth.value = sessionStorage.getItem("token");
router.push("/")
} catch (error: any) {
console.error("Failed to logout", error);
toast.error(error.response?.data || "error occured");
}
};
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/PreviewFlist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ onMounted(async () => {
showContent.value = "show content on click"
pending.value = false
} catch (error: any) {
console.error("Failed to fetch flists", error);
toast.error(error.response?.data);
}
});
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/UserFlist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ onMounted(async () => {
return loggedInUser?.length ? flists.value[loggedInUser] : [];
});
} catch (error: any) {
console.error("Failed to fetch flists", error);
toast.error(error.response?.data);
}
});
Expand Down
7 changes: 0 additions & 7 deletions frontend/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const Login = () => import("../components/Login.vue");
const CreateFlist = () => import("../components/CreateFlist.vue");
const Home = () => import("../components/Home.vue");
const UserFlist = () => import("../components/UserFlist.vue");
const FollowUp = () => import("../components/FollowUp.vue");
const PreviewFlist = () => import("../components/PreviewFlist.vue");

const routes: Array<RouteRecordRaw> = [
Expand All @@ -18,12 +17,6 @@ const routes: Array<RouteRecordRaw> = [
component: UserFlist,
meta: { requireAuth: true },
},
{
path: "/follow_up/:id",
name: "followUp",
component: FollowUp,
meta: { requireAuth: true },
},
{
path: "/create",
name: "create",
Expand Down

0 comments on commit 380c7d1

Please sign in to comment.