Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Commit

Permalink
feat: add preview of filepaths to project settings source and target …
Browse files Browse the repository at this point in the history
…connection dropdowns (#877)
  • Loading branch information
luisamiranda committed Aug 23, 2019
1 parent a4f9f65 commit 11c962b
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class ConnectionPicker extends React.Component<IConnectionPickerProps, IC
<option
className="connection-option"
key={connection.id}
value={connection.id}>{connection.name}
value={connection.id}>{this.getConnectionText(connection)}
</option>)
}
</select>
Expand All @@ -71,6 +71,18 @@ export class ConnectionPicker extends React.Component<IConnectionPickerProps, IC
);
}

private getConnectionText = (connection: IConnection): string => {
const options = connection.providerOptions;

if (options["folderPath"]) {
return `${connection.name} (${options["folderPath"]})`;
} else if (options["accountName"]) {
return `${connection.name} (Azure:${options["accountName"]}\\${options["containerName"]})`;
} else {
return connection.name;
}
}

private onChange = (e) => {
const selectedConnection = this.props.connections
.find((connection) => connection.id === e.target.value) || {};
Expand Down

0 comments on commit 11c962b

Please sign in to comment.