Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into RGTC-1875
Browse files Browse the repository at this point in the history
  • Loading branch information
anpolimus authored Feb 2, 2022
2 parents 8c46b2d + ade4733 commit 7191cee
Show file tree
Hide file tree
Showing 27 changed files with 698 additions and 144 deletions.
32 changes: 20 additions & 12 deletions assets/js/openy_rose.behaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,34 @@
*/
Drupal.behaviors.OpenyRoseAffixClassForPrimaryMenu = {
attach: function (context, settings) {
var originalAddClassMethod = jQuery.fn.addClass;
var originalRemoveClassMethod = jQuery.fn.removeClass;
let originalAddClassMethod = jQuery.fn.addClass;
let originalRemoveClassMethod = jQuery.fn.removeClass;
let trackClassChange = $(".top-navs", context).attr('class')

jQuery.fn.addClass = function () {
var result = originalAddClassMethod.apply(this, arguments);
jQuery(this).trigger('classChanged');
let result = originalAddClassMethod.apply(this, arguments);
jQuery(this, context).trigger('classChanged');
return result;
}
jQuery.fn.removeClass = function () {
var result = originalRemoveClassMethod.apply(this, arguments);
jQuery(this).trigger('classChanged');
let result = originalRemoveClassMethod.apply(this, arguments);
jQuery(this, context).trigger('classChanged');
return result;
}

$(".top-navs.hidden-xs").on(
$(".top-navs", context).on(
"classChanged", function () {
if ($('.top-navs.hidden-xs').hasClass('affix')
&& !$('body').hasClass('primary-menu-minimize')) {
$('body').addClass('primary-menu-minimize');
} else if ($('body').hasClass('primary-menu-minimize')) {
$('body').removeClass('primary-menu-minimize');
let newClasses = $(this, context).attr('class')

// Process only if classes are different. Reduce a number of processing for admin user.
if (newClasses !== trackClassChange) {
if ($('.top-navs', context).hasClass('affix')
&& !$('body', context).hasClass('primary-menu-minimize')) {
$('body', context).addClass('primary-menu-minimize');
} else if ($('body', context).hasClass('primary-menu-minimize')) {
$('body', context).removeClass('primary-menu-minimize');
}
trackClassChange = newClasses;
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion js/gated-content/dist/gated-content.css

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion js/gated-content/src/scss/components/_top-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
position: fixed;
background-color: black;
width: 100%;
z-index: 1030;

@include median(z-index, 1030, 39);
@include media-breakpoint-down(md) {
z-index: 39 !important;
}

> div {
display: flex;
Expand Down
72 changes: 49 additions & 23 deletions js/gated-content/src/scss/theme_overrides.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.toolbar .toolbar-tray {
z-index: 1031;
}
.openy_carnation-based.openy-gated-content {
main > div > div {
> .banner {
Expand Down Expand Up @@ -384,47 +387,73 @@
margin-top: 100px !important;
}

@media (max-width: 991px) {
@include media-breakpoint-down(md) {
#gated-content .top-menu {
top: 109px;
}

&.primary-menu-minimize {
#gated-content .top-menu {
top: 70px;
}
}

.viewport {
margin-top: 86px;
}
}
}

@media (max-width: 609px) {
#gated-content .top-menu {
top: 109px;
&.toolbar-fixed {
#gated-content {
.top-menu {
top: calc(165px + 39px);
}
}
}

&.toolbar-tray-open #gated-content {
.top-menu {
top: calc(165px + 79px);
}
.gated-content-schedule-page {
padding-top: 48px;
}

.gated-content-schedule-page {
padding-top: 48px;
.date-filter {
top: 329px;
}

.calendar .desktop .slot.dates {
top: 377px;
}
}

.date-filter {
top: 329px;
&.toolbar-tray-open {
#gated-content {
.top-menu {
top: calc(165px + 79px);
}
}
}

.calendar .desktop .slot.dates {
top: 377px;
&.primary-menu-minimize {
#gated-content {
.top-menu {
top: calc(42px + 39px);

@include media-breakpoint-down(md) {
top: 70px !important;
}
}
}

&.toolbar-tray-open {
#gated-content {
.top-menu {
top: calc(42px + 79px);
}
}
}
}
}

&.primary-menu-minimize {
#gated-content {
.top-menu {
@include median(top, 42px, 109px);
}

.gated-content-schedule-page {
padding-top: 0;
}
Expand All @@ -440,9 +469,6 @@

&.toolbar-fixed {
#gated-content {
.top-menu {
top: calc(42px + 39px);
}

.date-filter {
top: 166px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Drupal\Core\Messenger\MessengerTrait;
use Drupal\Core\Url;
use Drupal\daxko_sso\DaxkoSSOClient;
use Drupal\openy_gated_content\GCUserService;
use Drupal\openy_gc_auth\GCIdentityProviderPluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
Expand Down Expand Up @@ -71,9 +72,10 @@ public function __construct(
DaxkoSSOClient $daxkoSSOClient,
RequestStack $requestStack,
FormBuilderInterface $form_builder,
LoggerChannelInterface $daxko_logger_channel
LoggerChannelInterface $daxko_logger_channel,
GCUserService $gc_user_service
) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $config, $entity_type_manager, $form_builder);
parent::__construct($configuration, $plugin_id, $plugin_definition, $config, $entity_type_manager, $form_builder, $gc_user_service);
$this->daxkoClient = $daxkoSSOClient;
$this->request = $requestStack->getCurrentRequest();
$this->daxkoLoggerChannel = $daxko_logger_channel;
Expand All @@ -92,7 +94,8 @@ public static function create(ContainerInterface $container, array $configuratio
$container->get('daxko_sso.client'),
$container->get('request_stack'),
$container->get('form_builder'),
$container->get('logger.factory')->get('daxko_sso')
$container->get('logger.factory')->get('daxko_sso'),
$container->get('openy_gated_content.user_service')
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Drupal\Core\Link;
use Drupal\Core\Messenger\MessengerInterface;
use Drupal\Core\Url;
use Drupal\openy_gated_content\GCUserService;
use Drupal\openy_gc_auth\GCIdentityProviderPluginBase;
use Drupal\personify\PersonifyClient;
use Drupal\personify\PersonifySSO;
Expand Down Expand Up @@ -75,9 +76,10 @@ public function __construct(
PersonifySSO $personifySSO,
PersonifyClient $personifyClient,
FormBuilderInterface $form_builder,
RequestStack $requestStack
RequestStack $requestStack,
GCUserService $gc_user_service
) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $config, $entity_type_manager, $form_builder);
parent::__construct($configuration, $plugin_id, $plugin_definition, $config, $entity_type_manager, $form_builder, $gc_user_service);
$this->messenger = $messenger;
$this->personifySSO = $personifySSO;
$this->personifyClient = $personifyClient;
Expand All @@ -98,7 +100,8 @@ public static function create(ContainerInterface $container, array $configuratio
$container->get('personify.sso_client'),
$container->get('personify.client'),
$container->get('form_builder'),
$container->get('request_stack')
$container->get('request_stack'),
$container->get('openy_gated_content.user_service')
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Messenger\MessengerTrait;
use Drupal\Core\Url;
use Drupal\openy_gated_content\GCUserService;
use Drupal\openy_gc_auth\GCIdentityProviderPluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
Expand Down Expand Up @@ -64,9 +65,10 @@ public function __construct(
ConfigFactoryInterface $config,
EntityTypeManagerInterface $entity_type_manager,
RequestStack $requestStack,
FormBuilderInterface $form_builder
FormBuilderInterface $form_builder,
GCUserService $gc_user_service
) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $config, $entity_type_manager, $form_builder);
parent::__construct($configuration, $plugin_id, $plugin_definition, $config, $entity_type_manager, $form_builder, $gc_user_service);
$this->request = $requestStack->getCurrentRequest();
}

Expand All @@ -81,7 +83,8 @@ public static function create(ContainerInterface $container, array $configuratio
$container->get('config.factory'),
$container->get('entity_type.manager'),
$container->get('request_stack'),
$container->get('form_builder')
$container->get('form_builder'),
$container->get('openy_gated_content.user_service')
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,15 @@ entity.shared_content_source_server.preview:
type: string
uuid:
type: string

shared_content_source.shared:
path: '/api/virtual-y/shared-content-source/{type}'
defaults:
_controller: '\Drupal\openy_gc_shared_content\Controller\SharedContentController::index'
_title: 'Shared content'
requirements:
_custom_access: '\Drupal\openy_gc_shared_content\Controller\SharedContentController::access'
options:
parameters:
type:
type: string
Loading

0 comments on commit 7191cee

Please sign in to comment.