Skip to content

Commit

Permalink
Rename settings -> simplesettings
Browse files Browse the repository at this point in the history
In URLs and translation namespaces
  • Loading branch information
tholewebgods committed Jul 5, 2024
1 parent 5e03e26 commit 2c5dee9
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 49 deletions.
42 changes: 21 additions & 21 deletions src/components/AuthToken.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@
@submit.prevent.stop="rename">
<NcTextField ref="input"
:value.sync="newName"
:label="t('settings', 'Device name')"
:label="t('simplesettings', 'Device name')"
:show-trailing-button="true"
:trailing-button-label="t('settings', 'Cancel renaming')"
:trailing-button-label="t('simplesettings', 'Cancel renaming')"
@trailing-button-click="cancelRename"
@keyup.esc="cancelRename" />
<NcButton :aria-label="t('settings', 'Save new name')" type="tertiary" native-type="submit">
<NcButton :aria-label="t('simplesettings', 'Save new name')" type="tertiary" native-type="submit">
<template #icon>
<NcIconSvgWrapper :path="mdiCheck" />
</template>
</NcButton>
</form>
<span v-else>{{ tokenLabel }}</span>
<span v-if="wiping" class="wiping-warning">({{ t('settings', 'Marked for remote wipe') }})</span>
<span v-if="wiping" class="wiping-warning">({{ t('simplesettings', 'Marked for remote wipe') }})</span>
</div>
</td>
<td>
Expand All @@ -52,20 +52,20 @@
</td>
<td class="auth-token__actions">
<NcActions v-if="!token.current"
:title="t('settings', 'Device settings')"
:aria-label="t('settings', 'Device settings')"
:title="t('simplesettings', 'Device settings')"
:aria-label="t('simplesettings', 'Device settings')"
:open.sync="actionOpen">
<NcActionCheckbox v-if="canChangeScope"
:checked="token.scope.filesystem"
@update:checked="updateFileSystemScope">
<!-- TODO: add text/longtext with some description -->
{{ t('settings', 'Allow filesystem access') }}
{{ t('simplesettings', 'Allow filesystem access') }}
</NcActionCheckbox>
<NcActionButton v-if="token.canRename"
icon="icon-rename"
@click.stop.prevent="startRename">
<!-- TODO: add text/longtext with some description -->
{{ t('settings', 'Rename') }}
{{ t('simplesettings', 'Rename') }}
</NcActionButton>

<!-- revoke & wipe -->
Expand All @@ -74,18 +74,18 @@
<NcActionButton icon="icon-delete"
@click.stop.prevent="revoke">
<!-- TODO: add text/longtext with some description -->
{{ t('settings', 'Revoke') }}
{{ t('simplesettings', 'Revoke') }}
</NcActionButton>
<NcActionButton icon="icon-delete"
@click.stop.prevent="wipe">
{{ t('settings', 'Wipe device') }}
{{ t('simplesettings', 'Wipe device') }}
</NcActionButton>
</template>
<NcActionButton v-else-if="token.type === 2"
icon="icon-delete"
:name="t('settings', 'Revoke')"
:name="t('simplesettings', 'Revoke')"
@click.stop.prevent="revoke">
{{ t('settings', 'Revoking this token might prevent the wiping of your device if it has not started the wipe yet.') }}
{{ t('simplesettings', 'Revoking this token might prevent the wiping of your device if it has not started the wipe yet.') }}
</NcActionButton>
</template>
</NcActions>
Expand Down Expand Up @@ -143,14 +143,14 @@ const nameMap = {
firefox: 'Firefox',
chrome: 'Google Chrome',
safari: 'Safari',
androidChrome: t('settings', 'Google Chrome for Android'),
androidChrome: t('simplesettings', 'Google Chrome for Android'),
iphone: 'iPhone',
ipad: 'iPad',
iosClient: t('settings', '{productName} iOS app', { productName: window.oc_defaults.productName }),
androidClient: t('settings', '{productName} Android app', { productName: window.oc_defaults.productName }),
iosTalkClient: t('settings', '{productName} Talk for iOS', { productName: window.oc_defaults.productName }),
androidTalkClient: t('settings', '{productName} Talk for Android', { productName: window.oc_defaults.productName }),
syncClient: t('settings', 'Sync client'),
iosClient: t('simplesettings', '{productName} iOS app', { productName: window.oc_defaults.productName }),
androidClient: t('simplesettings', '{productName} Android app', { productName: window.oc_defaults.productName }),
iosTalkClient: t('simplesettings', '{productName} Talk for iOS', { productName: window.oc_defaults.productName }),
androidTalkClient: t('simplesettings', '{productName} Talk for Android', { productName: window.oc_defaults.productName }),
syncClient: t('simplesettings', 'Sync client'),
davx5: 'DAVx5',
webPirate: 'WebPirate',
sailfishBrowser: 'SailfishBrowser',
Expand Down Expand Up @@ -275,17 +275,17 @@ export default defineComponent({
*/
tokenLabel() {
if (this.token.current) {
return t('settings', 'This session')
return t('simplesettings', 'This session')
}
if (this.client === null) {
return this.token.name
}

const name = nameMap[this.client.id]
if (this.client.os) {
return t('settings', '{client} - {version} ({system})', { client: name, system: this.client.os, version: this.client.version })
return t('simplesettings', '{client} - {version} ({system})', { client: name, system: this.client.os, version: this.client.version })
} else if (this.client.version) {
return t('settings', '{client} - {version}', { client: name, version: this.client.version })
return t('simplesettings', '{client} - {version}', { client: name, version: this.client.version })
}
return name
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/AuthTokenList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
<thead>
<tr>
<th class="token-list__header-device">
{{ t('settings', 'Device') }}
{{ t('simplesettings', 'Device') }}
</th>
<th class="toke-list__header-activity">
{{ t('settings', 'Last activity') }}
{{ t('simplesettings', 'Last activity') }}
</th>
<th>
<span class="hidden-visually">
{{ t('settings', 'Actions') }}
{{ t('simplesettings', 'Actions') }}
</span>
</th>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions src/components/AuthTokenSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

<template>
<div id="security" class="section">
<h2>{{ t('settings', 'Devices & sessions', {}, undefined, {sanitize: false}) }}</h2>
<h2>{{ t('simplesettings', 'Devices & sessions', {}, undefined, {sanitize: false}) }}</h2>
<p class="settings-hint hidden-when-empty">
{{ t('settings', 'Web, desktop and mobile clients currently logged in to your account.') }}
{{ t('simplesettings', 'Web, desktop and mobile clients currently logged in to your account.') }}
</p>
<AuthTokenList />
<AuthTokenSetup v-if="canCreateToken" />
Expand Down
8 changes: 4 additions & 4 deletions src/components/AuthTokenSetup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
:maxlength="120"
:disabled="loading"
class="app-name-text-field"
:label="t('settings', 'App name')"
:placeholder="t('settings', 'App name')" />
:label="t('simplesettings', 'App name')"
:placeholder="t('simplesettings', 'App name')" />
<NcButton type="primary"
:disabled="loading || deviceName.length === 0"
native-type="submit">
{{ t('settings', 'Create new app password') }}
{{ t('simplesettings', 'Create new app password') }}
</NcButton>

<AuthTokenSetupDialog :token="newToken" @close="newToken = null" />
Expand Down Expand Up @@ -85,7 +85,7 @@ export default defineComponent({
this.newToken = await this.authTokenStore.addToken(this.deviceName)
} catch (error) {
logger.error(error as Error)
showError(t('settings', 'Error while creating device token'))
showError(t('simplesettings', 'Error while creating device token'))
this.reset()
} finally {
this.loading = false
Expand Down
22 changes: 11 additions & 11 deletions src/components/AuthTokenSetupDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
-->
<template>
<NcDialog :open.sync="open"
:name="t('settings', 'New app password')"
:name="t('simplesettings', 'New app password')"
content-classes="token-dialog">
<p>
{{ t('settings', 'Use the credentials below to configure your app or device. For security reasons this password will only be shown once.') }}
{{ t('simplesettings', 'Use the credentials below to configure your app or device. For security reasons this password will only be shown once.') }}
</p>
<div class="token-dialog__name">
<NcTextField :label="t('settings', 'Login')" :value="loginName" readonly />
<NcTextField :label="t('simplesettings', 'Login')" :value="loginName" readonly />
<NcButton type="tertiary"
:title="copyLoginNameLabel"
:aria-label="copyLoginNameLabel"
Expand All @@ -39,7 +39,7 @@
</div>
<div class="token-dialog__password">
<NcTextField ref="appPassword"
:label="t('settings', 'Password')"
:label="t('simplesettings', 'Password')"
:value="appPassword"
readonly />
<NcButton type="tertiary"
Expand All @@ -53,7 +53,7 @@
</div>
<div class="token-dialog__qrcode">
<NcButton v-if="!showQRCode" @click="showQRCode = true">
{{ t('settings', 'Show QR code for mobile apps') }}
{{ t('simplesettings', 'Show QR code for mobile apps') }}
</NcButton>
<QR v-else :value="qrUrl" />
</div>
Expand Down Expand Up @@ -129,15 +129,15 @@ export default defineComponent({
},
copyPasswordLabel() {
if (this.isPasswordCopied) {
return t('settings', 'App password copied!')
return t('simplesettings', 'App password copied!')
}
return t('settings', 'Copy app password')
return t('simplesettings', 'Copy app password')
},
copyLoginNameLabel() {
if (this.isNameCopied) {
return t('settings', 'Login name copied!')
return t('simplesettings', 'Login name copied!')
}
return t('settings', 'Copy login name')
return t('simplesettings', 'Copy login name')
},
},
watch: {
Expand All @@ -162,7 +162,7 @@ export default defineComponent({
} catch (e) {
this.isPasswordCopied = false
logger.error(e as Error)
showError(t('settings', 'Could not copy app password. Please copy it manually.'))
showError(t('simplesettings', 'Could not copy app password. Please copy it manually.'))
} finally {
setTimeout(() => {
this.isPasswordCopied = false
Expand All @@ -176,7 +176,7 @@ export default defineComponent({
} catch (e) {
this.isNameCopied = false
logger.error(e as Error)
showError(t('settings', 'Could not copy login name. Please copy it manually.'))
showError(t('simplesettings', 'Could not copy login name. Please copy it manually.'))
} finally {
setTimeout(() => {
this.isNameCopied = false
Expand Down
2 changes: 1 addition & 1 deletion src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
import { getLoggerBuilder } from '@nextcloud/logger'

export default getLoggerBuilder()
.setApp('settings')
.setApp('simplesettings')
.detectUser()
.build()
14 changes: 7 additions & 7 deletions src/store/authtoken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ import { defineStore } from 'pinia'
import axios from '@nextcloud/axios'
import logger from '../logger'

const BASE_URL = generateUrl('/settings/personal/authtokens')
const BASE_URL = generateUrl('/simplesettings/authtokens')

const confirm = () => {
return new Promise(resolve => {
window.OC.dialogs.confirm(
t('settings', 'Do you really want to wipe your data from this device?'),
t('settings', 'Confirm wipe'),
t('simplesettings', 'Do you really want to wipe your data from this device?'),
t('simplesettings', 'Confirm wipe'),
resolve,
true,
)
Expand Down Expand Up @@ -127,7 +127,7 @@ export const useAuthTokenStore = defineStore('auth-token', {
return true
} catch (error) {
logger.error('Could not delete app token', { error })
showError(t('settings', 'Could not delete the app token'))
showError(t('simplesettings', 'Could not delete the app token'))
// Restore
this.tokens.push(token)
}
Expand Down Expand Up @@ -157,7 +157,7 @@ export const useAuthTokenStore = defineStore('auth-token', {
return true
} catch (error) {
logger.error('Could not wipe app token', { error })
showError(t('settings', 'Error while wiping the device with the token'))
showError(t('simplesettings', 'Error while wiping the device with the token'))
}
return false
},
Expand All @@ -179,7 +179,7 @@ export const useAuthTokenStore = defineStore('auth-token', {
return true
} catch (error) {
logger.error('Could not update app token name', { error })
showError(t('settings', 'Error while updating device token name'))
showError(t('simplesettings', 'Error while updating device token name'))
// Restore
token.name = oldName
}
Expand All @@ -204,7 +204,7 @@ export const useAuthTokenStore = defineStore('auth-token', {
return true
} catch (error) {
logger.error('could not update app token scope', { error })
showError(t('settings', 'Error while updating device token scope'))
showError(t('simplesettings', 'Error while updating device token scope'))
// Restore
token.scope[scope] = oldVal
}
Expand Down

0 comments on commit 2c5dee9

Please sign in to comment.