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

Feature/actions #1712

Merged
merged 16 commits into from
Aug 29, 2023
Merged

Feature/actions #1712

merged 16 commits into from
Aug 29, 2023

Conversation

szczygiel-m
Copy link
Contributor

@szczygiel-m szczygiel-m commented Aug 24, 2023

Added actions for:

  • Delete topic
  • Delete subscription
  • DC Readiness switch
  • Delete topic in consistency view
  • Delete group
  • Suspend/activate subscription

# Conflicts:
#	hermes-console-vue/src/api/hermes-client/index.ts
#	hermes-console-vue/src/views/topic/TopicView.vue
#	hermes-console-vue/src/views/topic/topic-header/TopicHeader.vue
@szczygiel-m szczygiel-m marked this pull request as ready for review August 29, 2023 09:38
const isDialogOpened = ref(isOpenedByDefault);
const actionButtonEnabled = ref(actionButtonEnabledByDefault);

async function openDialog() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why are all these functions async? They are not doing any asynchronous work and we are not awaiting them when they are used. I suggest we make them sync

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

import { dummyRoles } from '@/dummy/roles';
import { dummyTopic, dummyTopicOwner } from '@/dummy/topic';
import { render } from '@/utils/test-utils';
import { Role } from '@/api/role';
import TopicHeader from '@/views/topic/topic-header/TopicHeader.vue';

describe('TopicHeader', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

minor: perhaps we should test whether remove event is emitted on button click


const {
isDialogOpened: isRemoveDialogOpened,
actionButtonEnabled: actionRemoveButtonEnabled,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
actionButtonEnabled: actionRemoveButtonEnabled,
actionButtonEnabled: removeActionButtonEnabled,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -13,6 +13,8 @@
(topic) => !props.filter || topic.includes(props.filter),
);
});

defineEmits(['remove']);
Copy link
Collaborator

Choose a reason for hiding this comment

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

consider using typed emits to make argument types clear: https://vuejs.org/guide/typescript/composition-api.html#typing-component-emits

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -28,4 +28,5 @@ export const useNotificationsStore = defineStore('notifications', {
);
},
},
persist: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍🏻

@@ -68,11 +68,14 @@ export function useSearch(): UseSearch {
};
}

const patternPrefix = '(?i).*';
const patternSuffix = '.*';
Copy link
Collaborator

Choose a reason for hiding this comment

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

can be confusing that user types in regex but his regex is only in the middle of our regex. But I agree that this will make life easier for average user

@@ -50,4 +66,44 @@ describe('useInconsistentTopics', () => {
expect(error.value.fetchInconsistentTopics).not.toBeNull();
});
});

it('should show message that removing subscription was successful', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
it('should show message that removing subscription was successful', async () => {
it('should show message that removing inconsistentTopic was successful', async () => {

@@ -1,4 +1,5 @@
import { beforeEach } from 'vitest';
import { dummyOwner } from '@/dummy/topic';
import { dummySubscription } from '@/dummy/subscription';
import { expect } from 'vitest';
import { render } from '@/utils/test-utils';
Copy link
Collaborator

Choose a reason for hiding this comment

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

minor: we can consider adding tests for checking whether events were emitted on btn clicks

});
});

it('should show message that removing subscription was unsuccessful', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
it('should show message that removing subscription was unsuccessful', async () => {
it('should show message that removing topic was unsuccessful', async () => {

).toBeDisabled();
});

it('should require confirmation text', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice

@szczygiel-m szczygiel-m merged commit efc6bd2 into hermes_console_vue Aug 29, 2023
@szczygiel-m szczygiel-m deleted the feature/actions branch August 29, 2023 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants