fix(editor): UX Improvements to RBAC feature set (#9683)

This commit is contained in:
Csaba Tuncsik
2024-07-18 14:17:27 +02:00
committed by GitHub
parent 5b440a7679
commit 028a8a2c75
32 changed files with 337 additions and 112 deletions

View File

@@ -15,6 +15,7 @@
<script lang="ts" setup>
import { computed } from 'vue';
import Avatar from 'vue-boring-avatars';
import { getInitials } from '../../utils/labelUtil';
interface AvatarProps {
firstName: string;
@@ -37,11 +38,7 @@ const props = withDefaults(defineProps<AvatarProps>(), {
],
});
const initials = computed(
() =>
(props.firstName ? props.firstName.charAt(0) : '') +
(props.lastName ? props.lastName.charAt(0) : ''),
);
const initials = computed(() => getInitials(`${props.firstName} ${props.lastName}`));
const getColors = (colors: string[]): string[] => {
const style = getComputedStyle(document.body);

View File

@@ -97,7 +97,7 @@ import N8nIcon from '../N8nIcon';
import ConditionalRouterLink from '../ConditionalRouterLink';
import type { IMenuItem } from '../../types';
import { doesMenuItemMatchCurrentRoute } from './routerUtil';
import { getInitials } from './labelUtil';
import { getInitials } from '../../utils/labelUtil';
interface MenuItemProps {
item: IMenuItem;

View File

@@ -1,4 +1,4 @@
import { getInitials } from '../labelUtil';
import { getInitials } from './labelUtil';
describe('labelUtil.getInitials', () => {
it.each([