Git Product home page Git Product logo

kontent-sample-app-conference-net's People

Contributors

kentico-michaelb avatar matus-usiak avatar pokornyd avatar

Watchers

 avatar

kontent-sample-app-conference-net's Issues

Add exception handling for empty Delivery responses

Brief bug description

Entering an invalid or unpublished Location or invalid or unpublished Agenda Item in the URL results in an exception instead of a 404.

Repro steps

  1. Launch application
  2. Replace the Location in the URL with random letters
    Examples:
    "http://localhost:57555/**asdasd**/Agenda"
    "http://localhost:57555/Denver/Agenda/asdasd"
  3. Exception is thrown:
    An unhandled exception occurred while processing the request.
    ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index

Expected behavior

User is redirected to a friendly 404 page.

Additional context

Currently, there aren't any conditions in the controllers to check if a Delivery response contains any items. This could be as simple as adding:

if (response.Items.Count == 0)
            {
                throw new HttpException(404, "Not found");
            }

to the controllers, but there may be a better way that could avoid repeating this condition across multiple controllers.

Design

Motivation

The project currently uses Visual Studio's default .Net MVC template. We should make it more attractive.

Proposed solution

Use a free, open-source bootstrap template to save time on development (as web design is not the focus of this project).

Create Content Management migration script for empty Tech Conference site

Motivation

Creating a CM migration script for the Kentico Kontent Content Types and a small set of Content Items will allow users to create an instance of the project in their own subscriptions.

Proposed solution

Leverage: https://docs.kontent.ai/reference/content-management-api-v2

Do not migrate all content items in order to reduce complexity in the copied project.

Additional context

An alternate script should be available to migrate all Content Types and Content Items in the event a user wants to copy the full project to their own subscription.

Unhandled exception when a Speaker does not have a photo

Brief bug description

Error:
InvalidOperationException: Sequence contains no elements
System.Linq.Enumerable.First(IEnumerable source)
AspNetCore.Views_Speakers_Index.ExecuteAsync() in Index.cshtml
+
<img src="@sp.Photo.First().Url" />
Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, bool invokeViewStarts)
Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable statusCode)
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, string contentType, Nullable statusCode)
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)
Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeResultAsync(IActionResult result)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResultFilterAsync<TFilter, TFilterAsync>()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResultExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.ResultNext<TFilter, TFilterAsync>(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeResultFilters()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Repro steps

  1. Go to the the TechConference project in Kentico Kontent
  2. Remove the Asset from the Photo element on a Speaker Content Item
  3. Launch the MVC application
  4. Visit "Speakers" section (Example: http://~/Denver/Speakers)
  5. See error

Expected behavior

Speaker listing will load.

Add support for responsive images

Invalid cast in Agenda detail pages

Brief bug description

the HostedVideo model was changed to YouTubeVideo in previous commits in order to simplify the project. This results in an unhandled exception in ~View/Agenda/Detail.cshtml.

Repro steps

  1. Go to '~/Denver/Agenda/why-should-i-structure-my-content'

Prepare Heroku for deployment of sample site and custom element

Motivation

We should have the sample application available online for preview and presentation purposes.

Proposed solution

For that matter, Heroku cloud service sounds like a good solution.

Additional context

One issue to overcome with this approach is that Heroku does not support .NET/Core by default. This will likely need to be worked around using a third party .NET Core buildpack.

Refactor Speaker Unique ID

Motivation

Speaker IDs currently use a custom element to ensure unique IDs are generated for each speaker. This creates additional overhead for anyone trying to setup their own copy of the project.

Proposed solution

Remove the Custom Element from the Speaker content type in Kentico Kontent and refactor the MVC application to use codenames instead of the custom Unique ID element.

Speakers' session links do not work

Brief bug description

Anchor element surrounding "session" items has no src attribute.

Repro steps

  1. Go to ~/Speakers
  2. Click on Aaron Collier
  3. Click on "Patterson companies..." or "Why should I..."

Expected behavior

Redirect to the Agenda Item referenced in the Sessions section.

Implement caching and webhook cache invalidation

Motivation

To improve application resiliency and performance, as well as provide an example of how caching can be done with Kentico Kontent.

Proposed solution

Implement webhook cache invalidation as suggested in the Kontent documentation: https://docs.kontent.ai/tutorials/develop-apps/get-content/improving-performance-with-caching#a-invalidating-cache-with-webhooks

We should use the approach taken in the Kontent Boilerplate: https://github.com/Kentico/kontent-boilerplate-net/tree/master/src/content/Kentico.Kontent.Boilerplate

Create Content Management migration script for full Tech Conference site

Motivation

Creating a migration script that imports all Content Types and Content Items from the sample Tech Conference site will allow a user to copy the full project to their own subscription for editing and exploration.

Proposed solution

Leverage: https://docs.kontent.ai/reference/content-management-api-v2

Do not migrate all content items in order to reduce complexity in the copied project.

Additional context

Similar to Issue #5

Clean up content in Kontent

Motivation

Currently there is a lot of placeholder content or lack of content that takes away from the sample.

Proposed solution

  • Remove some of the Speakers
  • Provide some detailed bios on existing speakers
  • Remove some of the Agenda Items to make the agendas and content inventory more slim (perhaps less "breaks"?)
  • Create fake Sponsors to replace Kentico copies
  • Ensure agenda items contain relevant content
  • Ensure everything is Published and delete any unused items in any other steps.

Add a test project

Motivation

With multiple people working in the repository, this can speed up development time/testing, while also achieving the Kentico DevRel recommended "Definition of Done" for open source projects.

Proposed solution

Take inspiration from kontent-ai/sample-app-net#76

We should add AppVeyor to this repository.

Refactor models to use partial classes

Motivation

Per best practices, any customization of models should happen in partial classes (create wrapper properties for [DisplayFormat] etc.)

Proposed solution

Regenerate the models using the [Kontent .NET Model Generator (https://github.com/Kentico/kontent-generators-net) and the "-g" parameter.

Convert SpeakerID from a Text Element to a custom Unique ID element

Motivation

When creating Speakers for the conference, there are no protections against editors inputting duplicate SpeakerIDs. If two speakers have the same ID, the application currently pulls whichever speaker appears first in the JSON repsonse.

Proposed solution

Implement the Unique Textbox custom element from: https://kentico.github.io/kontent-custom-element-samples/gallery/#unique-textbox to ensure entered text is unique.

Additional context

It may be worthwhile to extend the custom element to automatically generate IDs instead of having content editors manually enter the ID.

Tickets/registration functionality

Motivation

Currently no functionality exists to purchase conference tickets or register to attend a conference.

Proposed solution

Option 1: Integrate with e-commerce custom elements:

https://docs.kontent.ai/tutorials/develop-apps/integrate/integrating-with-e-commerce-shopify
https://docs.kontent.ai/tutorials/develop-apps/integrate/integrating-with-e-commerce-magento

Option 2: Integrate with HubSpot or build a custom registration form. This option would force us to change "Tickets" to "Registration" in both the front-end application and in Kontent in order to keep sensible naming conventions.

Navigating to Tickets strips location from the URL causing an unhandled exception

Brief bug description

NullReferenceException: Object reference not set to an instance of an object.
kontent_sample_app_conference_net.Controllers.VenueController.Index(string location) in VenueController.cs
21. DeliveryItemListingResponse<Venue> response = await DeliveryClient.GetItemsAsync<Venue>(
lambda_method(Closure , object )
Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable+Awaiter.GetResult()
Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor+TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, object controller, object[] arguments)
System.Threading.Tasks.ValueTask.get_Result()
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Repro steps

  1. Launch the MVC application
  2. Navigate to "Tickets" using the top navbar
  3. Visit any other page using the top navbar
  4. See error

Expected behavior

Navigating to Tickets will retain location in the URL (Example: http://domain.com/**Denver**/Agendas).

Additional context

The "Tickets" controller is empty at the moment, which is causing the problem.

Issue #9 will address the long-term goals of this section of the site.

Add support for Preview API

Motivation

Adding options for the Preview API will allow content editors to preview their changes in development and will set the groundwork for adding direct editing (https://docs.kontent.ai/tutorials/write-and-collaborate/preview-content/editing-content-directly-from-your-app).

Proposed solution

Add Preview API Delivery Options using DI per the wiki page: https://github.com/Kentico/kontent-delivery-sdk-net/wiki/Instantiating-DeliveryClient-with-Configuration-API-and-DI-in-ASP.NET-Core-MVC-apps

Setup Preview links in Kentico Kontent: https://docs.kontent.ai/tutorials/write-and-collaborate/preview-content/configuring-preview-for-content-items

Additional context

The Preview API Delivery Options should only exist in appsettings.Development.json, not in the production appsettings.json.

Remove "LiveUpdates" functionality from home page

Motivation

Implementing a "Live Updates" functionality falls out of the scope of this project and adds unneeded complexity. Users will likely be able to implement their own notification systems on top of Kontent that fire when webhooks are triggered.

Proposed solution

Remove Live Updates property from Home model and view.

Additional context

Content Types within Kontent referencing "LiveUpdates" also need to be adjusted/removed.

Go to the item in the UI from viewing it on the live site

Motivation

Easier for editors to locate the item when they spot a mistake while looking at the live site.

Proposed solution

Add a button to each page on the live site that would take them to that item in the KK's UI.

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.