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 duplicated strings #3710

Merged
merged 3 commits into from
May 15, 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
121 changes: 31 additions & 90 deletions web/src/assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@
"success": "Repository enabled",
"list_reloaded": "Repository list reloaded"
},
"open_in_forge": "Open Repository in Version Control System",
"open_in_forge": "Open repository in forge",
"settings": {
"settings": "Settings",
"not_allowed": "You are not allowed to access this repository's settings",
"general": {
"general": "General",
Expand Down Expand Up @@ -131,31 +130,6 @@
"desc": "Enable to cancel pending and running pipelines of the same event and context before starting the newly triggered one."
}
},
"secrets": {
"secrets": "Secrets",
"desc": "Secrets can be passed to individual pipeline steps at runtime as environmental variables.",
"none": "There are no secrets yet.",
"add": "Add secret",
"save": "Save secret",
"show": "Show secrets",
"name": "Name",
"value": "Value",
"delete_confirm": "Do you really want to delete this secret?",
"deleted": "Secret deleted",
"created": "Secret created",
"saved": "Secret saved",
"images": {
"images": "Available for following images",
"desc": "List of images where this secret is available, leave empty to allow all images"
},
"events": {
"events": "Available at following events",
"pr_warning": "Please be careful with this option as a bad actor can submit a malicious pull request that exposes your secrets."
},
"plugins_only": "Only available for plugins",
"edit": "Edit secret",
"delete": "Delete secret"
},
"registries": {
"registries": "Registries",
"credentials": "Registry credentials",
Expand Down Expand Up @@ -298,58 +272,18 @@
},
"org": {
"settings": {
"settings": "Settings",
"not_allowed": "You are not allowed to access this organization's settings",
"secrets": {
"secrets": "Secrets",
"desc": "Organization secrets can be passed to all organization's repository individual pipeline steps at runtime as environmental variables.",
"none": "There are no organization secrets yet.",
"add": "Add secret",
"save": "Save secret",
"show": "Show secrets",
"name": "Name",
"value": "Value",
"deleted": "Organization secret deleted",
"created": "Organization secret created",
"saved": "Organization secret saved",
"images": {
"images": "Available for following images",
"desc": "List of images where this secret is available, leave empty to allow all images"
},
"plugins_only": "Only available for plugins",
"events": {
"events": "Available at following events",
"pr_warning": "Please be careful with this option as a bad actor can submit a malicious pull request that exposes your secrets."
}
"desc": "Organization secrets can be passed to all organization's repository individual pipeline steps at runtime as environmental variables."
}
}
},
"admin": {
"settings": {
"settings": "Settings",
"not_allowed": "You are not allowed to access server settings",
"secrets": {
"secrets": "Secrets",
"desc": "Global secrets can be passed to all repositories individual pipeline steps at runtime as environmental variables.",
"warning": "These secrets will be available for all server users.",
"none": "There are no global secrets yet.",
"add": "Add secret",
"save": "Save secret",
"show": "Show secrets",
"name": "Name",
"value": "Value",
"deleted": "Global secret deleted",
"created": "Global secret created",
"saved": "Global secret saved",
"images": {
"images": "Available for following images",
"desc": "List of images where this secret is available, leave empty to allow all images"
},
"plugins_only": "Only available for plugins",
"events": {
"events": "Available at following events",
"pr_warning": "Please be careful with this option as a bad actor can submit a malicious pull request that exposes your secrets."
}
"warning": "These secrets will be available for all server users."
},
"agents": {
"agents": "Agents",
Expand Down Expand Up @@ -472,26 +406,7 @@
}
},
"secrets": {
"secrets": "Secrets",
"desc": "User secrets can be passed to all user's repository individual pipeline steps at runtime as environmental variables.",
"none": "There are no user secrets yet.",
"add": "Add secret",
"save": "Save secret",
"show": "Show secrets",
"name": "Name",
"value": "Value",
"deleted": "User secret deleted",
"created": "User secret created",
"saved": "User secret saved",
"images": {
"images": "Available for following images",
"desc": "List of images where this secret is available, leave empty to allow all images"
},
"plugins_only": "Only available for plugins",
"events": {
"events": "Available at following events",
"pr_warning": "Please be careful with this option as a bad actor can submit a malicious pull request that exposes your secrets."
}
"desc": "User secrets can be passed to all user's repository individual pipeline steps at runtime as environmental variables."
},
"cli_and_api": {
"cli_and_api": "CLI & API",
Expand All @@ -508,6 +423,31 @@
"internal_error": "Some internal error occurred",
"access_denied": "You are not allowed to login"
},
"secrets": {
"secrets": "Secrets",
"desc": "Secrets can be passed to individual pipeline steps at runtime as environmental variables.",
"none": "There are no secrets yet.",
"add": "Add secret",
"save": "Save secret",
"show": "Show secrets",
"name": "Name",
"value": "Value",
"delete_confirm": "Do you really want to delete this secret?",
"deleted": "Secret deleted",
"created": "Secret created",
"saved": "Secret saved",
"images": {
"images": "Available for following images",
"desc": "List of images where this secret is available, leave empty to allow all images"
},
"events": {
"events": "Available at following events",
"pr_warning": "Please be careful with this option as a bad actor can submit a malicious pull request that exposes your secrets."
},
"plugins_only": "Only available for plugins",
"edit": "Edit secret",
"delete": "Delete secret"
},
"default": "default",
"info": "Info",
"running_version": "You are running Woodpecker {0}",
Expand All @@ -520,5 +460,6 @@
"cli_login_success": "Login to CLI successful",
"cli_login_failed": "Login to CLI failed",
"cli_login_denied": "Login to CLI denied",
"return_to_cli": "You can now close this tab and return to the CLI."
"return_to_cli": "You can now close this tab and return to the CLI.",
"settings": "Settings"
}
17 changes: 5 additions & 12 deletions web/src/components/admin/settings/AdminSecretsTab.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
<template>
<Settings
:title="$t('admin.settings.secrets.secrets')"
:title="$t('secrets.secrets')"
:desc="$t('admin.settings.secrets.desc')"
docs-url="docs/usage/secrets"
:warning="$t('admin.settings.secrets.warning')"
>
<template #titleActions>
<Button
v-if="selectedSecret"
:text="$t('admin.settings.secrets.show')"
start-icon="back"
@click="selectedSecret = undefined"
/>
<Button v-else :text="$t('admin.settings.secrets.add')" start-icon="plus" @click="showAddSecret" />
<Button v-if="selectedSecret" :text="$t('secrets.show')" start-icon="back" @click="selectedSecret = undefined" />
<Button v-else :text="$t('secrets.add')" start-icon="plus" @click="showAddSecret" />
</template>

<SecretList
v-if="!selectedSecret"
v-model="secrets"
i18n-prefix="admin.settings.secrets."
:is-deleting="isDeleting"
@edit="editSecret"
@delete="deleteSecret"
Expand All @@ -27,7 +21,6 @@
<SecretEdit
v-else
v-model="selectedSecret"
i18n-prefix="admin.settings.secrets."
:is-saving="isSaving"
@save="createSecret"
@cancel="selectedSecret = undefined"
Expand Down Expand Up @@ -81,7 +74,7 @@ const { doSubmit: createSecret, isLoading: isSaving } = useAsyncAction(async ()
await apiClient.createGlobalSecret(selectedSecret.value);
}
notifications.notify({
title: i18n.t(isEditingSecret.value ? 'admin.settings.secrets.saved' : 'admin.settings.secrets.created'),
title: i18n.t(isEditingSecret.value ? 'secrets.saved' : 'secrets.created'),
type: 'success',
});
selectedSecret.value = undefined;
Expand All @@ -90,7 +83,7 @@ const { doSubmit: createSecret, isLoading: isSaving } = useAsyncAction(async ()

const { doSubmit: deleteSecret, isLoading: isDeleting } = useAsyncAction(async (_secret: Secret) => {
await apiClient.deleteGlobalSecret(_secret.name);
notifications.notify({ title: i18n.t('admin.settings.secrets.deleted'), type: 'success' });
notifications.notify({ title: i18n.t('secrets.deleted'), type: 'success' });
resetPage();
});

Expand Down
7 changes: 1 addition & 6 deletions web/src/components/layout/header/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@
</div>
<div class="flex ml-auto -m-1.5 items-center space-x-2">
<div v-if="user?.admin" class="relative">
<IconButton
class="navbar-icon"
:title="$t('admin.settings.settings')"
:to="{ name: 'admin-settings' }"
icon="settings"
/>
<IconButton class="navbar-icon" :title="$t('settings')" :to="{ name: 'admin-settings' }" icon="settings" />
<div
v-if="version?.needsUpdate"
class="absolute top-2 right-2 bg-int-wp-state-error-100 rounded-full w-3 h-3"
Expand Down
21 changes: 5 additions & 16 deletions web/src/components/org/settings/OrgSecretsTab.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
<template>
<Settings
:title="$t('org.settings.secrets.secrets')"
:desc="$t('org.settings.secrets.desc')"
docs-url="docs/usage/secrets"
>
<Settings :title="$t('secrets.secrets')" :desc="$t('org.settings.secrets.desc')" docs-url="docs/usage/secrets">
<template #titleActions>
<Button
v-if="selectedSecret"
:text="$t('org.settings.secrets.show')"
start-icon="back"
@click="selectedSecret = undefined"
/>
<Button v-else :text="$t('org.settings.secrets.add')" start-icon="plus" @click="showAddSecret" />
<Button v-if="selectedSecret" :text="$t('secrets.show')" start-icon="back" @click="selectedSecret = undefined" />
<Button v-else :text="$t('secrets.add')" start-icon="plus" @click="showAddSecret" />
</template>

<SecretList
v-if="!selectedSecret"
v-model="secrets"
i18n-prefix="org.settings.secrets."
:is-deleting="isDeleting"
@edit="editSecret"
@delete="deleteSecret"
Expand All @@ -26,7 +16,6 @@
<SecretEdit
v-else
v-model="selectedSecret"
i18n-prefix="org.settings.secrets."
:is-saving="isSaving"
@save="createSecret"
@cancel="selectedSecret = undefined"
Expand Down Expand Up @@ -89,7 +78,7 @@ const { doSubmit: createSecret, isLoading: isSaving } = useAsyncAction(async ()
await apiClient.createOrgSecret(org.value.id, selectedSecret.value);
}
notifications.notify({
title: i18n.t(isEditingSecret.value ? 'org.settings.secrets.saved' : 'org.settings.secrets.created'),
title: i18n.t(isEditingSecret.value ? 'secrets.saved' : 'secrets.created'),
type: 'success',
});
selectedSecret.value = undefined;
Expand All @@ -102,7 +91,7 @@ const { doSubmit: deleteSecret, isLoading: isDeleting } = useAsyncAction(async (
}

await apiClient.deleteOrgSecret(org.value.id, _secret.name);
notifications.notify({ title: i18n.t('org.settings.secrets.deleted'), type: 'success' });
notifications.notify({ title: i18n.t('secrets.deleted'), type: 'success' });
resetPage();
});

Expand Down
21 changes: 5 additions & 16 deletions web/src/components/repo/settings/SecretsTab.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
<template>
<Settings
:title="$t('repo.settings.secrets.secrets')"
:desc="$t('repo.settings.secrets.desc')"
docs-url="docs/usage/secrets"
>
<Settings :title="$t('secrets.secrets')" :desc="$t('secrets.desc')" docs-url="docs/usage/secrets">
<template #titleActions>
<Button
v-if="selectedSecret"
:text="$t('repo.settings.secrets.show')"
start-icon="back"
@click="selectedSecret = undefined"
/>
<Button v-else :text="$t('repo.settings.secrets.add')" start-icon="plus" @click="showAddSecret" />
<Button v-if="selectedSecret" :text="$t('secrets.show')" start-icon="back" @click="selectedSecret = undefined" />
<Button v-else :text="$t('secrets.add')" start-icon="plus" @click="showAddSecret" />
</template>

<SecretList
v-if="!selectedSecret"
:model-value="secrets"
i18n-prefix="repo.settings.secrets."
:is-deleting="isDeleting"
@edit="editSecret"
@delete="deleteSecret"
Expand All @@ -26,7 +16,6 @@
<SecretEdit
v-else
v-model="selectedSecret"
i18n-prefix="repo.settings.secrets."
:is-saving="isSaving"
@save="createSecret"
@cancel="selectedSecret = undefined"
Expand Down Expand Up @@ -129,7 +118,7 @@ const { doSubmit: createSecret, isLoading: isSaving } = useAsyncAction(async ()
await apiClient.createSecret(repo.value.id, selectedSecret.value);
}
notifications.notify({
title: i18n.t(isEditingSecret.value ? 'repo.settings.secrets.saved' : 'repo.settings.secrets.created'),
title: i18n.t(isEditingSecret.value ? 'secrets.saved' : 'secrets.created'),
type: 'success',
});
selectedSecret.value = undefined;
Expand All @@ -142,7 +131,7 @@ const { doSubmit: deleteSecret, isLoading: isDeleting } = useAsyncAction(async (
}

await apiClient.deleteSecret(repo.value.id, _secret.name);
notifications.notify({ title: i18n.t('repo.settings.secrets.deleted'), type: 'success' });
notifications.notify({ title: i18n.t('secrets.deleted'), type: 'success' });
await resetPage();
});

Expand Down
Loading