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

[BITV] 9.1.1.1a/2.1 - The Nextcloud logo (link) does not have an alternative text. A suitable alternative text could be "Nextcloud - Go to dashboard." (9) #36753

Closed
11 tasks done
AndyScherzinger opened this issue Feb 16, 2023 · 4 comments
Assignees
Labels
4. to release Ready to be released and/or waiting for tests to finish accessibility enhancement
Milestone

Comments

@AndyScherzinger
Copy link
Member

AndyScherzinger commented Feb 16, 2023

2b66d051c0e7a904424fb940d9032598

  1. Original fix/approach from Add alt to the logo, adapt css for logo #35071 had to be reverted.
  2. Please discuss and align the new approach with @skjnldsv to ensure theming won't break.
Details

https://report.bitvtest.de/default-en/d63601ac-cb34-4645-8256-66bec78964a0.html#checkpoint-cd239865a5-v2-n1

@AndyScherzinger AndyScherzinger added enhancement 1. to develop Accepted and waiting to be taken care of accessibility labels Feb 16, 2023
@Pytal Pytal changed the title [BITV] 9.1.1.1a/2.1 - The Nextcloud logo (link) does not have an alternative text. A suitable alternative text could be "Nextcloud - Go to dashboard." [BITV] 9.1.1.1a/2.1 - The Nextcloud logo (link) does not have an alternative text. A suitable alternative text could be "Nextcloud - Go to dashboard." (9) Feb 22, 2023
@JuliaKirschenheuter JuliaKirschenheuter self-assigned this Feb 27, 2023
@JuliaKirschenheuter
Copy link
Contributor

@michaelnissenbaum It is actually not easy to set a detailed name for the logo-link because a link for the logo is configurable in:

/**
* Set the default app to open on login. Use the app names as they appear in the
* URL after clicking them in the Apps menu, such as documents, calendar, and
* gallery. You can use a comma-separated list of app names, so if the first
* app is not enabled for a user then Nextcloud will try the second one, and so
* on. If no enabled apps are found it defaults to the dashboard app.
*
* Defaults to ``dashboard,files``
*/
'defaultapp' => 'dashboard,files',

This means it depends on the config and on user access/rights which link is available for a current user.

For now the implementation looks like this which always says "(name of the nextcloud instance) homepage", whatever the current homepage is:

Screenshot from 2023-02-28 14-35-23

Could we move on with this solution?
Thank you!

@skjnldsv
Copy link
Member

skjnldsv commented Mar 1, 2023

The logo is irrelevant here. It should be treated as a decorative image.
What is important is the aria description of the link. You can edit this and have access to the defaultapp config with php.
Then use it to inject the proper aria attributes in the user template

<a href="<?php print_unescaped($_['logoUrl'] ?: link_to('', 'index.php')); ?>"

Where to compute and pass variables to the template:

// set logo link target
$logoUrl = $this->config->getSystemValueString('logo_url', '');
$this->assign('logoUrl', $logoUrl);

@JuliaKirschenheuter
Copy link
Contributor

JuliaKirschenheuter commented Mar 17, 2023

Hi @skjnldsv

Thank you for your suggesting. I've tried to implement it this way. But the thing is: "if the first app is not enabled for a user then Nextcloud will try the second one, and so on." I have no idea how to implement it in dynamic way. I mean: for example:

config.php: 'defaultapp' => 'mail,dashboard,files',
For user A is mail app enabled, for user B not.
How should i deal it?

And how could i check in general if an app is enabled or not?

@skjnldsv
Copy link
Member

Extract the logic from

public function linkToDefaultPageUrl(): string {
// Deny the redirect if the URL contains a @
// This prevents unvalidated redirects like ?redirect_url=:user@domain.com
if (isset($_REQUEST['redirect_url']) && strpos($_REQUEST['redirect_url'], '@') === false) {
return $this->getAbsoluteURL(urldecode($_REQUEST['redirect_url']));
}
$defaultPage = $this->config->getAppValue('core', 'defaultpage');
if ($defaultPage) {
return $this->getAbsoluteURL($defaultPage);
}
$appId = 'files';
$defaultApps = explode(',', $this->config->getSystemValue('defaultapp', 'dashboard,files'));
$userId = $this->userSession->isLoggedIn() ? $this->userSession->getUser()->getUID() : null;
if ($userId !== null) {
$userDefaultApps = explode(',', $this->config->getUserValue($userId, 'core', 'defaultapp'));
$defaultApps = array_filter(array_merge($userDefaultApps, $defaultApps));
}
// find the first app that is enabled for the current user
foreach ($defaultApps as $defaultApp) {
$defaultApp = \OC_App::cleanAppId(strip_tags($defaultApp));
if (\OC::$server->getAppManager()->isEnabledForUser($defaultApp)) {
$appId = $defaultApp;
break;
}
}
if ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true
|| getenv('front_controller_active') === 'true') {
return $this->getAbsoluteURL('/apps/' . $appId . '/');
}
return $this->getAbsoluteURL('/index.php/apps/' . $appId . '/');
}

And create a method to get the default AppId somewhere it make sense (Maybe User.php ? 🤷 )

@Pytal Pytal assigned Pytal and unassigned JuliaKirschenheuter Mar 27, 2023
@Pytal Pytal mentioned this issue Mar 28, 2023
9 tasks
@Pytal Pytal added 3. to review Waiting for reviews 4. to release Ready to be released and/or waiting for tests to finish and removed 1. to develop Accepted and waiting to be taken care of 3. to review Waiting for reviews labels Mar 28, 2023
@Pytal Pytal closed this as completed Mar 30, 2023
@AndyScherzinger AndyScherzinger added this to the Nextcloud 27 milestone May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish accessibility enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants