Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add enable and export actions to list items #1583

Merged
merged 1 commit into from
Dec 19, 2023

Conversation

EmmyMay
Copy link
Contributor

@EmmyMay EmmyMay commented Dec 6, 2023

The following changes are implemented

TODO: Summary

Changes in the user interface:

TODO: Add screenshots, recordings or remove this section

Checklist when submitting a final (!draft) PR

  • Commits are tidied up, squashed if needed and follow guidelines in CONTRIBUTING.md
  • Code builds
  • All existing tests pass
  • All new critical code is covered by tests
  • PR is linked to the relevant issue(s)
  • Rebased with the target branch

closes #1419

@EmmyMay EmmyMay self-assigned this Dec 6, 2023
@EmmyMay EmmyMay requested a review from Fajfa December 6, 2023 11:37

size: {
type: String,
default: 'lg',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to keep it consistent, i would like you to have the default as 'md', and add lg to the one that needs it.

@@ -319,7 +319,7 @@

<export
data-test-id="button-export-workflow"
:workflows="[workflow.workflowID]"
:workflows="([workflow.workflowID])"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we need the ( )
Guessing linter flagged it, but its your rule not the eslint configurations.

variant="light"
>
<font-awesome-icon
class="text-primary"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for text primary

@@ -164,6 +164,41 @@
/>
</b-dropdown-item>

<b-dropdown-item
variant="light"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove variant light since it doesn't achieve anything

>
<font-awesome-icon
:class="statusClass(w)"
:icon="['fas', 'power-off']"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you try giving toggle-on/off icon a shot

:icon="['fas', 'power-off']"
/>

<b-button
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you dont need to add a b-button since the b-dropdown-item is a button itself

const { workflowID } = w
this.$AutomationAPI.workflowRead({ workflowID })
.then(({ workflowID, enabled }) => {
this.$AutomationAPI.workflowUpdate({ ...w, workflowID, enabled: !enabled })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think you misunderstood me here. The reason you fetch it is so you have the latest version and you only toggle the enabled.

.then((w) => {
this.toastSuccess(this.$t('notification:update.success'))
this.filterList()
this.statusText(w)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you call this.statusText() and this.statusClass here?

this.statusText(w)
this.statusClass(w)
})
.catch(this.toastErrorHandler(this.$t('notification:update.failed')))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You dont need two catches if you chain requests properly.

.then(({ workflowID, enabled }) => {
this.$AutomationAPI.workflowUpdate({ ...w, workflowID, enabled: !enabled })
.then((w) => {
this.toastSuccess(this.$t('notification:update.success'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dedicated notification for this please

<font-awesome-icon
class="text-primary"
:icon="['fas', 'file-export']"
/>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The export button is still a link so it appears blue. Please add text-dark, same as is for permissions button

@Fajfa Fajfa force-pushed the 2023.9.x-feature-shortcut-wf-actions branch from 61a456c to 5b5b82f Compare December 19, 2023 12:42
@Fajfa Fajfa merged commit 5b5b82f into 2023.9.x Dec 19, 2023
1 check passed
@Fajfa Fajfa deleted the 2023.9.x-feature-shortcut-wf-actions branch December 19, 2023 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more actions to Workflow List
2 participants