Spaces:
Sleeping
Sleeping
solidprivacy-nl commited on
Commit ·
03b08d5
1
Parent(s): 0c61b78
Add review table column configuration
Browse files- review_table_config.py +55 -0
review_table_config.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Column configuration for the Scrub review table.
|
| 2 |
+
|
| 3 |
+
The main editing table should stay readable for legal users. Technical audit
|
| 4 |
+
fields remain available, but are separated from the primary edit workflow.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
MAIN_REVIEW_COLUMNS = [
|
| 8 |
+
"include",
|
| 9 |
+
"remember",
|
| 10 |
+
"review_status_label",
|
| 11 |
+
"find",
|
| 12 |
+
"replace_with",
|
| 13 |
+
"type_label",
|
| 14 |
+
"confidence",
|
| 15 |
+
]
|
| 16 |
+
|
| 17 |
+
TECHNICAL_REVIEW_COLUMNS = [
|
| 18 |
+
"source_label",
|
| 19 |
+
"reason",
|
| 20 |
+
"context",
|
| 21 |
+
"entity_type",
|
| 22 |
+
"score",
|
| 23 |
+
"source",
|
| 24 |
+
"review_status",
|
| 25 |
+
"review_order",
|
| 26 |
+
]
|
| 27 |
+
|
| 28 |
+
TECHNICAL_DISPLAY_COLUMNS = [
|
| 29 |
+
"review_status_label",
|
| 30 |
+
"find",
|
| 31 |
+
"type_label",
|
| 32 |
+
"source_label",
|
| 33 |
+
"reason",
|
| 34 |
+
"context",
|
| 35 |
+
"entity_type",
|
| 36 |
+
"score",
|
| 37 |
+
"source",
|
| 38 |
+
]
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def existing_columns(columns, available_columns):
|
| 42 |
+
available = set(available_columns or [])
|
| 43 |
+
return [column for column in columns if column in available]
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
def main_review_columns(available_columns):
|
| 47 |
+
return existing_columns(MAIN_REVIEW_COLUMNS, available_columns)
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
def technical_display_columns(available_columns):
|
| 51 |
+
return existing_columns(TECHNICAL_DISPLAY_COLUMNS, available_columns)
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
def hidden_technical_columns(available_columns):
|
| 55 |
+
return existing_columns(TECHNICAL_REVIEW_COLUMNS, available_columns)
|