-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
424 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from typing import Dict | ||
|
||
from beanie import PydanticObjectId | ||
from fastapi import APIRouter | ||
|
||
from mapping_workbench.backend.core.models.api_request import APIRequestWithProject | ||
from mapping_workbench.backend.tasks.services.terms_validator import task_terms_validator | ||
|
||
ROUTE_PREFIX = "/tasks" | ||
TAG = "task" | ||
NAME_FOR_MANY = "tasks" | ||
NAME_FOR_ONE = "task" | ||
|
||
router = APIRouter( | ||
prefix=ROUTE_PREFIX, | ||
tags=[TAG] | ||
) | ||
|
||
|
||
@router.post( | ||
"/terms_validator", | ||
description=f"{NAME_FOR_ONE} Terms Validator", | ||
name=f"{NAME_FOR_MANY}:{NAME_FOR_ONE}_terms_validator" | ||
) | ||
async def route_task_terms_validator( | ||
filters: APIRequestWithProject = None | ||
): | ||
return await task_terms_validator(filters) |
14 changes: 14 additions & 0 deletions
14
mapping_workbench/backend/tasks/services/terms_validator.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from typing import Dict | ||
|
||
from mapping_workbench.backend.conceptual_mapping_rule.services.api import validate_and_save_rules_terms | ||
from mapping_workbench.backend.core.models.api_request import APIRequestWithProject | ||
from mapping_workbench.backend.project.models.entity import Project | ||
|
||
|
||
async def task_terms_validator(filters: APIRequestWithProject = None): | ||
query_filters: Dict = {} | ||
|
||
if filters.project: | ||
query_filters['project'] = Project.link_from_id(filters.project) | ||
|
||
await validate_and_save_rules_terms(query_filters) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import {SectionApi} from "../section"; | ||
import {appApi} from "../app"; | ||
import {apiPaths} from "../../paths"; | ||
|
||
class TasksApi { | ||
get TASKS_TITLE() { | ||
return "Tasks"; | ||
} | ||
|
||
get TASK_TITLE() { | ||
return "Task"; | ||
} | ||
|
||
constructor() { | ||
this.section = "tasks"; | ||
this.paths = apiPaths[this.section]; | ||
} | ||
|
||
async runTermsValidator(request = {}) { | ||
try { | ||
let endpoint = this.paths['terms_validator']; | ||
let filters = {} | ||
if (request['filters']) { | ||
filters = request['filters']; | ||
} | ||
return appApi.post(endpoint, filters); | ||
} catch (err) { | ||
} | ||
} | ||
} | ||
|
||
export const tasksApi = new TasksApi(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
mapping_workbench/frontend/src/pages/app/conceptual-mapping-rules/create.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
mapping_workbench/frontend/src/pages/app/mapping-packages/import.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.