Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! feat: add azu…
Browse files Browse the repository at this point in the history
…re branch detection

Signed-off-by: Oleksii Orel <[email protected]>
  • Loading branch information
olexii4 authored and ibuziuk committed Aug 13, 2024
1 parent 1e064e1 commit 86bc264
Show file tree
Hide file tree
Showing 6 changed files with 420 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (c) 2018-2024 Red Hat, Inc.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/

import React from 'react';

import { Props } from '@/components/ImportFromGit/RepoOptionsAccordion/AdvancedOptions';

export class AdvancedOptions extends React.PureComponent<Props> {
public render() {
const {
containerImage,
temporaryStorage,
createNewIfExisting,
memoryLimit,
cpuLimit,
onChange,
} = this.props;

return (
<div>
<div>Advanced Options</div>
<div data-testid="advanced-options">{`${containerImage}, ${temporaryStorage}, ${createNewIfExisting}, ${memoryLimit}, ${cpuLimit}`}</div>
<button
onClick={() =>
onChange('newContainerImage', !temporaryStorage, !createNewIfExisting, 1073741824, 1)
}
>
Advanced Options Change
</button>
</div>
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2018-2024 Red Hat, Inc.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/

import React from 'react';

import { Props } from '@/components/ImportFromGit/RepoOptionsAccordion/GitRepoOptions';

export class GitRepoOptions extends React.PureComponent<Props> {
public render() {
const { gitBranch, remotes, devfilePath, hasSupportedGitService, onChange } = this.props;

return (
<div>
<div>Git Repo Options</div>
<div data-testid="git-repo-options">{`${gitBranch}, ${JSON.stringify(remotes)}, ${devfilePath}, ${hasSupportedGitService}`}</div>
<button
onClick={() =>
onChange(
'newBranch',
[{ name: 'test-updated', url: 'http://test' }],
'newDevfilePath',
true,
)
}
>
Git Repo Options Change
</button>
</div>
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`RepoOptionsAccordion snapshot with default values 1`] = `
<div
aria-label=""
className="pf-c-accordion"
>
<h3>
<button
aria-expanded={false}
className="pf-c-accordion__toggle"
data-testid="accordion-item-git-repo-options"
id="accordion-item-git-repo-options"
onClick={[Function]}
type="button"
>
<span
className="pf-c-accordion__toggle-text"
>
Git Repo Options
</span>
<span
className="pf-c-accordion__toggle-icon"
>
<svg
aria-hidden={true}
aria-labelledby={null}
fill="currentColor"
height="1em"
role="img"
style={
{
"verticalAlign": "-0.125em",
}
}
viewBox="0 0 256 512"
width="1em"
>
<path
d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"
/>
</svg>
</span>
</button>
</h3>
<div
className="pf-c-accordion__expanded-content"
data-testid="options-content"
hidden={true}
id=""
>
<div
className="pf-c-accordion__expanded-content-body"
>
<div
className="pf-c-panel"
>
<div
className="pf-c-panel__main"
style={
{
"--pf-c-panel__main--MaxHeight": undefined,
}
}
>
<div
className="pf-c-panel__main-body"
>
<div>
<div>
Git Repo Options
</div>
<div
data-testid="git-repo-options"
>
undefined, undefined, undefined, false
</div>
<button
onClick={[Function]}
>
Git Repo Options Change
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<h3>
<button
aria-expanded={false}
className="pf-c-accordion__toggle"
data-testid="accordion-item-advanced-options"
id="accordion-item-advanced-options"
onClick={[Function]}
type="button"
>
<span
className="pf-c-accordion__toggle-text"
>
Advanced Options
</span>
<span
className="pf-c-accordion__toggle-icon"
>
<svg
aria-hidden={true}
aria-labelledby={null}
fill="currentColor"
height="1em"
role="img"
style={
{
"verticalAlign": "-0.125em",
}
}
viewBox="0 0 256 512"
width="1em"
>
<path
d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"
/>
</svg>
</span>
</button>
</h3>
<div
className="pf-c-accordion__expanded-content"
data-testid="options-content"
hidden={true}
id=""
>
<div
className="pf-c-accordion__expanded-content-body"
>
<div
className="pf-c-panel"
>
<div
className="pf-c-panel__main"
style={
{
"--pf-c-panel__main--MaxHeight": undefined,
}
}
>
<div
className="pf-c-panel__main-body"
>
<div>
<div>
Advanced Options
</div>
<div
data-testid="advanced-options"
>
undefined, undefined, undefined, undefined, undefined
</div>
<button
onClick={[Function]}
>
Advanced Options Change
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
`;
Loading

0 comments on commit 86bc264

Please sign in to comment.