Skip to content

Commit

Permalink
Fix local container setup (#494)
Browse files Browse the repository at this point in the history
* Fix local container setup

* Temp styling fixes

---------

Co-authored-by: Ivan Lieckens <[email protected]>
  • Loading branch information
sc-ivanlieckens and IvanLieckens authored Nov 25, 2024
1 parent 53befe5 commit b22c6bd
Show file tree
Hide file tree
Showing 11 changed files with 3,269 additions and 2,472 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ public class MvpSiteSettings
public string? EdgeContextId { get; set; }

public string? EditingPath { get; set; }

public bool EnableLocalContainer { get; set; }

public Uri? LocalContainerLayoutUri { get; set; }
}
20 changes: 15 additions & 5 deletions headapps/MvpSite/MvpSite.Rendering/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,20 @@ public void ConfigureServices(IServiceCollection services)
.AddLocalization()
.AddMvc();

// Register the GraphQL version of the Sitecore Layout Service Client for use against experience edge & local edge endpoint
services.AddSitecoreLayoutService()
.AddGraphQlWithContextHandler("default", Configuration.EdgeContextId!, siteName: Configuration.DefaultSiteName!)
.AsDefaultHandler();
if (Configuration.EnableLocalContainer)
{
// Register the GraphQL version of the Sitecore Layout Service Client for use against local container endpoint
services.AddSitecoreLayoutService()
.AddGraphQlHandler("default", Configuration.DefaultSiteName!, Configuration.EdgeContextId!, Configuration.LocalContainerLayoutUri!)
.AsDefaultHandler();
}
else
{
// Register the GraphQL version of the Sitecore Layout Service Client for use against experience edge
services.AddSitecoreLayoutService()
.AddGraphQlWithContextHandler("default", Configuration.EdgeContextId!, siteName: Configuration.DefaultSiteName!)
.AsDefaultHandler();
}

services.AddFeatureUser(DotNetConfiguration);

Expand Down Expand Up @@ -95,7 +105,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
// ReSharper disable StringLiteralTypo - Uri segments
// Add redirects for old mvp pages
RewriteOptions rewriteOptions = new RewriteOptions()
.AddRedirect("mvps/(.*)", "Directory?fc_Year=$1")
.AddRedirect("mvps/(.*)", "Directory?fc_year=$1")
.AddRedirect("mvps$", "Directory")
.AddRedirect("search(.*)", "Directory$1")
.AddRedirect("Search(.*)", "Directory$1");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<section class="column-container two-column-equal ">
<div class="container">
<div class="row inner ">
<div class="sc-power-gradient-bg">
<div class="row">
<sc-placeholder name="column-container"></sc-placeholder>
</div>
<div class="row col-12">
<sc-placeholder name="column-container"></sc-placeholder>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$sitecore-red: #fe2911;
$sitecore-teal: #1ca6a3;
$sitecore-teal: var(--sc-violet-500);

$background: #f6f6f6;
$unfocussed-bg: #ccc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ button.cta i {

a.link-arrow,
span.link-arrow {
@extend a.cta.primary;
@extend .cta,.primary;
display: flex;
width: fit-content;
background: inherit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
}
}
.column-container {
.sc-power-gradient-bg {
padding-right: 1rem;
padding-left: 1rem;
.row {
.row {
.row:has(.feature-panel-card) {
gap: 1rem;
padding-right: 1rem;
padding-left: 1rem;
width: 100%;
row-gap: 0;
}
}
Expand All @@ -50,6 +51,16 @@
transform: translateX(100%);
top: 0;
}
&:before {
position: absolute;
width: 1rem;
background-color: white;
content: "";
height: 100%;
left: -2rem;
transform: translateX(100%);
top: 0;
}
.feature-panel-text {
background: none;
padding: 3px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}
.grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
width: 100%;
gap: 1rem;
.col {
Expand Down
15 changes: 15 additions & 0 deletions headapps/MvpSite/MvpSite.Rendering/wwwroot/sass/layout/nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,18 @@ $sc-font-color: #212529;
padding-left: 10px;
}
}
@media (max-width: 992px){
.main-nav{
.navbar-nav{
padding: 1rem;
}
.nav-item{
.sub-menu{
position: relative !important;
width: 100%;
top:0 !important;
box-shadow: none !important;
}
}
}
}
Loading

0 comments on commit b22c6bd

Please sign in to comment.