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

Planner 1580 add frontend service #4

Merged
merged 8 commits into from Sep 7, 2019

Conversation

MusaTalluzi
Copy link
Owner

Add front end with the ability to:

  • Load submitted problems and view best solutions
  • Add new problems (tenants)
  • Switch between different tenants and view their best solutions

To run the ui:

  • run spring boot app from the root directory:
    -- ./mvnw spring-boot:run
  • run frontend app in a different terminal:
    -- cd spring-boot-task-assigning-frontend
    -- npm start

@rsynek
Copy link
Collaborator

rsynek commented Aug 29, 2019

Sorry for holding the review off; I might be able to get to it tomorrow or early next week.

Copy link
Collaborator

@rsynek rsynek left a comment

Choose a reason for hiding this comment

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

Quickly went though the PR, looks good. The only concern I have are missing tests of the UI, but my understanding is that this is just an example on how to do the task assignment.

Is there any plan regarding where this example should end up? Is it going to be another optaweb project?

spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=none
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true

logging.level.org.springframework.web=DEBUG
logging.level.org.optaplanner.core=INFO
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to have both optaplanner and drools on INFO level by default? WARN might be sufficient.

-->

<solver>
<!--<environmentMode>FULL_ASSERT</environmentMode>--><!-- To slowly prove there are no bugs in this code -->
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to keep the commented out code for a potential user to play with it or should we rather remove it?

<pattern>%d{HH:mm:ss.SSS} [%-12.12t] %-5p %m%n</pattern>
</encoder>
</appender>
<!--<appender name="fileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">-->
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we remove the unused appender?

import constants from '../shared/constants';

// idToColor from "Joe Freeman" answer: https://stackoverflow.com/questions/3426404/create-a-hexadecimal-colour-based-on-a-string-with-javascript
const idToColor = (str) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Soft suggestion: how about moving this special function into a separate .js file?

Copy link
Owner Author

Choose a reason for hiding this comment

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

What's the motivation of moving it? I would've done so if it's to be used in another .js file or it's too long, but in this case it's a short function that's only relevant to ScheduleComponent, unless you have a stronger argument for moving it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just not to spoil the logic of the component with this special detail. As it's not reused from anywhere else, it's not important.

@@ -0,0 +1,47 @@
## OptaTask UI:
In order to test the functionality, first have a KIE server running on http://localhost:8080 as explained here: https://docs.optaplanner.org/7.12.0.Final/optaplanner-wb-es-docs/html_single/#_planner.quickstart
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's refer to some newer version, 7.12.0.Final is quite old.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Actually this instruction is relevant to kie-server-task-assignment demo, I should remove it altogether.


In the project directory, you can run:

### `npm start`
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we want to help users who are not familiar with npm, let's mention also npm install

Copy link
Owner Author

Choose a reason for hiding this comment

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

This readme is auto generated by create-react-app, I will put the instructions for unfamiliar useres in the parent directory README,

@MusaTalluzi
Copy link
Owner Author

@rsynek thanks for the review! There are no plans currently for an optaweb-task-assignment, and the UI is just for testing and experimental purposes for using SolverManager, that's why there are no tests.

@MusaTalluzi MusaTalluzi merged commit 5798b86 into master Sep 7, 2019
@MusaTalluzi MusaTalluzi deleted the PLANNER-1580-AddFrontendService branch September 7, 2019 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants