diff --git a/Packages/client/Source/UI/@Shared/Maps/Node/DetailBoxes/NodeUI_BottomPanel.tsx b/Packages/client/Source/UI/@Shared/Maps/Node/DetailBoxes/NodeUI_BottomPanel.tsx
index 955a926ba..0b72ea752 100644
--- a/Packages/client/Source/UI/@Shared/Maps/Node/DetailBoxes/NodeUI_BottomPanel.tsx
+++ b/Packages/client/Source/UI/@Shared/Maps/Node/DetailBoxes/NodeUI_BottomPanel.tsx
@@ -16,12 +16,10 @@ import {nodeDetailBoxesLayer_container} from "./NodeDetailBoxesLayer.js";
import {NodeUI_LeftBox_width} from "./NodeUI_LeftBox.js";
import {DefinitionsPanel} from "./Panels/DefinitionsPanel.js";
import {DetailsPanel} from "./Panels/DetailsPanel.js";
-import {DiscussionPanel} from "./Panels/DiscussionPanel.js";
import {HistoryPanel} from "./Panels/HistoryPanel.js";
import {OthersPanel} from "./Panels/OthersPanel.js";
import {PhrasingsPanel} from "./Panels/PhrasingsPanel.js";
import {RatingsPanel} from "./Panels/RatingsPanel.js";
-import {SocialPanel} from "./Panels/SocialPanel.js";
import {TagsPanel} from "./Panels/TagsPanel.js";
//export const nodeBottomPanel_minWidth = 550;
@@ -148,8 +146,6 @@ export class NodeUI_BottomPanel extends BaseComponentPlus(
RunInAction("NodeBox_onClickTerm", ()=>nodeView.openTermIDs = termIDs);
}}/>)}
{renderPanel("phrasings", show=>
Title (negation):-
Title (question):- {/*
Title (negation):+
Title (question):+
Title (narrative):diff --git a/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/DataModel.ts b/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/DataModel.ts index e205ea994..1db3c6fcd 100644 --- a/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/DataModel.ts +++ b/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/DataModel.ts @@ -115,6 +115,9 @@ export class CG_Claim extends CG_Node { // v3 (tool extending claim-gen) arguments?: (string | CG_Argument)[]; + + // v4 + counter_claim?: string; } export class CG_Argument extends CG_Node { argument: string; diff --git a/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/ImportHelpers.ts b/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/ImportHelpers.ts index 8d87f4a7e..18be0ec46 100644 --- a/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/ImportHelpers.ts +++ b/Packages/client/Source/Utils/DataFormats/JSON/ClaimGen/ImportHelpers.ts @@ -56,6 +56,7 @@ export const GetResourcesInClaim_CG = CreateAccessor((context: ImportContext, cl const args = [] as CG_Argument[]; if (claim.argument) args.push({argument: claim.argument} as CG_Argument); if (claim.arguments) args.push(...claim.arguments.map(a=>(IsString(a) ? {argument: a} : a)) as CG_Argument[]); + if (claim.counter_claim) args.push({argument: claim.counter_claim} as CG_Argument); for (const [i, argument] of args.entries()) { result.push(NewNodeResource(context, argument, NodeType.claim, path_indexes.concat(i), path_titles.concat(argument.argument), claimResource, ChildGroup.freeform)); } @@ -108,16 +109,12 @@ export const NewNodeResource = CreateAccessor((context: ImportContext, data: CG_ displayDetails: undefined, attachments: CG_Node.GetAttachments(data), node: node.id, - phrasing: CullNodePhrasingToBeEmbedded(new NodePhrasing({ - id: GenerateUUID(), - type: NodePhrasingType.standard, - createdAt: Date.now(), - creator: systemUserID, - node: node.id, + phrasing: { ...(narrativeTitle != null ? {text_base: mainTitle, text_narrative: narrativeTitle} : {text_base: mainTitle}), - })), + terms: [], + }, }); return new IR_NodeAndRevision({ pathInData: path_indexes, diff --git a/Packages/js-common/Source/DB/nodes/$node.ts b/Packages/js-common/Source/DB/nodes/$node.ts index faf80dee1..02ba013bb 100644 --- a/Packages/js-common/Source/DB/nodes/$node.ts +++ b/Packages/js-common/Source/DB/nodes/$node.ts @@ -345,7 +345,6 @@ export const GetNodeTitleFromPhrasingAndForm = CreateAccessor((phrasing: NodePhr if (form) { if (form == ClaimForm.negation) return [phrasing.text_negation, "text_negation", "text_negation", missingTitleStrings[1]]; if (form == ClaimForm.question) { - //return phrasing.text_question || missingTitleStrings[2]; // for now at least, allow fallback to the base title if (phrasing.text_question != null && phrasing.text_question.trim().length) return [phrasing.text_question, "text_question", "text_question", missingTitleStrings[2]]; return [phrasing.text_base, "text_question", "text_base", missingTitleStrings[2]]; diff --git a/README.md b/README.md index 7b5a13f09..efaa0b199 100644 --- a/README.md +++ b/README.md @@ -611,7 +611,9 @@ Prerequisite steps: [setup-k8s](#setup-k8s), [setup-psql](#setup-psql) Prerequisite steps: [setup-k8s](#setup-k8s) -* 1\) If this is the first run, or if changes were made to the `client` or `monitor-client` web/frontend codebases, run the relevant js-building and js-bundling script(s): [`npm start client.tsc` and `npm start client.build.prodQuick`] and/or [`npm start monitorClient.tsc` and `npm start monitorClient.build.prodQuick`] (has vsc-2 tasks) +* 1\) If this is the first run, or if changes were made to the `client` or `monitor-client` web/frontend codebases, run the relevant js-building and js-bundling script(s): + * 1.1\) `npm start client.tsc_noWatch && npm start client.build.prodQuick` (can skip tsc part if client's tsc is already running) + * 1.2\) `npm start monitorClient.tsc_noWatch && npm start monitorClient.build.prodQuick` (can skip tsc part if monitor-client's tsc is already running) * 2\) Launch the backend pods necessary for the behavior you want to test: * 2.1\) Option 1, by launching the entire backend in your local k8s cluster: **(recommended)** * 2.1.1\) If your docker/kubernetes system is not active yet, start it now. (eg. on Windows, launching Docker Desktop from the start menu) @@ -802,6 +804,12 @@ Approach 2: (by using external psql with port-forwarding; requires that PostgreS * 2\) Run: `npm start "db.psql_k8s [dm-local/dm-ovh]"` * 3\) The shell should now have you logged in as the `admin` user. +Approach 3: (by using dbeaver) +* 1\) Set up a port-forward from `localhost:[5120/5220]` to your k8s database pod. (see: [port-forwarding](#port-forwarding)) +* 2\) Retrieve the data from "debate-map-pguser-admin" for the "dm-local" context by running `npm start db.local_secrets` +* 3\) Enter the data printed in the console to make a new dbeaver connection. + + @@ -853,7 +861,9 @@ New steps: Prerequisite steps: [pulumi-init](#pulumi-init), [ovh-init](#ovh-init) -* 1\) If changes were made to the `client` or `monitor-client` web/frontend codebases (or you've never run these build commands before), run the relevant js-building and js-bundling script(s): [`npm start client.tsc` and `npm start client.build.prodQuick`] and/or [`npm start monitorClient.tsc` and `npm start monitorClient.build.prodQuick`] (has vsc-2 tasks) +* 1\) If this is the first run, or if changes were made to the `client` or `monitor-client` web/frontend codebases, run the relevant js-building and js-bundling script(s): + * 1.1\) `npm start client.tsc_noWatch && npm start client.build.prodQuick` (can skip tsc part if client's tsc is already running) + * 1.2\) `npm start monitorClient.tsc_noWatch && npm start monitorClient.build.prodQuick` (can skip tsc part if monitor-client's tsc is already running) * 2\) Run: `npm start backend.tiltUp_ovh` * 3\) Wait till Tilt has finished deploying everything to your local k8s cluster. (to monitor, press space to open the Tilt web-ui, or `s` for an in-terminal display) * 4\) Verify that the deployment was successful, by visiting the web-server: `http://CLUSTER_URL:5200`. (replace `CLUSTER_URL` with the url listed in the OVH control panel) diff --git a/Tilt/Main.star b/Tilt/Main.star index acdae7b39..6059c0ac8 100644 --- a/Tilt/Main.star +++ b/Tilt/Main.star @@ -104,7 +104,7 @@ g = { "compileWithRelease": compileWithRelease, } -# some basic validity checks (of environment-variables) +# some basic validity checks (eg. of environment-variables) # ========== if ENV not in ("dev", "prod"): @@ -121,6 +121,11 @@ if PROD: if len(os.getenv("CLIENT_SECRET", "")) < 20: fail("Invalid CLIENT_SECRET env-var value (should be at least 20 chars long): " + os.getenv("CLIENT_SECRET")) +if not os.path.exists("../Packages/client/Dist/app.js"): + fail("File \"./Packages/client/Dist/app.js\" not found. Please build the client first, by running: `npm start client.tsc_noWatch && npm start client.build.prodQuick` (step 1 of readme's \"run-backend-local\" module)") +if not os.path.exists("../Packages/monitor-client/Dist/app.js"): + fail("File \"./Packages/monitor-client/Dist/app.js\" not found. Please build the monitor client first, by running: `npm start monitorClient.tsc_noWatch && npm start monitorClient.build.prodQuick` (step 1 of readme's \"run-backend-local\" module)") + # start specifying resources (to be deployed to k8s soon) # ========== diff --git a/Tilt/NGINX_Gateway.star b/Tilt/NGINX_Gateway.star index 187496eda..16b238ea9 100644 --- a/Tilt/NGINX_Gateway.star +++ b/Tilt/NGINX_Gateway.star @@ -26,6 +26,16 @@ def Start_NGINXGateway(g): #"service.externalIPs={15.204.30.179}", ], ) + NEXT_k8s_resource_batch(g, [ + { + "new_name": "ngf-early", "labels": ["gateway"], + "objects": [ + "ngf-nginx-gateway-fabric:serviceaccount", + "ngf-nginx-gateway-fabric:clusterrole", + "ngf-nginx-gateway-fabric:clusterrolebinding", + ], + }, + ]) NEXT_k8s_resource_batch(g, [ # we unfortunately can't group these atm; they are added at end of code in helm_remote.star #{"workload": "nginx-gateway-fabric-crds-install", "labels": ["gateway"]}, @@ -37,9 +47,6 @@ def Start_NGINXGateway(g): # commented; had two matches (with same exact id string!) on linux/rancher-desktop (2024-04-27) #"nginxgateways.gateway.nginx.org:customresourcedefinition", "nginx:gatewayclass", - "ngf-nginx-gateway-fabric:serviceaccount", - "ngf-nginx-gateway-fabric:clusterrole", - "ngf-nginx-gateway-fabric:clusterrolebinding", "ngf-config:nginxgateway", ], # This port-forward is only really necessary on Linux, when using docker-engine. (in other cases, k8s auto-creates PF for the load-balancer -- when accessing on the same machine anyway) diff --git a/package-scripts.js b/package-scripts.js index 2f10ba086..81ce6da86 100644 --- a/package-scripts.js +++ b/package-scripts.js @@ -16,7 +16,8 @@ Object.assign(scripts, { Object.assign(scripts, { client: { - tsc: `cd Packages/client && ${pathToNPMBin("tsc", 2)} --build --watch`, + tsc: `cd Packages/client && ${pathToNPMBin("tsc", 2)} --build --watch`, + tsc_noWatch: `cd Packages/client && ${pathToNPMBin("tsc", 2)} --build`, dev: { //default: `cross-env-shell NODE_ENV=development _USE_TSLOADER=true NODE_OPTIONS="--max-old-space-size=8192 --experimental-modules" "npm start dev-part2"`, default: GetServeCommand("dev"), @@ -68,7 +69,8 @@ Object.assign(scripts, { }); Object.assign(scripts, { monitorClient: { - tsc: `cd Packages/monitor-client && ${pathToNPMBin("tsc", 2)} --build --watch`, + tsc: `cd Packages/monitor-client && ${pathToNPMBin("tsc", 2)} --build --watch`, + tsc_noWatch: `cd Packages/monitor-client && ${pathToNPMBin("tsc", 2)} --build`, dev: { default: GetServeCommand("dev", "monitor-client"), part2: JSScript({pkg: _packagesRootStr}, "monitor-client/Scripts/Bin/Server"), @@ -558,6 +560,15 @@ Object.assign(scripts, { console.log("Connecting psql to database:", database); const psqlProcess = StartPSQLInK8s(K8sContext_Arg(), database, {stdio: "inherit"}, pager); }), + local_secrets: Dynamic(()=>{ + // we only care about local context data here, so no need to pass context to GetK8sPGUserAdminSecretData + const secret = GetK8sPGUserAdminSecretData("dm-local"); + console.log("--- Local Secrets ---"); + console.log("PORT:", 5120); + console.log("DATABASE:", "debate-map"); + console.log("USER:", "admin"); + console.log("PASSWORD:", secret.GetField("password").toString()); + }), // db init/seed commands (using psql to run standard .sql files) buildSeedDBScript: GetBuildSeedDBScriptCommand(),