mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-17 05:29:44 +02:00
chore: Bug - Credentials sharing tab placeholder text misleading (#41239)
Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com> Co-authored-by: kgrhartlage <kai.hartlage@n8n.io>
This commit is contained in:
parent
baa38dbdc6
commit
1ba56b6579
|
|
@ -43,6 +43,7 @@ vi.mock('@n8n/i18n', async (importOriginal) => {
|
|||
const mockBaseText = vi.fn((key: string, options?: { interpolate?: Record<string, string> }) => {
|
||||
const translations: Record<string, string> = {
|
||||
'projects.sharing.allUsers': 'All users and projects',
|
||||
'projects.sharing.select.placeholder.project': 'Share with users or projects...',
|
||||
'credentialEdit.credentialSharing.info.owner':
|
||||
'Only users with credential sharing permission can change who this credential is shared with',
|
||||
'credentialEdit.credentialSharing.info.sharee.team': 'Shared by team project',
|
||||
|
|
@ -187,9 +188,9 @@ describe('CredentialSharing.ee', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should render ProjectSharing component when sharing is enabled', () => {
|
||||
it('should render ProjectSharing component when sharing is enabled', async () => {
|
||||
const credential = createCredential();
|
||||
const { getByTestId } = renderComponent({
|
||||
const { getByTestId, findByPlaceholderText } = renderComponent({
|
||||
props: {
|
||||
credentialId: credential.id,
|
||||
credentialData: {},
|
||||
|
|
@ -200,6 +201,7 @@ describe('CredentialSharing.ee', () => {
|
|||
});
|
||||
|
||||
expect(getByTestId('project-sharing-select')).toBeInTheDocument();
|
||||
expect(await findByPlaceholderText('Share with users or projects...')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
describe('canShareGlobally computed property', () => {
|
||||
|
|
|
|||
|
|
@ -265,12 +265,6 @@ function shareUsedInProject(projectId: string) {
|
|||
sharedWithProjects.value = [...sharedWithProjects.value, project];
|
||||
}
|
||||
|
||||
const sharingSelectPlaceholder = computed(() =>
|
||||
projectsStore.teamProjects.length
|
||||
? i18n.baseText('projects.sharing.select.placeholder.project')
|
||||
: i18n.baseText('projects.sharing.select.placeholder.user'),
|
||||
);
|
||||
|
||||
const canShareGlobally = computed(() => {
|
||||
const permissions = getResourcePermissions(usersStore.currentUser?.globalScopes);
|
||||
return permissions.credential?.shareGlobally ?? false;
|
||||
|
|
@ -344,7 +338,7 @@ function goToUpgrade() {
|
|||
? i18n.baseText('credentialEdit.credentialSharing.info.personalSpaceRestricted')
|
||||
: undefined
|
||||
"
|
||||
:placeholder="sharingSelectPlaceholder"
|
||||
:placeholder="i18n.baseText('projects.sharing.select.placeholder.project')"
|
||||
:show-suffix="true"
|
||||
:can-share-globally="canShareGlobally"
|
||||
:is-shared-globally="isSharedGlobally"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user