Code Monkey home page Code Monkey logo

Comments (4)

GraemeWellington avatar GraemeWellington commented on June 7, 2024 1

I think I have narrowed the primary issue to being TimeZone related. I am operating in Adelaide Australia which is UTC+9:30.
In looking through the source code it appears that the TestDate was being initialised for UTC-4.00.
Thus appointments were being generated in non-available days/hours and therefore not appearing outside the available time slots. I adjusted the UTC time settings in several places and now am getting close and the appointments are appearing close to where they should be.
I have not used Docker much before but I note that if I run the apps via Visual Studio it uses my SQL Database and if I run Docker it uses another database within the containers - I am a slow learner so it took a while for the penny to drop!

The CORS problem was in Docker only and I made the suggested changes [note: I added builder.AllowAnyOrigin() not builder.AllowAnyHost() ]. I also need to reboot my PC and run Docker from a clean start for the FrontDesk to load the appointment data successfully.
So now I can get on with it!
Once again thanks for taking the time to review this issue.

from pluralsight-ddd-fundamentals.

ardalis avatar ardalis commented on June 7, 2024

Those files shouldn't matter too much. Are you able to see the DB calls being made? That should tell you something about what the app is trying to do under the covers. Troubleshooting steps:

  • Is EF using the SQL provider and talking to SQL?
  • What query is EF using?
  • What do you get when you run that query yourself?
  • Can you hit the API endpoint yourself and get data that way?

Basically the data needs to make it from the database to the API server to the Blazor Client code and finally be rendered to HTML. Any one of those transitions could fail so start from the database and try to find the failure point. HTH.

from pluralsight-ddd-fundamentals.

GraemeWellington avatar GraemeWellington commented on June 7, 2024

I have started from scratch and created both migrations and database updates.
I can confirm that I can get data via Swagger for all endpoints.
From Docker Desktop when I open ddd.frontdesk.blazor the Appointments page is displayed with Client: David Batten and Patient: Max.
No appointments appear for Monday, September 23, 2030. [The seeded data does correspond to this date].
However when I click 'Agenda' all the appointments are displayed correctly for Exam Room 1 / 2 /3.
Exam Room 1: 23 Monday September 2030 11:30 PM - 12:00 AM (WE} Darwin - Steve Smith
That might be a clue - When I click the 'Day' option the time slots displayed start at 7:00am and end 5:00pm.
So maybe the seeded appointments are outside this range and will not be displayed?
Also if I double click in any clear space in the schedule a modal pops up with Appointment Data Title: (WE) Max - David Batten etc. - I cannot see how I can add an appointment - also if I try and delete the appointment that pops up I get an error:

Access to fetch at 'http://localhost:5200/api/schedule/00000000-0000-0000-0000-000000000000/appointments/00000000-0000-0000-0000-000000000000' from origin 'http://localhost:5100' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Thanks for taking the time to review this issue.

from pluralsight-ddd-fundamentals.

ardalis avatar ardalis commented on June 7, 2024

Adding an appointment is done by first choosing an owner/patient at the top and then just clicking (or maybe double-clicking) on a time in a room. That should bring up a modal window where you choose the appointment type. In the example you're giving with Max - David Batten that's trying to create a Wellness Exam (WE) and I assume you have Max/David chosen at the top. You should be able to save the modal and it should create the appointment, unless there's a problem (like CORS...).

The CORS issue is probably the root of your problem. Since this is a demo app you can just disable CORS by going into the middleware of the web API app and modifying CORS to allow anything.

See: https://learn.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-7.0

Here's where to make the change:
https://github.com/ardalis/pluralsight-ddd-fundamentals/blob/main/FrontDesk/src/FrontDesk.Api/Startup.cs#L87-L97

Add builder.AllowAnyHost() and remove the WithOrigins and SetIsOriginAllowed lines. See if that gets you past the CORS issue and gets other things working too hopefully.

from pluralsight-ddd-fundamentals.

Related Issues (20)

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.