Align settings page actionMenu style with other pages (#342)

* Align settings page actionMeun with other pages

Signed-off-by: Andy Lee <andy.lee@suse.com>

* update based on PR feedback

Signed-off-by: Andy Lee <andy.lee@suse.com>

---------

Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
Andy Lee 2025-06-18 15:03:57 +08:00 committed by GitHub
parent d9c97de0fd
commit 90cb147938
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,6 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import ActionMenu from '@shell/components/ActionMenuShell';
import { Banner } from '@components/Banner'; import { Banner } from '@components/Banner';
import AsyncButton from '@shell/components/AsyncButton'; import AsyncButton from '@shell/components/AsyncButton';
import { HCI_ALLOWED_SETTINGS, HCI_SETTING } from '../config/settings'; import { HCI_ALLOWED_SETTINGS, HCI_SETTING } from '../config/settings';
@ -19,6 +20,7 @@ export default {
components: { components: {
AsyncButton, AsyncButton,
Banner, Banner,
ActionMenu
}, },
props: { props: {
@ -151,15 +153,6 @@ export default {
return id ? this.$store.getters['harvester-common/getFeatureEnabled'](id) : true; return id ? this.$store.getters['harvester-common/getFeatureEnabled'](id) : true;
}, },
showActionMenu(e, setting) {
const actionElement = e.srcElement;
this.$store.commit(`action-menu/show`, {
resources: setting.data,
elem: actionElement
});
},
getSettingOption(id) { getSettingOption(id) {
return HCI_ALLOWED_SETTINGS.find((setting) => setting.id === id); return HCI_ALLOWED_SETTINGS.find((setting) => setting.id === id);
}, },
@ -238,15 +231,12 @@ export default {
:id="setting.id" :id="setting.id"
class="action" class="action"
> >
<button <ActionMenu
aria-haspopup="true" :resource="setting.data"
aria-expanded="false" :button-aria-label="t('advancedSettings.edit.label')"
type="button" data-testid="action-button"
class="btn btn-sm role-multi-action actions" button-role="tertiary"
@click="showActionMenu($event, setting)" />
>
<i class="icon icon-actions" />
</button>
</div> </div>
</div> </div>
<div value> <div value>