Compare commits

...

5 Commits

Author SHA1 Message Date
Mir Arif Hasan
156c341a81 fix: re-returning response from authCookieHandler 2023-05-09 15:54:46 +05:30
Anwarul Islam
81e090bbba feat: picture component moved to hoppscotch-ui (#3032) 2023-05-09 00:32:54 +05:30
Anwarul Islam
87ba02053b Fix issue with disappearing tab when opening request tabs with long text in body/script (#3030)
Co-authored-by: Liyas Thomas <liyascthomas@gmail.com>
2023-05-09 00:30:27 +05:30
Akash K
fb08147c66 fix: update the hoppscotch-sh-admin magic link route to match hoppscotch-app (#3029) 2023-05-03 23:12:50 +05:30
Nivedin
d129676cd6 fix: pane layout broken when wrap line is off (#3027)
Co-authored-by: Liyas Thomas <liyascthomas@gmail.com>
2023-05-03 20:39:22 +05:30
12 changed files with 53 additions and 149 deletions

View File

@@ -63,7 +63,7 @@ export const authCookieHandler = (
});
if (!redirect) {
res.status(HttpStatus.OK).send();
return res.status(HttpStatus.OK).send();
}
// check to see if redirectUrl is a whitelisted url
@@ -72,7 +72,7 @@ export const authCookieHandler = (
// if it is not redirect by default to REDIRECT_URL
redirectUrl = process.env.REDIRECT_URL;
res.status(HttpStatus.OK).redirect(redirectUrl);
return res.status(HttpStatus.OK).redirect(redirectUrl);
};
/**

View File

@@ -84,6 +84,7 @@ declare module '@vue/runtime-core' {
HoppSmartItem: typeof import('@hoppscotch/ui')['HoppSmartItem']
HoppSmartLink: typeof import('@hoppscotch/ui')['HoppSmartLink']
HoppSmartModal: typeof import('@hoppscotch/ui')['HoppSmartModal']
HoppSmartPicture: typeof import('@hoppscotch/ui')['HoppSmartPicture']
HoppSmartProgressRing: typeof import('@hoppscotch/ui')['HoppSmartProgressRing']
HoppSmartRadioGroup: typeof import('@hoppscotch/ui')['HoppSmartRadioGroup']
HoppSmartSlideOver: typeof import('@hoppscotch/ui')['HoppSmartSlideOver']
@@ -164,6 +165,7 @@ declare module '@vue/runtime-core' {
SmartItem: typeof import('./../../hoppscotch-ui/src/components/smart/Item.vue')['default']
SmartLink: typeof import('./../../hoppscotch-ui/src/components/smart/Link.vue')['default']
SmartModal: typeof import('./../../hoppscotch-ui/src/components/smart/Modal.vue')['default']
SmartPicture: typeof import('./../../hoppscotch-ui/src/components/smart/Picture.vue')['default']
SmartProgressRing: typeof import('./../../hoppscotch-ui/src/components/smart/ProgressRing.vue')['default']
SmartRadio: typeof import('./../../hoppscotch-ui/src/components/smart/Radio.vue')['default']
SmartRadioGroup: typeof import('./../../hoppscotch-ui/src/components/smart/RadioGroup.vue')['default']

View File

@@ -124,7 +124,7 @@
theme="popover"
:on-shown="() => tippyActions.focus()"
>
<ProfilePicture
<HoppSmartPicture
v-if="currentUser.photoURL"
v-tippy="{
theme: 'tooltip',
@@ -144,7 +144,7 @@
network.isOnline ? 'bg-green-500' : 'bg-red-500'
"
/>
<ProfilePicture
<HoppSmartPicture
v-else
v-tippy="{ theme: 'tooltip' }"
:title="

View File

@@ -1,87 +0,0 @@
<template>
<button
tabindex="0"
class="relative flex items-center justify-center overflow-visible cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-primaryDark"
:class="[`rounded-${rounded}`, `w-${size} h-${size}`]"
>
<img
v-if="url"
class="absolute object-cover object-center transition bg-primaryDark"
:class="[`rounded-${rounded}`, `w-${size} h-${size}`]"
:src="url"
:alt="alt"
loading="lazy"
/>
<div
v-else
class="absolute flex items-center justify-center object-cover object-center transition bg-primaryDark text-accentContrast"
:class="[`rounded-${rounded}`, `w-${size} h-${size}`]"
:style="`background-color: ${initial ? toHex(initial) : '#480000'}`"
>
<template v-if="initial && initial.charAt(0).toUpperCase()">
{{ initial.charAt(0).toUpperCase() }}
</template>
<icon-lucide-user v-else></icon-lucide-user>
</div>
<span
v-if="indicator"
class="border-primary border-2 h-2.5 -top-0.5 -right-0.5 w-2.5 absolute"
:class="[`rounded-${rounded}`, indicatorStyles]"
></span>
<!-- w-5 h-5 rounded-lg -->
</button>
</template>
<script lang="ts">
import { defineComponent, PropType } from "vue"
export default defineComponent({
props: {
url: {
type: String,
default: "",
},
alt: {
type: String,
default: "Profile picture",
},
indicator: {
type: Boolean,
default: false,
},
indicatorStyles: {
type: String,
default: "bg-green-500",
},
rounded: {
type: String,
default: "full",
},
size: {
type: String,
default: "5",
},
initial: {
type: String as PropType<string | undefined | null>,
default: "",
},
},
methods: {
toHex(initial: string) {
let hash = 0
if (initial.length === 0) return hash
for (let i = 0; i < initial.length; i++) {
hash = initial.charCodeAt(i) + ((hash << 5) - hash)
hash = hash & hash
}
let color = "#"
for (let i = 0; i < 3; i++) {
const value = (hash >> (i * 8)) & 255
color += `00${value.toString(16)}`.slice(-2)
}
return color
},
},
})
</script>

View File

@@ -5,7 +5,7 @@
:key="`member-${index}`"
class="inline-flex"
>
<ProfilePicture
<HoppSmartPicture
v-if="member.user.photoURL"
v-tippy="{ theme: 'tooltip' }"
:url="member.user.photoURL"
@@ -14,7 +14,7 @@
class="ring-primary ring-2"
@click="handleClick()"
/>
<ProfilePicture
<HoppSmartPicture
v-else
v-tippy="{ theme: 'tooltip' }"
:title="getUserName(member)"

View File

@@ -24,7 +24,10 @@
>
<Pane class="flex flex-1 !overflow-auto">
<main class="flex flex-1 w-full" role="main">
<RouterView v-slot="{ Component }" class="flex flex-1">
<RouterView
v-slot="{ Component }"
class="flex flex-1 min-w-0"
>
<Transition name="fade" mode="out-in" appear>
<component :is="Component" />
</Transition>

View File

@@ -34,7 +34,7 @@
></div>
<div class="flex flex-col justify-between px-4 space-y-8 md:flex-row">
<div class="flex items-end">
<ProfilePicture
<HoppSmartPicture
v-if="currentUser.photoURL"
:url="currentUser.photoURL"
:alt="
@@ -44,7 +44,7 @@
size="16"
rounded="lg"
/>
<ProfilePicture
<HoppSmartPicture
v-else
:initial="currentUser.displayName || currentUser.email"
rounded="lg"

View File

@@ -28,7 +28,7 @@
arrow
:on-shown="() => tippyActions!.focus()"
>
<ProfilePicture
<HoppSmartPicture
v-if="currentUser.photoURL"
v-tippy="{
theme: 'tooltip',
@@ -37,7 +37,7 @@
:alt="currentUser.displayName ?? 'No Name'"
:title="currentUser.displayName ?? currentUser.email ?? 'No Name'"
/>
<ProfilePicture
<HoppSmartPicture
v-else
v-tippy="{ theme: 'tooltip' }"
:title="currentUser.displayName ?? currentUser.email ?? 'No Name'"

View File

@@ -6,7 +6,7 @@ const isAdmin = () => {
return user ? user.isAdmin : false;
};
const GUEST_ROUTES = ['index', 'magic-link'];
const GUEST_ROUTES = ['index', 'enter'];
const isGuestRoute = (to: unknown) => GUEST_ROUTES.includes(to as string);

View File

@@ -33,55 +33,40 @@
</div>
</template>
<script lang="ts">
import { defineComponent, PropType } from 'vue';
<script setup lang="ts">
withDefaults(
defineProps<{
url: string
alt: string
indicator: boolean
indicatorStyles: string
rounded: string
size: string
initial: string | undefined | null
}>(),
{
url: "",
alt: "Profile picture",
indicator: false,
indicatorStyles: "bg-green-500",
rounded: "full",
size: "5",
initial: "",
}
)
export default defineComponent({
props: {
url: {
type: String,
default: '',
},
alt: {
type: String,
default: 'Profile picture',
},
indicator: {
type: Boolean,
default: false,
},
indicatorStyles: {
type: String,
default: 'bg-green-500',
},
rounded: {
type: String,
default: 'full',
},
size: {
type: String,
default: '5',
},
initial: {
type: String as PropType<string | undefined | null>,
default: '',
},
},
methods: {
toHex(initial: string) {
let hash = 0;
if (initial.length === 0) return hash;
for (let i = 0; i < initial.length; i++) {
hash = initial.charCodeAt(i) + ((hash << 5) - hash);
hash = hash & hash;
}
let color = '#';
for (let i = 0; i < 3; i++) {
const value = (hash >> (i * 8)) & 255;
color += `00${value.toString(16)}`.slice(-2);
}
return color;
},
},
});
const toHex = (initial: string) => {
let hash = 0
if (initial.length === 0) return hash
for (let i = 0; i < initial.length; i++) {
hash = initial.charCodeAt(i) + ((hash << 5) - hash)
hash = hash & hash
}
let color = "#"
for (let i = 0; i < 3; i++) {
const value = (hash >> (i * 8)) & 255
color += `00${value.toString(16)}`.slice(-2)
}
return color
}
</script>

View File

@@ -18,3 +18,4 @@ export { default as HoppSmartTabs } from "./Tabs.vue"
export { default as HoppSmartToggle } from "./Toggle.vue"
export { default as HoppSmartWindow } from "./Window.vue"
export { default as HoppSmartWindows } from "./Windows.vue"
export { default as HoppSmartPicture } from "./Picture.vue"