-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Frontend display for syncing activities
- Loading branch information
1 parent
6e6fa8d
commit c61f6de
Showing
12 changed files
with
216 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
frontend/src/modules/contributor/components/shared/contributor-syncing-activities.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<template> | ||
<div v-if="inProgress" class="mr-4 z-50"> | ||
<lf-tooltip | ||
placement="bottom" | ||
:content="`Re-syncing all the activities as this profile was recently merged. This process may take some minutes.`" | ||
> | ||
<div class="flex items-center gap-1.5 cursor-default"> | ||
<lf-icon name="loader-4-fill" :size="16" class="text-secondary-400 animate-spin" /> | ||
<p class="text-small text-secondary-400 font-semibold"> | ||
Syncing activities... | ||
</p> | ||
</div> | ||
</lf-tooltip> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import LfTooltip from '@/ui-kit/tooltip/Tooltip.vue'; | ||
import { Contributor } from '@/modules/contributor/types/Contributor'; | ||
import { computed } from 'vue'; | ||
import { MergeActionState } from '@/shared/modules/merge/types/MemberActions'; | ||
import LfIcon from '@/ui-kit/icon/Icon.vue'; | ||
const props = defineProps<{ | ||
contributor: Contributor, | ||
}>(); | ||
const inProgress = computed(() => props.contributor.activitySycning === MergeActionState.IN_PROGRESS); | ||
// const error = computed(() => props.contributor.activitySycning === MergeActionState.ERROR); | ||
</script> | ||
|
||
<script lang="ts"> | ||
export default { | ||
name: 'LfContributorSyncingActivities', | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
frontend/src/shared/modules/merge/services/merge-actions.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import authAxios from '@/shared/axios/auth-axios'; | ||
import { AuthService } from '@/modules/auth/services/auth.service'; | ||
import { MergeAction } from '@/shared/modules/merge/types/MemberActions'; | ||
|
||
export class MergeActionsService { | ||
static async list(entityId: string, type: string = 'member'): Promise<MergeAction[]> { | ||
const tenantId = AuthService.getTenantId(); | ||
|
||
const response = await authAxios.get( | ||
`/tenant/${tenantId}/mergeActions`, | ||
{ | ||
params: { | ||
filter: { | ||
entityId, | ||
type, | ||
}, | ||
}, | ||
}, | ||
); | ||
|
||
return response.data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export enum MergeActionState { | ||
IN_PROGRESS = 'in-progress', | ||
DONE = 'done', | ||
ERROR = 'error', | ||
} | ||
|
||
export interface MergeAction { | ||
operationType: string; | ||
primaryId: string; | ||
secondaryId: string; | ||
state: MergeActionState; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import LfLoading from './Loading.vue'; | ||
|
||
export default { | ||
title: 'LinuxFoundation/Loading', | ||
component: LfLoading, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
// Propr | ||
height: { | ||
description: 'Loader height', | ||
defaultValue: '100px', | ||
control: 'text', | ||
}, | ||
width: { | ||
description: 'Loader width', | ||
defaultValue: '100%', | ||
control: 'text', | ||
}, | ||
count: { | ||
description: 'Number of loaders', | ||
defaultValue: '1', | ||
control: 'number', | ||
}, | ||
}, | ||
}; | ||
|
||
export const Default = { | ||
label: 'Primary', | ||
args: { | ||
height: '100px', | ||
width: '100%', | ||
count: 1, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<template> | ||
<div> | ||
<div | ||
v-for="el of new Array(props.count)" | ||
:key="el" | ||
class="c-loading" | ||
v-bind="$attrs" | ||
:style="{ height: props.height, width: props.width }" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
const props = withDefaults(defineProps<{ | ||
height?: string, | ||
width?: string, | ||
count?: number, | ||
}>(), { | ||
height: '100px', | ||
width: '100%', | ||
count: 1, | ||
}); | ||
</script> | ||
|
||
<script lang="ts"> | ||
export default { | ||
name: 'LfLoading', | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* ---------------------------------- *\ | ||
Loading | ||
\* ---------------------------------- */ | ||
|
||
@keyframes shimmer { | ||
100% { | ||
transform: translateX(100%); | ||
} | ||
} | ||
|
||
.c-loading { | ||
display: inline-block; | ||
height: 1em; | ||
position: relative; | ||
overflow: hidden; | ||
background-color: var(--lf-color-secondary-50); | ||
|
||
&:after { | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
transform: translateX(-100%); | ||
background-image: linear-gradient( | ||
90deg, | ||
rgba(255, 255, 255, 0) 0%, | ||
rgba(255, 255, 255, 0.2) 20.24%, | ||
rgba(255, 255, 255, 0.5) 42.57%, | ||
rgba(255, 255, 255, 0) 66.35% | ||
); | ||
animation: shimmer 1.5s infinite; | ||
content: ''; | ||
} | ||
} | ||
|