-
Notifications
You must be signed in to change notification settings - Fork 80
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
Added tab 'all'; Fixed bug with missing selection of current tab #33
Conversation
…ection of current tab
'default' => $structure->getKey(), | ||
'title' => $this->getTitle($type), | ||
]; | ||
} | ||
} | ||
|
||
return $types; | ||
$config['displayTabAll'] = $this->displayTabAll; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this into the initial of the var
$types = []; | ||
$config = []; | ||
|
||
$config['types'] = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this into the initial of the var
@@ -47,6 +47,7 @@ public function getConfigTreeBuilder() | |||
->end() | |||
->end() | |||
->end() | |||
->scalarNode('display_tab_all')->defaultTrue()->end() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont like this name (: but i cannot think of a better one. Have you any better suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also you could add her some informations with ->info('...')
(see http://symfony.com/doc/current/components/config/definition.html#documenting-the-option)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no better suggestion :/
Possible bundle configurations: | ||
|
||
```yml | ||
sulu_article: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you add some info (comment above) you could use bin/console config:dump-reference sulu_article
(where you get a commented version of the config-tree) to generate this section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, that means I can remove this part from the README?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no replace it with the output of this command
@@ -16,9 +16,10 @@ | |||
<tag name="sulu_admin.content_navigation" alias="article"/> | |||
<tag name="sulu.context" context="admin"/> | |||
</service> | |||
<service id="sulu_article.js_config" class="Sulu\Bundle\ArticleBundle\Admin\ArticleJsConfig"> | |||
<service id="sulu_article.js_config.types" class="Sulu\Bundle\ArticleBundle\Admin\ArticleJsConfig"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now its not only for types. remove this suffix
); | ||
|
||
if (type === this.options.type) { | ||
tabPreselect = types[type].title; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cannt we use the id here? then we wont have to introduce an own var? this should be possible with preselector: 'id', preselect: this.options.type
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are three types:
- url
- position
- name
so there is no type with id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok its not nice but ok (:
this.sandbox.emit('husky.datagrid.articles.url.update', {type: item.id}); | ||
this.sandbox.emit('sulu.router.navigate', 'articles:' + item.id + '/' + this.options.locale, false, false); | ||
var type = null; | ||
var url = 'articles'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think i would introduce a underscore template like defaults.templates.route: 'articles/<% if (!!type) { %>:<%=type%>/<% } %><%=locale%>'
which could be used here withthis.templates.route({type: this.options.type, locale: this.options.locale)
|
||
if (config.typeNames.length === 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use yoda conditions 1 === config.typeNames.length
return app.sandbox.emit('sulu.router.navigate', 'articles:' + config.typeNames[0] + '/' + getLocale()); | ||
} | ||
}); | ||
if (config.displayTabAll === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use !config.displayTabAll
} | ||
|
||
url += '/' + this.options.locale; | ||
var type = !!item.key ? item.key : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this line necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, I've removed this line
What's in this PR?
Added tab 'All' in Sulu admin (can be disabled via config).
Why?
Fixed bug with missing selection of current tab.