-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature: MP parser frontend scaffolding + API calls #84
Feature: MP parser frontend scaffolding + API calls #84
Conversation
@@ -123,6 +124,8 @@ | |||
|
|||
SPINDLE_URL = f"http://pp-spindle:32768/" | |||
LATEX_SERVICE_URL = f"http://pp-latex:32769/" | |||
MINIMALIST_PARSER_URL = f"http://pp-minimalist-parser:32770/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in use yet, so don't try to connect to them ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, also looks good: not too many moving parts yet so not too much feedback.
} | ||
|
||
|
||
def status_check(service: Literal["spindle", "minimalist_parser", "vulcan"]) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yes very functional very nice
|
||
} @else { | ||
<p class="notification mt-6" i18n> | ||
The Minimalist Parser is temporarily unavailable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the 'temporarily'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's important to give your users hope and prospects of a better future ;)
}); | ||
} | ||
|
||
public parse(): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, considering the exportResult
function from spindle.component.ts
:
public parse(): void {
this.form.controls.mpInput.markAsTouched();
this.form.controls.mpInput.updateValueAndValidity();
const input = this.form.controls.mpInput.value;
if (this.form.invalid || !input) {
return;
}
this.apiService.input$.next(input);
}
These functions are very similar: could we think of a good way to make them generalizable / put them in a service? Is that even worthwhile, do you think? I'm happy to let this rest since it's not really priority but I was wondering all the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I definitely there is room to DRY this code a bit more. I've created a new issue for it: #93 .
…orDigitalHumanities/parseport into feature/parser-api-calls
(#81 should be reviewed/merged first.)Done!Some more scaffolding before the actual parser + visualizer are added to the Docker network. This code is mostly a copy/adaptation of what is already in place for Spindle/Aethel.
This PR adds a new Django app
minimalist_parser
to backend, with a status check akin to the one in place for thespindle
andaethel_db
apps. The idea is that the server can check the other containers in the network to make sure the services are all running, and to notify the frontend if they aren't.Regarding the frontend, this PR expands the MinimalistParserInput component and adds a service to deal with the data fetching.
Next step is to add the containers to the Docker network and try to actually apply the parser to user input!