Skip to content

Commit

Permalink
chore: fix achievements loading
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Mar 6, 2024
1 parent 404612b commit 84333fd
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 35 deletions.
2 changes: 1 addition & 1 deletion pkg/org/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type User struct {
Avatar string `json:"avatar" bun:",nullzero"`

NotifyByEmail bool `json:"notifyByEmail"`
AuthToken string `json:"-"`
AuthToken string `json:"authToken"`

CreatedAt time.Time `json:"createdAt" bun:",nullzero"`
UpdatedAt time.Time `json:"updatedAt" bun:",nullzero"`
Expand Down
6 changes: 6 additions & 0 deletions vue/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
<v-col v-if="!user.isAuth" cols="auto" class="d-flex align-center">
<v-btn text :to="{ name: 'Login' }" class="mr-1">Sign in</v-btn>
</v-col>
<v-col v-else cols="auto">
<v-btn color="green" dark href="https://app.uptrace.dev/join" target="_blank">
<v-icon left>mdi-cloud</v-icon>
<span>Try cloud</span>
</v-btn>
</v-col>
</v-row>
</v-container>
</v-app-bar>
Expand Down
11 changes: 2 additions & 9 deletions vue/src/org/use-achievements.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { proxyRefs, computed, ComputedRef } from 'vue'

// Composables
import { useRouter } from '@/use/router'
import { useWatchAxios } from '@/use/watch-axios'
import { injectForceReload } from '@/use/force-reload'
import { Project } from '@/org/use-projects'

export enum AchievName {
Expand Down Expand Up @@ -36,10 +34,7 @@ interface ListItemAttrs {

export type UseAchievements = ReturnType<typeof useAchievements>

export const useAchievements = function (project: ComputedRef<Project | undefined>) {
const { route } = useRouter()
const forceReload = injectForceReload()

export const useAchievements = function (project: ComputedRef<Project>) {
const allAchievements = computed((): Achievement[] => {
const items: Achievement[] = [
{
Expand Down Expand Up @@ -83,10 +78,8 @@ export const useAchievements = function (project: ComputedRef<Project | undefine
})

const { data, reload } = useWatchAxios(() => {
const { projectId } = route.value.params
return {
url: `/internal/v1/projects/${projectId}/achievements`,
params: forceReload.params,
url: `/internal/v1/projects/${project.value.id}/achievements`,
}
})

Expand Down
37 changes: 13 additions & 24 deletions vue/src/org/views/UserProfile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,29 @@
for details.
</v-col>
</v-row>

<v-row>
<v-col cols="6">
<v-text-field
v-model="user.current.name"
disabled
label="Name"
filled
required
hide-details="auto"
/>
</v-col>
</v-row>
<v-row>
<v-col cols="6">
<v-text-field
v-model="user.current.email"
disabled
label="Email"
filled
required
hide-details="auto"
/>
</v-col>
</v-row>
<v-row>
<v-col>
<v-text-field v-model="user.current.name" disabled label="Name" filled required />

<v-text-field v-model="user.current.email" disabled label="Email" filled required />

<v-checkbox
v-model="user.current.notifyByEmail"
disabled
label="Allow to send alert notifications via email"
hide-details="auto"
class="mt-0"
/>
</v-col>
</v-row>

<v-row v-if="user.current.authToken">
<v-col>
<div class="text-body-2 text--secondary">Auth token</div>
<PrismCode :code="user.current.authToken" />
</v-col>
</v-row>
</v-container>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions vue/src/system/GetStartedMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ import { defineComponent, computed, PropType } from 'vue'
// Composables
import { useAchievements } from '@/org/use-achievements'
// Misc
import { Project } from '@/org/use-projects'
export default defineComponent({
Expand Down
2 changes: 1 addition & 1 deletion vue/src/tracing/TraceTimeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<SpanChips :span="span" trace-mode class="ml-2" />
</td>

<td class="text-caption" style="position: relative">
<td class="text-body-2" style="position: relative">
<span :style="span.labelStyle">
<span v-show="span.children && trace.isExpanded(span)">
<DurationValue :value="span.durationSelf" />
Expand Down

0 comments on commit 84333fd

Please sign in to comment.