From 1ca6f1def182b5e886257ddec76ac8ddc4b3dd39 Mon Sep 17 00:00:00 2001
From: Sanjay Soundarajan
Date: Fri, 13 Dec 2024 16:36:22 -0800
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20update=20sorting=20on=20u?=
=?UTF-8?q?pdated=20time=20(#121)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* 🐛 fix: update sorting on updated time
* ⚰️ chore: remove yarn.lock
* 💄 style: uipdate profile ui
---
ui/error.vue | 3 +--
ui/pages/profile.vue | 11 +++++++----
ui/server/api/dashboard/[owner]/index.get.ts | 3 +++
ui/server/routes/login/github/callback.get.ts | 4 +++-
4 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/ui/error.vue b/ui/error.vue
index 12ebb86a..1fd3918f 100644
--- a/ui/error.vue
+++ b/ui/error.vue
@@ -52,8 +52,7 @@ if (props.error) {
} catch (error) {
console.error("Redirection error:", error);
}
- }
- else {
+ } else {
push.error({
title: "Something went wrong",
});
diff --git a/ui/pages/profile.vue b/ui/pages/profile.vue
index 284b350c..82aa99c6 100644
--- a/ui/pages/profile.vue
+++ b/ui/pages/profile.vue
@@ -53,9 +53,12 @@ const purgeTokens = async () => {
-
-
- This will remove all tokens associated with your account.
+
+
+
+ This will remove all Zenodo and GitHub tokens associated with your
+ account.
+
@@ -63,7 +66,7 @@ const purgeTokens = async () => {
Purge tokens
-
+
diff --git a/ui/server/api/dashboard/[owner]/index.get.ts b/ui/server/api/dashboard/[owner]/index.get.ts
index 2d317c4e..76eb2f4e 100644
--- a/ui/server/api/dashboard/[owner]/index.get.ts
+++ b/ui/server/api/dashboard/[owner]/index.get.ts
@@ -17,6 +17,9 @@ export default defineEventHandler(async (event) => {
// Get all installations for the owner
const installations = await prisma.installation.findMany({
+ orderBy: {
+ updated_at: "desc",
+ },
where: {
owner,
},
diff --git a/ui/server/routes/login/github/callback.get.ts b/ui/server/routes/login/github/callback.get.ts
index 2aebfc98..da91806c 100644
--- a/ui/server/routes/login/github/callback.get.ts
+++ b/ui/server/routes/login/github/callback.get.ts
@@ -64,7 +64,9 @@ export default defineEventHandler(async (event) => {
return sendRedirect(
event,
- requestedRedirect ? decodeURIComponent(requestedRedirect) : "/",
+ requestedRedirect
+ ? decodeURIComponent(requestedRedirect)
+ : `/dashboard/${githubUser.login}`,
);
}