Skip to content

Commit

Permalink
WorkflowCard: use AsyncButton for Import button
Browse files Browse the repository at this point in the history
  • Loading branch information
itisAliRH committed Dec 12, 2023
1 parent 83b5624 commit e5d341b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
13 changes: 12 additions & 1 deletion client/src/components/Common/AsyncButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ interface Props {
loadingTitle?: string;
size?: "sm" | "md" | "lg";
action: () => Promise<void>;
variant?: "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark" | "link";
variant?:
| "outline-primary"
| "primary"
| "secondary"
| "success"
| "danger"
| "warning"
| "info"
| "light"
| "dark"
| "link";
}
const props = withDefaults(defineProps<Props>(), {
Expand Down
9 changes: 5 additions & 4 deletions client/src/components/Workflow/WorkflowCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { copyWorkflow, updateWorkflow } from "@/components/Workflow/workflows.se
import { Toast } from "@/composables/toast";
import { useUserStore } from "@/stores/userStore";
import AsyncButton from "@/components/Common/AsyncButton.vue";
import TextSummary from "@/components/Common/TextSummary.vue";
import StatelessTags from "@/components/TagsMultiselect/StatelessTags.vue";
import WorkflowActions from "@/components/Workflow/WorkflowActions.vue";
Expand Down Expand Up @@ -183,16 +184,16 @@ async function onTagClick(tag: string) {
Edit
</BButton>

<BButton
<AsyncButton
v-else
v-b-tooltip.hover
size="sm"
title="Import this workflow to edit"
:icon="faUpload"
variant="outline-primary"
@click="onImport">
<FontAwesomeIcon :icon="faUpload" />
:action="onImport">
Import
</BButton>
</AsyncButton>

<WorkflowRunButton :id="workflow.id" />
</div>
Expand Down

0 comments on commit e5d341b

Please sign in to comment.