1
0
espelhamento de https://github.com/nextcloud/server.git sincronizado 2024-08-28 17:55:03 +02:00

Merge pull request #14666 from nextcloud/design/settings-header

Don't show 'Personal' header in settings when Admin section is not there
Esse commit está contido em:
Morris Jobke 2019-03-18 14:48:36 +01:00 commit de GitHub
commit 4824d278f9
Nenhuma chave conhecida encontrada para esta assinatura no banco de dados
ID da chave GPG: 4AEE18F83AFDEB23
3 arquivos alterados com 23 adições e 2 exclusões

Ver arquivo

@ -30,8 +30,10 @@ script('files', 'jquery.fileupload');
<div id="app-navigation">
<ul>
<li class="app-navigation-caption"><?php p($l->t('Personal')); ?></li>
<?php if(!empty($_['forms']['admin'])) { ?>
<li class="app-navigation-caption"><?php p($l->t('Personal')); ?></li>
<?php
}
foreach($_['forms']['personal'] as $form) {
if (isset($form['anchor'])) {
$anchor = \OC::$server->getURLGenerator()->linkToRoute('settings.PersonalSettings.index', ['section' => $form['anchor']]);

Ver arquivo

@ -12,7 +12,8 @@ Feature: access-levels
Scenario: regular users cannot see admin-level items on the Settings page
Given I am logged in
When I visit the settings page
Then I see that the "Personal" settings panel is shown
Then I see that the "Personal info" entry in the settings panel is shown
And I see that the "Personal" settings panel is not shown
And I see that the "Administration" settings panel is not shown
Scenario: admin users can see admin-level items on the Settings page

Ver arquivo

@ -93,6 +93,15 @@ class SettingsMenuContext implements Context, ActorAwareInterface {
describedAs($itemText . " item in Settings panel");
}
/**
* @param string $itemText
* @return Locator
*/
private static function settingsPanelEntryFor($itemText) {
return Locator::forThe()->xpath("//div[@id = 'app-navigation']//ul//li[normalize-space() = '$itemText']")->
describedAs($itemText . " entry in Settings panel");
}
/**
* @return array
*/
@ -188,6 +197,15 @@ class SettingsMenuContext implements Context, ActorAwareInterface {
);
}
/**
* @Then I see that the :itemText entry in the settings panel is shown
*/
public function iSeeThatTheItemEntryInTheSettingsPanelIsShown($itemText) {
PHPUnit_Framework_Assert::assertTrue(
$this->actor->find(self::settingsPanelEntryFor($itemText), 10)->isVisible()
);
}
/**
* @Then I see that the :itemText settings panel is not shown
*/