Skip to content

Commit

Permalink
remove show help text from filtered examples and update e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-code committed Jan 13, 2025
1 parent de9d4ee commit 860d02f
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -911,13 +911,7 @@ export function AddStorageOptions({
/>
)}
<div className={cx("form-text", "text-muted")}>
<OptionTruncatedText
text={
inputType !== "dropdown" && o.filteredExamples?.length > 0
? o.filteredExamples[0]?.help
: o.help
}
/>
<OptionTruncatedText text={o.help} />
</div>
</div>
);
Expand All @@ -929,7 +923,7 @@ export function AddStorageOptions({
<Input
className={cx("form-check-input", "rounded-pill", "my-auto", "me-2")}
checked={state.showAllOptions}
id="switch-storage-advanced-mode"
id="switch-storage-full-list"
onChange={() => setState({ showAllOptions: !state.showAllOptions })}
role="switch"
type="checkbox"
Expand Down
15 changes: 15 additions & 0 deletions tests/cypress/e2e/projectV2setup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,26 @@ describe("Set up data connectors", () => {
// add data connector
cy.getDataCy("add-data-connector").should("be.visible").click();
cy.getDataCy("project-data-controller-mode-create").click();

// is polybox visible
cy.getDataCy("data-storage-polybox")
.contains("PolyBox")
.should("be.visible");
// Pick a provider
cy.getDataCy("data-storage-s3").click();
cy.getDataCy("data-provider-AWS").click();
cy.getDataCy("data-connector-edit-next-button").click();

// Validate is shown well the label and the help for passwords in full list
cy.get("#switch-storage-full-list").click();
cy.get("label")
.contains("sse_kms_key_id") // Find the label with the desired text
.parent() // Go one node above (to the parent div)
.should(
"contain.text",
"If using KMS ID you must provide the ARN of Key"
);

// Fill out the details
cy.get("#sourcePath").type("bucket/my-source");
cy.get("#access_key_id").type("access key");
Expand Down
139 changes: 139 additions & 0 deletions tests/cypress/fixtures/cloudStorage/storage-schema-s3.json
Original file line number Diff line number Diff line change
Expand Up @@ -4384,5 +4384,144 @@
},
"Help": "User metadata is stored as x-amz-meta- keys. S3 metadata keys are case insensitive and are always returned in lower case."
}
},
{
"name": "PolyBox",
"description": "Polybox",
"prefix": "polybox",
"options": [
{
"name": "url",
"help": "URL of http host to connect to.\n\nE.g. https://example.com.",
"provider": "personal",
"default": "https://polybox.ethz.ch/remote.php/webdav/",
"default_str": "",
"required": false,
"sensitive": false,
"advanced": false,
"exclusive": false,
"type": "string"
},
{
"name": "user",
"help": "User name.\n\nIn case NTLM authentication is used, the username should be in the format 'Domain\\User'.",
"provider": "personal",
"default": "",
"default_str": "",
"required": false,
"sensitive": false,
"advanced": false,
"exclusive": false,
"type": "string"
},
{
"name": "pass",
"help": "Password.",
"provider": "",
"default": "",
"default_str": "",
"required": false,
"sensitive": true,
"advanced": false,
"exclusive": false,
"type": "string"
},
{
"name": "bearer_token",
"help": "Bearer token instead of user/pass (e.g. a Macaroon).",
"provider": "personal",
"default": "",
"default_str": "",
"required": false,
"sensitive": true,
"advanced": false,
"exclusive": false,
"type": "string"
},
{
"name": "bearer_token_command",
"help": "Command to run to get a bearer token.",
"provider": "personal",
"default": "",
"default_str": "",
"required": false,
"sensitive": false,
"advanced": true,
"exclusive": false,
"type": "string"
},
{
"name": "encoding",
"help": "The encoding for the backend.\n\nSee the [encoding section in the overview](/overview/#encoding) for more info.\n\nDefault encoding is Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Hash,Percent,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8 for sharepoint-ntlm or identity otherwise.",
"provider": "",
"default": "",
"default_str": "",
"required": false,
"sensitive": false,
"advanced": true,
"exclusive": false,
"type": "string"
},
{
"name": "headers",
"help": "Set HTTP headers for all transactions.\n\nUse this to set additional HTTP headers for all transactions\n\nThe input format is comma separated list of key,value pairs. Standard\n[CSV encoding](https://godoc.org/encoding/csv) may be used.\n\nFor example, to set a Cookie use 'Cookie,name=value', or '\"Cookie\",\"name=value\"'.\n\nYou can set multiple headers, e.g. '\"Cookie\",\"name=value\",\"Authorization\",\"xxx\"'.\n",
"provider": "personal",
"default": [],
"default_str": "",
"required": false,
"sensitive": false,
"advanced": true,
"exclusive": false,
"type": "CommaSepList"
},
{
"name": "pacer_min_sleep",
"help": "Minimum time to sleep between API calls.",
"provider": "",
"default": 10000000.0,
"default_str": "10ms",
"required": false,
"sensitive": false,
"advanced": true,
"exclusive": false,
"type": "Duration"
},
{
"name": "provider",
"help": "Choose the mode to access the data source.",
"provider": "",
"default": "",
"default_str": "",
"examples": [
{
"value": "personal",
"help": "Connect to your personal storage space. This data connector cannot be used to share access to a folder.",
"provider": ""
},
{
"value": "shared",
"help": "Connect a 'public' folder shared with others. A 'public' folder may or may not be protected with a password.",
"provider": ""
}
],
"required": true,
"sensitive": false,
"advanced": false,
"exclusive": true,
"type": "string"
},
{
"name": "public_link",
"help": "Shared folder link. E.g., https://polybox.ethz.ch/index.php/s/8NffJ3rFyHaVyyy",
"provider": "shared",
"default": "",
"default_str": "",
"required": true,
"sensitive": false,
"advanced": false,
"exclusive": false,
"type": "string"
}
]
}
]

0 comments on commit 860d02f

Please sign in to comment.