Skip to content

Commit a06fc79

Browse files
committed
Refine profile related user experience
Signed-off-by: Christopher Ng <chrng8@gmail.com>
1 parent 0fc8b55 commit a06fc79

File tree

5 files changed

+21
-8
lines changed

5 files changed

+21
-8
lines changed

apps/settings/css/settings.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,3 +1749,7 @@ doesnotexist:-o-prefocus, .strengthify-wrapper {
17491749
}
17501750
}
17511751
}
1752+
1753+
div:last-of-type {
1754+
margin-bottom: 30vh;
1755+
}

apps/settings/src/constants/AccountPropertyConstants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const ACCOUNT_PROPERTY_ENUM = Object.freeze({
4646

4747
/** Enum of account properties to human readable account property names */
4848
export const ACCOUNT_PROPERTY_READABLE_ENUM = Object.freeze({
49-
ADDRESS: t('settings', 'Address'),
49+
ADDRESS: t('settings', 'Location'),
5050
AVATAR: t('settings', 'Avatar'),
5151
BIOGRAPHY: t('settings', 'About'),
5252
DISPLAYNAME: t('settings', 'Full name'),

core/src/views/Profile.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
{{ t('core', 'Edit Profile') }}
4040
</a>
4141
</h2>
42-
<div v-if="status.icon || status.message"
42+
<button v-if="status.icon || status.message"
4343
class="profile__header__container__status-text"
4444
:class="{ interactive: isCurrentUser }"
4545
@click.prevent.stop="openStatusModal">
4646
{{ status.icon }} {{ status.message }}
47-
</div>
47+
</button>
4848
</div>
4949
</div>
5050

@@ -93,8 +93,7 @@
9393
</ActionLink>
9494
</Actions>
9595
<template v-if="otherActions">
96-
<Actions
97-
:force-menu="true">
96+
<Actions>
9897
<ActionLink v-for="action in otherActions"
9998
:key="action.id"
10099
:class="{ 'icon-invert': colorMainBackground === '#181818' }"
@@ -384,6 +383,7 @@ $content-max-width: 640px;
384383
385384
&__status-text {
386385
width: max-content;
386+
height: 44px;
387387
max-width: $content-max-width;
388388
padding: 5px 10px;
389389
margin-left: -12px;
@@ -463,7 +463,7 @@ $content-max-width: 640px;
463463
}
464464
465465
&__blocks {
466-
margin: 18px 0 80px 0;
466+
margin: 18px 0 30vh 0;
467467
display: grid;
468468
gap: 16px 0;
469469
width: $content-max-width;

lib/private/Profile/Actions/WebsiteAction.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
use OCP\L10N\IFactory;
3333
use OCP\Profile\ILinkAction;
3434

35+
use function Safe\parse_url;
36+
use function Safe\substr;
37+
3538
class WebsiteAction implements ILinkAction {
3639

3740
/** @var string */
@@ -74,7 +77,13 @@ public function getDisplayId(): string {
7477
}
7578

7679
public function getTitle(): string {
77-
return $this->l10nFactory->get('lib')->t('Visit %s', [$this->value]);
80+
// Saved websites are guaranteed to have the https/http scheme
81+
$displayWebsite = str_starts_with($this->value, 'https://')
82+
? substr($this->value, 8)
83+
: (str_starts_with($this->value, 'http://')
84+
? substr($this->value, 7)
85+
: null);
86+
return $this->l10nFactory->get('lib')->t('Visit %s', [$displayWebsite]);
7887
}
7988

8089
public function getPriority(): int {

lib/private/Profile/ProfileManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public function getProfileConfigWithMetadata(IUser $targetUser, ?IUser $visiting
396396
$propertiesMetadata = [
397397
IAccountManager::PROPERTY_ADDRESS => [
398398
'appId' => self::CORE_APP_ID,
399-
'displayId' => $this->l10nFactory->get('lib')->t('Address'),
399+
'displayId' => $this->l10nFactory->get('lib')->t('Location'),
400400
],
401401
IAccountManager::PROPERTY_AVATAR => [
402402
'appId' => self::CORE_APP_ID,

0 commit comments

Comments
 (0)