Skip to content

Commit

Permalink
fix(dynamodb): improve ui
Browse files Browse the repository at this point in the history
1. Hide underlying implementation
2. Add "Table Name" field
  • Loading branch information
eladb committed Mar 26, 2024
1 parent b1a525d commit 20f9c4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion dynamodb/dynamodb.w
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
bring aws;
bring util;
bring ui;
bring "./dynamodb-types.w" as dynamodb_types;
bring "./dynamodb.sim.w" as dynamodb_sim;
bring "./dynamodb.tf-aws.w" as dynamodb_tfaws;
Expand All @@ -17,16 +18,20 @@ pub class Table impl dynamodb_types.ITable {
this.connection = sim.connection;
this.tableName = sim.tableName;
this.implementation = sim;

nodeof(sim).hidden = true;
} elif target == "tf-aws" {
let tfaws = new dynamodb_tfaws.Table_tfaws(props);
this.connection = tfaws.connection;
this.tableName = tfaws.tableName;
this.implementation = tfaws;
nodeof(tfaws).hidden = true;
} else {
throw "Unsupported target {target}";
}

new ui.Field("Table Name", inflight () => {
return this.tableName;
});
}

pub setStreamConsumer(handler: inflight (dynamodb_types.StreamRecord): void) {
Expand Down
2 changes: 1 addition & 1 deletion dynamodb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@winglibs/dynamodb",
"version": "0.0.6",
"version": "0.0.7",
"description": "DynamoDB library for Wing",
"author": {
"name": "Cristian Pallarés",
Expand Down

0 comments on commit 20f9c4e

Please sign in to comment.