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

NEW Add CMS community help menu to cms-menu #615

Merged
merged 2 commits into from
Oct 5, 2018

Conversation

sachajudd
Copy link
Contributor

@sachajudd sachajudd commented Aug 24, 2018

This commit removes the "Help" menu item and adds a userhelp, docs, community and feedback help menu to the south toolbar.
When the cms-menu is closed the SS logo shows in the cms-menu header and the new help menu is removed.
Includes changes to the cms version badge and content that is displayed.
The help links are also configurable making it easy for agencies to remove or add their own.
Also addresses a fix for the mobile menu toggle functionality.
Co-authored by: Scott Hutchinson https://github.com/scott1702

Resolves: #500

To do: Update badge-info in separate PR.
Update https://userhelp.silverstripe.org/en/4/managing_your_website/overview/#help user help.

Feedback would be much appreciated 🙂

Desktop:
cms-menu-desktop

cc @clarkepaul

@maxime-rainville
Copy link
Contributor

I like the concept. Not sure about the lack of a border for that bottom help panel and the "fade-out" effect on the LeftAndMain links.

Might need to discuss what links to include in there. I wouldn't include the "developer doc" link for example, as I would expect CMS user to be the primary target of this help. Some partners might object to us advertising our self too much in the CMS.

Maybe something like "report a bug" might be nice.

I like the version tag, that probably will be helpful when talking to client to figure exactly which version they are using.

@clarkepaul
Copy link
Contributor

These links help to bring awareness of the wider community as a whole. The user help guides are fairly sparse compared to the developer docs and we found that some CMS users were referring to the tech docs as they go into the configuration of modules a bit more (people eg. POs wanted to know what discussions need to be had with devs). Its also often that there isn't any user help for modules, but there is tech docs.

I had the idea for 4 initial links but the "feedback" link might be able to double with the "Bug" idea, essentially they are trying to capture the same type of feedback.

As for the gradient, thats a minor detail we can finesse if it doesn't look quite right, its easier to make a decision by using the browser rather than through designs.

@maxime-rainville
Copy link
Contributor

Would we like to make the links configurable? That would make it easy for agencies to remove links or add their own helpdesk link. Could also allow third party module to insert doc links specific to their module.

@robbieaverill
Copy link
Contributor

Would we like to make the links configurable? That would make it easy for agencies to remove links or add their own helpdesk link. Could also allow third party module to insert doc links specific to their module.

Yep totally - CWP replaces help links with its own website, good use case

@sachajudd
Copy link
Contributor Author

sachajudd commented Aug 29, 2018

I have already done this for the help link. @clarkepaul mentioned the whole help menu could be configurable or removed also.

@sachajudd sachajudd changed the title NEW Add CMS community help menu to cms-menu WIP NEW Add CMS community help menu to cms-menu Sep 2, 2018
@sachajudd sachajudd force-pushed the pulls/1/menu-help branch 7 times, most recently from 80cecd4 to 3e92a29 Compare September 5, 2018 03:40
@sachajudd
Copy link
Contributor Author

sachajudd commented Sep 5, 2018

I've updated the UI and made the help links configurable, let me know what you think @clarkepaul @maxime-rainville @robbieaverill 🙂

@sachajudd sachajudd changed the title WIP NEW Add CMS community help menu to cms-menu NEW Add CMS community help menu to cms-menu Sep 5, 2018
@sachajudd sachajudd force-pushed the pulls/1/menu-help branch 3 times, most recently from fba0cd7 to 671d84a Compare September 6, 2018 05:51
Copy link
Contributor

@robbieaverill robbieaverill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks awesome, I'm stoked to see some time being spent on this part of the CMS and I know it'll be hugely beneficial to a lot of people!

I've left some comments, ping me if you have any questions. I'm happy to help =)

.cms-sitename__link {
color: $color-brand;
font-size: 22px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use $h1-font-size here

justify-content: flex-end;
border-top: 1px solid rgba($border-color, .5);

@media (min-width: 476px) and (max-width: 767px) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be best to use Bootstrap mixins for this, e.g. line 167 of this file:

@include media-breakpoint-down(sm) {
  // ...


@media (min-width: 476px) and (max-width: 767px) {
.cms-help {
&__link {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks BEMmy enough for it not to need to be nested under anything except the media query - thoughts?

box-shadow: inset -1px 0 0 #ced5e1;

&--show {
.cms-help__menu {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kind of goes against the point of BEM. I guess it'd be better perhaps to apply the modifiers to this element as needed so it doesn't have to be nested this deep.

display: flex;
align-items: center;
background-color: transparent;
padding: 13px 12px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any way this could be made relative to $panel-padding-x or $panel-padding-y? There's some CMS menu variables in _variables.scss that reference them already - would be great to keep it consistent if possible:

// CMS menu

$cms-menu-width: $panel-padding-y * 9;
$cms-menu-width-collapsed: $cms-panel-xs;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we were doing it relative based on $panel-padding then it would look like this:

padding: $panel-padding-y - .5385rem $panel-padding-x - 0.6155rem;

Do you think we should stick to the px values as it's cleaner?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a look at $spacer-sm, which I think equates to 12px (could also do: $panel-padding-x / 1.67). For the 13px its a pretty unique number so that the entire linkable area comes to a 52px height, might be able to use 1rem though?


foreach ($helpLinks as $key => $value) {
$formattedLinks[] = [
'Title' => $key,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This title isn't translatable at this point - it'll need to be e.g. $translationKey = str_replace(' ', '', $key) to remove spaces from the string so it can be used as an i18n key, then _t(__CLASS . '.' . $translationKey, $key); to make it translatable

@@ -1,5 +1,27 @@
<div class="cms-help__toggle">
<button class="cms-help__menu" type="button">
<span class="cms-help__logo font-icon-silverstripe"></span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use spaces for indentation. There's an editorconfig settings file in the module, it's probably worth adding an EditorConfig plugin to your IDE so this can be honoured automatically =)

</span>
<span class="cms-help__badge badge badge-info">
<% if $MinorCMSVersion %>
<span class="cms-sitename__version" title="$ApplicationName (Version - $CMSVersion)">$MinorCMSVersion</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-existing I realise, but Version - {version} should be a translatable string

@sachajudd sachajudd force-pushed the pulls/1/menu-help branch 4 times, most recently from b73534e to 3657da3 Compare September 24, 2018 04:36
*/
public function testGetHelpLinks()
{
Config::inst()->set(LeftAndMain::class, 'help_links', [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- Config::inst()->set(
+ Config::modify()->set(

$silverstripeLink = $helpLinks->first();

$this->assertEquals($silverstripeLink['Title'], 'SilverStripe');
$this->assertEquals($silverstripeLink['URL'], 'www.silverstripe.org');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please flip the arguments? The expected result should be the first argument

Copy link
Contributor

@maxime-rainville maxime-rainville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran out of things to complain about.

This commit removes the "Help" menu item and adds a userhelp, docs, community and feedback help menu to the south toolbar.
When the cms-menu is closed the SS logo shows in the cms-menu header and the new help menu is removed.
Includes changes to the cms version badge and content that is displayed.
The help links are also configurable making it easy for agencies to remove or add their own.
Also addresses a fix for the mobile menu toggle functionality.
Co-authored by: Scott Hutchinson https://github.com/scott1702
@maxime-rainville maxime-rainville dismissed robbieaverill’s stale review October 5, 2018 01:01

His feedback has been addressed.

@maxime-rainville maxime-rainville merged commit 6e66c48 into silverstripe:1 Oct 5, 2018
@clarkepaul
Copy link
Contributor

Nice :)

@sachajudd sachajudd deleted the pulls/1/menu-help branch October 5, 2018 01:06
@sachajudd
Copy link
Contributor Author

Cheers, thanks team! 😄

@robbieaverill
Copy link
Contributor

Nice work @sachajudd @scott1702!

Follow up comments:

  • Is reverse tabnabbing still a thing? If so, we should add rel=nofollow noopener into those links that have target blank (docs)
  • In CWP we change the version numbers to show the CWP recipe version (this should still work I think, since you've used the version provider API), but do we want to change "SilverStripe" to "CWP" in the new text next to the logo?
  • As above, we change the userhelp link to the CWP docs link. We'll need a follow up PR to change that in CWP

I'll raise an issue for the two CWP tasks separately once you've responded =)

@robbieaverill
Copy link
Contributor

Cool, CWP ticket logged as silverstripe/cwp-core#50

@chillu
Copy link
Member

chillu commented Oct 30, 2018

Thanks for considering accessibility on this (it's keyboard accessible). I've raised a ticket to improve the screen reader abilities: #714

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move link to userhelp, add docs links, and link to community site
5 participants