Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
],
};
const mappedData: any = mapDataToComponent(childrenSchema, data, childOptions);
expect(typeof get(mappedData, "children[0].type")).toBe("function");
expect(get(mappedData, "children[0].type.displayName")).toBe("Children");
expect(typeof get(mappedData, "children[0].props.children.type")).toBe(
"function"
);
expect(get(mappedData, "children[0].props.children.type.displayName")).toBe(
"Text field"
);
expect(typeof get(mappedData, "children[1].type")).toBe("function");
expect(get(mappedData, "children[1].type.displayName")).toBe("Text field");
});
test("should map simple data to a plugin", () => {
export const BuildStrategy: React.SFC = ({ resource, children }) => {
const dockerfile = _.get(resource, 'spec.source.dockerfile');
const jenkinsfile = _.get(resource, 'spec.strategy.jenkinsPipelineStrategy.jenkinsfile');
const strategyType = getStrategyType(resource.spec.strategy.type);
const buildFromPath = ['spec', 'strategy', strategyType, 'from'];
const buildFrom = _.get(resource, buildFromPath);
const outputTo = _.get(resource, 'spec.output.to');
const commitMessage = _.get(resource, 'spec.revision.git.message');
const commitHash = _.get(resource, 'spec.revision.git.commit');
const commitAuthorName = _.get(resource, 'spec.revision.git.author.name');
const pushSecret = _.get(resource, 'spec.output.pushSecret');
const resourceLimits = _.get(resource, 'spec.resources.limits');
const triggers = _.map(resource.spec.triggers, 'type').join(', ');
return (
<dl>
{children}
{commitMessage && (
</dl>
?
: <button type="button"> approvalModal()}>{obj.spec.installPlanApproval || 'Automatic'}</button>
}
<div>
<dl>
<dt>Upgrade Status</dt>
<dd>{subscriptionState(_.get(obj.status, 'state'))}</dd>
</dl>
<div></div>
<div>
{ _.get(obj.status, 'installedCSV') && installedCSV
? 1 installed
: <span>0 installed</span> }
{ _.get(obj.status, 'state') === SubscriptionState.SubscriptionStateUpgradePending && _.get(obj.status, 'installplan') && this.props.installPlan
?
<span>{installPlanPhase(this.props.installPlan)}</span>
: <span>0 installing</span> }
</div>
</div>
;
}
}
.subscribe((res) => {
if (res && _.get(res, 'result.framework.categories')) {
this.frameworkCategories = _.get(res, 'result.framework.categories');
if (_.get(this.selectedFilters, 'board[0]')) {
this.setFilters(false);
} else {
this.setFilters(true);
}
}
});
}
public render(): React.ReactNode {
return (
_updateUser() {
const { flags, user } = this.props;
if (!flags[FLAGS.OPENSHIFT]) {
this.setState({ username: authSvc.name() });
}
this.setState({
username: _.get(user, 'fullName') || _.get(user, 'metadata.name', ''),
isKubeAdmin: _.get(user, 'metadata.name') === 'kube:admin',
});
}
const BuildGraphs = requirePrometheus(({ build }) => {
const podName = _.get(build, ['metadata', 'annotations', 'openshift.io/build.pod-name']);
if (!podName) {
return null;
}
const namespace = build.metadata.namespace;
return (
<>
<div>
<div>
</div></div>
const runsAsRoot = image => {
const user = _.get(image, 'dockerImageMetadata.Config.User');
return !user ||
user === '0' ||
user === 'root';
};
export function mapStateToProps(state) {
const postEntity = _get(state, 'entities.post');
const postIds = _get(state, 'pages.home.posts');
let posts = postIds.map(id => postEntity[id] || {});
posts = posts.slice(0, 20);
debug(posts);
return {
posts,
};
}
.subscribe((data) => {
if (data && _.get(data, 'result.framework.categories')) {
this.frameworkCategories = _.get(data, 'result.framework.categories');
const board = _.find(this.frameworkCategories, (element) => {
return element.code === 'board';
});
this.mediumOption = this.userService.getAssociationData(board.terms, 'medium', this.frameworkCategories);
if (this.contentPreferenceForm.value.board.name === this.frameworkDetails['board']) {
this.contentPreferenceForm.controls['medium'].setValue(this.filterContent(this.mediumOption, this.frameworkDetails['medium']));
}
}
}, err => {
});