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:
n8n-cat-bot[bot] 2026-10-16 07:47:39 +00:00 committed by GitHub
parent baa38dbdc6
commit 1ba56b6579
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 9 deletions

View File

@ -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', () => {

View File

@ -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"