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

Replace "transfer" notion with "convert" notion #1228

Merged
merged 3 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/Notifications/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ public function prepare(INotification $notification, string $languageCode): INot
case 'guest-transfer-fail':
$params = $notification->getSubjectParameters();
$notification
->setRichSubject($l->t('Guest transfer failed'))
->setRichSubject($l->t('Guest conversion failed'))
->setRichMessage(
$l->t('Failed to transfer guest {guest} to {user}'),
$l->t('Failed to convert guest {guest} account to {user} account'),
$this->getRichMessageParams($params['source'], $params['target']),
);
return $notification;

case 'guest-transfer-done':
$params = $notification->getSubjectParameters();
$notification
->setRichSubject($l->t('Guest transfer done'))
->setRichSubject($l->t('Guest conversion done'))
->setRichMessage(
$l->t('Transfer of guest {guest} to {user} completed'),
$l->t('Conversion of guest {guest} to {user} completed'),
$this->getRichMessageParams($params['source'], $params['target']),
);
return $notification;
Expand Down
10 changes: 5 additions & 5 deletions src/components/TransferGuestDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->

<template>
<NcDialog :name="t('guests', 'Transfer guest to new account')"
<NcDialog :name="t('guests', 'Convert guest to regular account')"
:out-transition="true"
size="small"
@closing="cancel">
Expand All @@ -25,7 +25,7 @@
<NcNoteCard v-if="message"
type="info"
show-alert>
<p v-html="message" />

Check warning on line 28 in src/components/TransferGuestDialog.vue

View workflow job for this annotation

GitHub Actions / NPM lint

'v-html' directive can lead to XSS attack
</NcNoteCard>

<template #actions>
Expand All @@ -40,9 +40,9 @@
:disabled="loading || message"
native-type="submit">
<template v-if="loading" #icon>
<NcLoadingIcon :name="t('guests', 'Transferring guest…')" />
<NcLoadingIcon :name="t('guests', 'Converting guest…')" />
</template>
{{ t('guests', 'Transfer') }}
{{ t('guests', 'Convert') }}
</NcButton>
</template>
</NcDialog>
Expand All @@ -68,14 +68,14 @@

const generateMessage = ({ source, target, status }: { source: string, target: string, status: 'waiting' | 'started' }) => {
const matchStatus = {
waiting: t('guests', 'Transfer of guest {strongStart}{guest}{strongEnd} to {strongStart}{user}{strongEnd} is pending', {
waiting: t('guests', 'Conversion of guest {strongStart}{guest}{strongEnd} to {strongStart}{user}{strongEnd} is pending', {
guest: source,
user: target,
strongStart: '<strong>',
strongEnd: '</strong>',
}, undefined, { escape: false, sanitize: false }),

started: t('guests', 'Transfer of guest {strongStart}{guest}{strongEnd} to {strongStart}{user}{strongEnd} has started', {
started: t('guests', 'Conversion of guest {strongStart}{guest}{strongEnd} to {strongStart}{user}{strongEnd} has started', {
guest: source,
user: target,
strongStart: '<strong>',
Expand Down
4 changes: 2 additions & 2 deletions src/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const transferGuest = (_event: MouseEvent, user: User): void => {
if (userId === null) {
return
}
showSuccess(t('guests', 'Guest will be transferred to "{userId}" soon', { userId }))
showSuccess(t('guests', 'Guest will be converted to a regular account with the account name "{userId}" soon', { userId }))
}

spawnDialog(TransferGuestDialog, {
Expand All @@ -32,7 +32,7 @@ const enabled = (user: User) => user?.backend === 'Guests'
const registerAction = () => {
window.OCA.Settings.UserList.registerAction(
SvgAccountArrowRight,
t('guests', 'Transfer guest to full account'),
t('guests', 'Convert guest to regular account'),
transferGuest,
enabled,
)
Expand Down
Loading