Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vdk-jupyter: small fixtures on the ui #2161

Merged
merged 6 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ export interface IVdkTextInputProps {
label: string;
}


/**
* This function is used to be sure that placeholder text is not overflowing in case of long path
* if the string that is given is not path it will return the same string
* if it is a path it will return the last directory
*/
const getLastPartOfPath = (path: string): string => {
const pathParts = path.split(/(?=[/\\])/); // Lookahead assertion to keep delimiter
return pathParts[pathParts.length - 1];
}

export default class VDKTextInput extends Component<IVdkTextInputProps> {
/**
* Returns a React component for rendering a div with input and value for VDK Option.
Expand All @@ -43,7 +54,7 @@ export default class VDKTextInput extends Component<IVdkTextInputProps> {
type="text"
id={this.props.option}
className="jp-vdk-input"
placeholder={this.props.value}
placeholder={getLastPartOfPath(this.props.value)}
onChange={this.onInputChange}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
display: none;
}

.jp-vdk-checkbox-wrapper {
.jp-vdk-checkbox-wrappers {
display: flex;
justify-content: center;
align-items: center;
Expand Down