-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(artifacts/helm): support regex/spel in version (#7033)
* fix(artifacts/helm): support regex/spel in version the version field in an artifact supports regex but the previous UI forced a hardcoded version. this made triggers really confusing because users are forced to set a version on the artifact when they really wanted something like `.*` to indicate that this chart should be matched for all versions. * refactor(artifact/helm): address PR feedback
- Loading branch information
1 parent
59259a9
commit 4975233
Showing
3 changed files
with
122 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
app/scripts/modules/core/src/presentation/TetheredCreatable.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import * as React from 'react'; | ||
import { Creatable } from 'react-select'; | ||
import * as TetherComponent from 'react-tether'; | ||
|
||
/* from https://github.com/JedWatson/react-select/issues/810#issuecomment-250274937 **/ | ||
export class TetheredCreatable extends Creatable { | ||
constructor(props: any) { | ||
super(props); | ||
(this as any).renderOuter = this._renderOuter; | ||
} | ||
|
||
public _renderOuter() { | ||
// @ts-ignore - type definitions don't expose renderOuter... | ||
const menu = super.render.apply(this, arguments); | ||
|
||
// Don't return an updated menu render if we don't have one | ||
if (!menu) { | ||
return null; | ||
} | ||
|
||
/* this.wrapper comes from the ref of the main Select component (super.render()) **/ | ||
const selectWidth = (this as any).wrapper ? (this as any).wrapper.offsetWidth : null; | ||
|
||
return ( | ||
// @ts-ignore - type definitions don't expose renderOuter... | ||
<TetherComponent | ||
classes={{ element: 'layer-high' }} | ||
attachment="top left" | ||
targetAttachment="top left" | ||
constraints={[ | ||
{ | ||
to: 'window', | ||
attachment: 'together', | ||
pin: ['top'], | ||
}, | ||
]} | ||
> | ||
{/* Apply position:static to our menu so that its parent will get the correct dimensions and we can tether the parent */} | ||
<div /> | ||
{React.cloneElement(menu, { style: { position: 'static', width: selectWidth } })} | ||
</TetherComponent> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters