()
+ const prefix = "https://mapcomplete.osm.be/"
+ for (const prop of props) {
+ const lines = prop.comments[0].text.split("\n")
+ const trigger = lines.findIndex(l => l.startsWith(prefix) && l.endsWith("#import"))
+ if (trigger < 0) {
+ continue
+ }
+ let theme = lines[trigger].substr(prefix.length)
+ theme = theme.substr(0, theme.indexOf("."))
+ const date = Utils.ParseDate(prop.date_created)
+ const dateStr = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate()
+ const key = theme + lines[0] + dateStr
+ if (!perBatch.has(key)) {
+ perBatch.set(key, [])
+ }
+ let status: "open" | "closed" | "imported" | "invalid" | "already_mapped" | "not_found" = "open"
+ if (prop.closed_at !== undefined) {
+ const lastComment = prop.comments[prop.comments.length - 1].text.toLowerCase()
+ if (lastComment.indexOf("does not exist") >= 0) {
+ status = "not_found"
+ } else if (lastComment.indexOf("already mapped") >= 0) {
+ status = "already_mapped"
+ } else if (lastComment.indexOf("invalid") >= 0 || lastComment.indexOf("incorrecto") >= 0) {
+ status = "invalid"
+ } else if (lastComment.indexOf("imported") >= 0) {
+ status = "imported"
+ } else {
+ status = "closed"
+ }
+ }
+
+ perBatch.get(key).push({
+ props: prop,
+ intro: lines[0],
+ theme,
+ dateStr,
+ status
+ })
+ }
+ return perBatch;
+ }
}
-export default class ImportInspectorGui extends Combine {
+class ImportViewerGui extends Combine {
constructor() {
const state = new UserRelatedState(undefined)
- const t = Translations.t.importInspector;
super([
- new Title(t.title, 1),
new VariableUiElement(state.osmConnection.userDetails.map(ud => {
if (ud === undefined || ud.loggedIn === false) {
- return undefined
+ return new Combine([new LoginButton("Login to inspect your import flows", state),
+ new BackToIndex()
+ ])
}
return new ImportInspector(ud, state);
}))
]);
}
+}
-
-}
\ No newline at end of file
+new ImportViewerGui().AttachTo("main")
\ No newline at end of file
diff --git a/UI/ProfessionalGui.ts b/UI/ProfessionalGui.ts
index d9a83cd7e..45a744e54 100644
--- a/UI/ProfessionalGui.ts
+++ b/UI/ProfessionalGui.ts
@@ -8,6 +8,7 @@ import BaseUIElement from "./BaseUIElement";
import LanguagePicker from "./LanguagePicker";
import TableOfContents from "./Base/TableOfContents";
import BackToIndex from "./BigComponents/BackToIndex";
+import LeftIndex from "./Base/LeftIndex";
class Snippet extends Toggleable {
constructor(translations, ...extraContent: BaseUIElement[]) {
@@ -39,7 +40,7 @@ class SnippetContent extends Combine {
}
}
-class ProfessionalGui {
+class ProfessionalGui extends LeftIndex{
constructor() {
@@ -93,7 +94,6 @@ class ProfessionalGui {
const leftContents: BaseUIElement[] = [
- new BackToIndex().SetClass("block"),
new TableOfContents(content, {
noTopLevel: true,
maxDepth: 2
@@ -102,10 +102,7 @@ class ProfessionalGui {
LanguagePicker.CreateLanguagePicker(Translations.t.professional.title.SupportedLanguages())?.SetClass("mt-4 self-end flex-col"),
].map(el => el?.SetClass("pl-4"))
- const leftBar = new Combine([
- new Combine(leftContents).SetClass("sticky top-4 m-4")
- ]).SetClass("block w-full md:w-2/6 lg:w-1/6")
- new Combine([leftBar, content]).SetClass("block md:flex").AttachTo("main")
+ super(leftContents, content)
}
@@ -113,4 +110,4 @@ class ProfessionalGui {
}
new FixedUiElement("").AttachTo("decoration-desktop")
-new ProfessionalGui()
\ No newline at end of file
+new ProfessionalGui().AttachTo("main")
\ No newline at end of file
diff --git a/Utils.ts b/Utils.ts
index 25f898575..64a9c66e9 100644
--- a/Utils.ts
+++ b/Utils.ts
@@ -625,6 +625,13 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
}
return JSON.parse(JSON.stringify(x));
}
+
+ public static ParseDate(str: string): Date{
+ if (str.endsWith(" UTC")) {
+ str = str.replace(" UTC", "+00")
+ }
+ return new Date(str)
+ }
private static colorDiff(c0: { r: number, g: number, b: number }, c1: { r: number, g: number, b: number }) {
return Math.abs(c0.r - c1.r) + Math.abs(c0.g - c1.g) + Math.abs(c0.b - c1.b);
diff --git a/css/index-tailwind-output.css b/css/index-tailwind-output.css
index 9aa741e1c..9451522e5 100644
--- a/css/index-tailwind-output.css
+++ b/css/index-tailwind-output.css
@@ -752,14 +752,14 @@ video {
bottom: 0px;
}
-.top-4 {
- top: 1rem;
-}
-
.right-1\/3 {
right: 33.333333%;
}
+.top-4 {
+ top: 1rem;
+}
+
.top-0 {
top: 0px;
}
@@ -872,6 +872,14 @@ video {
margin-top: 0.25rem;
}
+.ml-4 {
+ margin-left: 1rem;
+}
+
+.mb-24 {
+ margin-bottom: 6rem;
+}
+
.mr-4 {
margin-right: 1rem;
}
@@ -912,10 +920,6 @@ video {
margin-left: 0.25rem;
}
-.mb-24 {
- margin-bottom: 6rem;
-}
-
.mr-0 {
margin-right: 0px;
}
@@ -1182,10 +1186,6 @@ video {
flex-grow: 1;
}
-.table-auto {
- table-layout: auto;
-}
-
.border-collapse {
border-collapse: collapse;
}
diff --git a/langs/nl.json b/langs/nl.json
index 1dfaa6eb8..58aed08aa 100644
--- a/langs/nl.json
+++ b/langs/nl.json
@@ -319,7 +319,10 @@
"layerName": "Hier is misschien een {title}",
"description": "Deze laag toont kaart-nota's die wijzen op een {title}",
"popupTitle": "Mogelijkse {title}",
- "importButton": "import_button({layerId}, _tags, Hier is een {title}, voeg toe...,./assets/svg/addSmall.svg,,,id)",
- "importHandled": "Dit punt is afgehandeld. Bedankt om mee te helpen!
"
+ "importButton": "import_button({layerId}, _tags, Ik heb hier een {title} gevonden - voeg deze toe aan de kaart...,./assets/svg/addSmall.svg,,,id)",
+ "importHandled": "Dit punt is afgehandeld. Bedankt om mee te helpen!
",
+
+ "notFound": "Ik kon geen {title} vinden hier - verwijder deze van de kaart",
+ "alreadyMapped": "Er staat hier reeds een {title} op de kaart; dit punt is een duplicaat. Verwijder deze van de kaart"
}
}
diff --git a/package.json b/package.json
index 1818e3965..2f843f034 100644
--- a/package.json
+++ b/package.json
@@ -42,7 +42,7 @@
"prepare-deploy": "./scripts/build.sh",
"gittag": "ts-node scripts/printVersion.ts | bash",
"lint": "tslint --project . -c tslint.json '**.ts' ",
- "clean": "rm -rf .cache/ && (find *.html | grep -v \"\\(404\\|index\\|land\\|test\\|preferences\\|customGenerator\\|professional\\|automaton\\|import_helper\\|theme\\).html\" | xargs rm) && (ls | grep \"^index_[a-zA-Z_]\\+\\.ts$\" | xargs rm) && (ls | grep \".*.webmanifest$\" | xargs rm)",
+ "clean": "rm -rf .cache/ && (find *.html | grep -v \"\\(404\\|index\\|land\\|test\\|preferences\\|customGenerator\\|professional\\|automaton\\|import_helper\\|import_viewer\\|theme\\).html\" | xargs rm) && (ls | grep \"^index_[a-zA-Z_]\\+\\.ts$\" | xargs rm) && (ls | grep \".*.webmanifest$\" | xargs rm)",
"generate:dependency-graph": "node_modules/.bin/depcruise --exclude \"^node_modules\" --output-type dot Logic/State/MapState.ts > dependencies.dot && dot dependencies.dot -T svg -o dependencies.svg && rm dependencies.dot",
"bicycle_rental": "ts-node ./scripts/extractBikeRental.ts"
},
diff --git a/scripts/build.sh b/scripts/build.sh
index b4714b267..99c8678ee 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -37,7 +37,7 @@ fi
echo -e "\n\n Building non-theme pages"
echo -e " ==========================\n\n"
-parcel build --public-url "./" $SRC_MAPS "index.html" "404.html" "professional.html" "automaton.html" "import_helper.html" "land.html" "customGenerator.html" "theme.html" vendor
+parcel build --public-url "./" $SRC_MAPS "index.html" "404.html" "professional.html" "automaton.html" "import_helper.html" "import_viewer.html" "land.html" "customGenerator.html" "theme.html" vendor
echo -e "\n\n Building theme pages"
echo -e " ======================\n\n"
diff --git a/test.ts b/test.ts
index 6ff12256b..e69de29bb 100644
--- a/test.ts
+++ b/test.ts
@@ -1,4 +0,0 @@
-import ImportInspectorGui from "./UI/ImportFlow/ImportInspector";
-
-new ImportInspectorGui().AttachTo("maindiv")
-