Skip to content

Commit

Permalink
Refine profile related user experience
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal committed Dec 10, 2021
1 parent c019e33 commit c427e97
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/settings/src/constants/AccountPropertyConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const ACCOUNT_PROPERTY_ENUM = Object.freeze({

/** Enum of account properties to human readable account property names */
export const ACCOUNT_PROPERTY_READABLE_ENUM = Object.freeze({
ADDRESS: t('settings', 'Address'),
ADDRESS: t('settings', 'Location'),
AVATAR: t('settings', 'Avatar'),
BIOGRAPHY: t('settings', 'About'),
DISPLAYNAME: t('settings', 'Full name'),
Expand Down
5 changes: 2 additions & 3 deletions core/src/views/Profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@
</ActionLink>
</Actions>
<template v-if="otherActions">
<Actions
:force-menu="true">
<Actions>
<ActionLink v-for="action in otherActions"
:key="action.id"
:class="{ 'icon-invert': colorMainBackground === '#181818' }"
Expand Down Expand Up @@ -463,7 +462,7 @@ $content-max-width: 640px;
}

&__blocks {
margin: 18px 0 80px 0;
margin: 18px 0 30vh 0;
display: grid;
gap: 16px 0;
width: $content-max-width;
Expand Down
11 changes: 10 additions & 1 deletion lib/private/Profile/Actions/WebsiteAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
use OCP\L10N\IFactory;
use OCP\Profile\ILinkAction;

use function Safe\parse_url;
use function Safe\substr;

class WebsiteAction implements ILinkAction {

/** @var string */
Expand Down Expand Up @@ -74,7 +77,13 @@ public function getDisplayId(): string {
}

public function getTitle(): string {
return $this->l10nFactory->get('lib')->t('Visit %s', [$this->value]);
// Saved websites are guaranteed to have the https/http scheme
$displayWebsite = str_starts_with($this->value, 'https://')
? substr($this->value, 8)
: (str_starts_with($this->value, 'http://')
? substr($this->value, 7)
: null);
return $this->l10nFactory->get('lib')->t('Visit %s', [$displayWebsite]);
}

public function getPriority(): int {
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Profile/ProfileManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ public function getProfileConfigWithMetadata(IUser $targetUser, ?IUser $visiting
$propertiesMetadata = [
IAccountManager::PROPERTY_ADDRESS => [
'appId' => self::CORE_APP_ID,
'displayId' => $this->l10nFactory->get('lib')->t('Address'),
'displayId' => $this->l10nFactory->get('lib')->t('Location'),
],
IAccountManager::PROPERTY_AVATAR => [
'appId' => self::CORE_APP_ID,
Expand Down

0 comments on commit c427e97

Please sign in to comment.