-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
complete dast automation scenario UI and integration.
- Loading branch information
Showing
73 changed files
with
4,859 additions
and
457 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<svg | ||
width='164' | ||
height='95' | ||
viewBox='0 0 164 95' | ||
fill='none' | ||
xmlns='http://www.w3.org/2000/svg' | ||
...attributes | ||
> | ||
<path | ||
fill-rule='evenodd' | ||
clip-rule='evenodd' | ||
d='M157.126 14.0156C160.922 14.0156 164 16.9435 164 20.5552C164 24.1669 160.922 27.0947 157.126 27.0947H117.844C121.641 27.0947 124.719 30.0226 124.719 33.6343C124.719 37.246 121.641 40.1738 117.844 40.1738H139.449C143.246 40.1738 146.323 43.1017 146.323 46.7134C146.323 50.3251 143.246 53.2529 139.449 53.2529H129.458C124.671 53.2529 120.79 56.1808 120.79 59.7925C120.79 62.2003 122.754 64.3801 126.683 66.332C130.479 66.332 133.557 69.2599 133.557 72.8716C133.557 76.4833 130.479 79.4111 126.683 79.4111H45.1737C41.3771 79.4111 38.2994 76.4833 38.2994 72.8716C38.2994 69.2599 41.3771 66.332 45.1737 66.332H6.87425C3.07771 66.332 0 63.4042 0 59.7925C0 56.1808 3.07771 53.2529 6.87425 53.2529H46.1557C49.9522 53.2529 53.0299 50.3251 53.0299 46.7134C53.0299 43.1017 49.9522 40.1738 46.1557 40.1738H21.6048C17.8082 40.1738 14.7305 37.246 14.7305 33.6343C14.7305 30.0226 17.8082 27.0947 21.6048 27.0947H60.8862C57.0897 27.0947 54.012 24.1669 54.012 20.5552C54.012 16.9435 57.0897 14.0156 60.8862 14.0156H157.126ZM157.126 40.1738C160.922 40.1738 164 43.1017 164 46.7134C164 50.3251 160.922 53.2529 157.126 53.2529C153.329 53.2529 150.251 50.3251 150.251 46.7134C150.251 43.1017 153.329 40.1738 157.126 40.1738Z' | ||
fill='#FE4D3F' | ||
fill-opacity='0.05' | ||
/> | ||
<path | ||
fill-rule='evenodd' | ||
clip-rule='evenodd' | ||
d='M104.353 13.0763L113.835 76.7423L114.691 83.1291C114.966 85.1866 113.455 87.0497 111.316 87.2904L54.1699 93.7185C52.0302 93.9592 50.0721 92.4863 49.7963 90.4288L40.5618 21.5274C40.4239 20.4987 41.1794 19.5672 42.2493 19.4468C42.256 19.446 42.2628 19.4453 42.2696 19.4446L47.0109 18.9597M50.9138 18.8333L55.413 18.3696L50.9138 18.8333Z' | ||
fill='white' | ||
/> | ||
<path | ||
d='M105.592 12.9072C105.49 12.2242 104.853 11.7462 104.169 11.8396C103.485 11.9331 103.014 12.5625 103.115 13.2454L105.592 12.9072ZM113.835 76.7423L115.075 76.5913C115.075 76.5852 115.074 76.5792 115.073 76.5732L113.835 76.7423ZM114.691 83.1291L115.931 82.978L114.691 83.1291ZM111.316 87.2904L111.47 88.5307L111.316 87.2904ZM54.1699 93.7185L54.3247 94.9588L54.1699 93.7185ZM49.7963 90.4288L51.0371 90.2777L49.7963 90.4288ZM40.5618 21.5274L39.321 21.6785L40.5618 21.5274ZM42.2696 19.4446L42.4117 20.6863L42.2696 19.4446ZM47.1531 20.2013C47.8399 20.1311 48.3331 19.5182 48.2546 18.8325C48.1761 18.1467 47.5556 17.6477 46.8687 17.718L47.1531 20.2013ZM50.7707 17.5918C50.0838 17.6626 49.5911 18.2758 49.6702 18.9615C49.7493 19.6472 50.3701 20.1457 51.057 20.0749L50.7707 17.5918ZM55.5561 19.6111C56.243 19.5403 56.7356 18.9271 56.6566 18.2414C56.5775 17.5557 55.9566 17.0572 55.2698 17.128L55.5561 19.6111ZM103.115 13.2454L112.596 76.9115L115.073 76.5732L105.592 12.9072L103.115 13.2454ZM112.594 76.8934L113.45 83.2802L115.931 82.978L115.075 76.5913L112.594 76.8934ZM113.45 83.2802C113.628 84.6061 112.654 85.8821 111.161 86.05L111.47 88.5307C114.257 88.2173 116.305 85.7672 115.931 82.978L113.45 83.2802ZM111.161 86.05L54.0152 92.4781L54.3247 94.9588L111.47 88.5307L111.161 86.05ZM54.0152 92.4781C52.5145 92.647 51.2162 91.6137 51.0371 90.2777L48.5556 90.5799C48.9281 93.359 51.5459 95.2714 54.3247 94.9588L54.0152 92.4781ZM51.0371 90.2777L41.8025 21.3764L39.321 21.6785L48.5556 90.5799L51.0371 90.2777ZM41.8025 21.3764C41.7627 21.0792 41.9808 20.7347 42.404 20.6871L42.0946 18.2065C40.378 18.3996 39.0851 19.9181 39.321 21.6785L41.8025 21.3764ZM42.404 20.6871C42.4066 20.6868 42.4091 20.6866 42.4117 20.6863L42.1274 18.203C42.1164 18.2041 42.1055 18.2053 42.0946 18.2065L42.404 20.6871ZM42.4117 20.6863L47.1531 20.2013L46.8687 17.718L42.1274 18.203L42.4117 20.6863ZM51.057 20.0749L55.5561 19.6111L55.2698 17.128L50.7707 17.5918L51.057 20.0749Z' | ||
fill='#9D9D9D' | ||
/> | ||
<path | ||
fill-rule='evenodd' | ||
clip-rule='evenodd' | ||
d='M102.269 17.0662L110.537 74.5056L111.281 80.2681C111.52 82.1245 110.151 83.812 108.223 84.0372L56.723 90.0527C54.7947 90.278 53.0373 88.9557 52.7977 87.0993L44.8107 25.2179C44.6693 24.1224 45.4441 23.1305 46.5412 23.0023L52.8752 22.2625' | ||
fill='#E9E9E9' | ||
/> | ||
<path | ||
d='M59.8496 4C59.8496 2.48122 61.0808 1.25 62.5996 1.25H107.295C108 1.25 108.678 1.521 109.189 2.00697L122.291 14.4629C122.837 14.982 123.146 15.7024 123.146 16.4559V74.4746C123.146 75.9934 121.915 77.2246 120.396 77.2246H62.5996C61.0808 77.2246 59.8496 75.9934 59.8496 74.4746V4Z' | ||
fill='white' | ||
stroke='#FF4D3F' | ||
stroke-width='2.5' | ||
/> | ||
<path | ||
d='M107.701 2.24219V13.0765C107.701 14.6244 109.02 15.8792 110.647 15.8792H121.5' | ||
stroke='#FF4D3F' | ||
stroke-width='2.5' | ||
stroke-linecap='round' | ||
stroke-linejoin='round' | ||
/> | ||
<path | ||
d='M70 64H95.3953M70 20H95.3953H70ZM70 30.3529H112H70ZM70 41.5686H112H70ZM70 52.7843H112H70Z' | ||
stroke='#E9E9E9' | ||
stroke-width='2.5' | ||
stroke-linecap='round' | ||
stroke-linejoin='round' | ||
/> | ||
</svg> |
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
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
23 changes: 23 additions & 0 deletions
23
app/components/project-settings/dast-scenario-toggle/index.hbs
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,23 @@ | ||
<AkStack | ||
@alignItems='center' | ||
@justifyContent='flex-end' | ||
@spacing='1' | ||
class='pr-2' | ||
> | ||
<AkToggle | ||
@size='small' | ||
@checked={{@scenario.isActive}} | ||
@onChange={{this.toggleScenarioStatus}} | ||
@disabled={{this.updateScenarioStatus.isRunning}} | ||
{{on 'click' this.handleToggleClick}} | ||
{{style margin='0px'}} | ||
data-test-projectSettings-dastScenario-toggle | ||
/> | ||
|
||
{{#if this.updateScenarioStatus.isRunning}} | ||
<AkLoader | ||
@size={{14}} | ||
data-test-projectSettings-dastScenario-statusToggleLoading | ||
/> | ||
{{/if}} | ||
</AkStack> |
53 changes: 53 additions & 0 deletions
53
app/components/project-settings/dast-scenario-toggle/index.ts
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,53 @@ | ||
import Component from '@glimmer/component'; | ||
import { task } from 'ember-concurrency'; | ||
import { inject as service } from '@ember/service'; | ||
import { action } from '@ember/object'; | ||
import IntlService from 'ember-intl/services/intl'; | ||
|
||
import ScanParameterGroupModel from 'irene/models/scan-parameter-group'; | ||
import ProjectModel from 'irene/models/project'; | ||
import parseError from 'irene/utils/parse-error'; | ||
|
||
export interface ProjectSettingsDastScenarioStatusToggleSignature { | ||
Args: { | ||
project?: ProjectModel | null; | ||
scenario: ScanParameterGroupModel; | ||
}; | ||
} | ||
|
||
export default class ProjectSettingsDastScenarioStatusToggleComponent extends Component<ProjectSettingsDastScenarioStatusToggleSignature> { | ||
@service declare intl: IntlService; | ||
@service('notifications') declare notify: NotificationService; | ||
|
||
get scenario() { | ||
return this.args.scenario; | ||
} | ||
|
||
@action handleToggleClick(event: Event) { | ||
event.stopPropagation(); | ||
} | ||
|
||
@action toggleScenarioStatus(_: Event, checked?: boolean) { | ||
this.updateScenarioStatus.perform(!!checked); | ||
} | ||
|
||
updateScenarioStatus = task(async (checked: boolean) => { | ||
try { | ||
this.scenario.set('isActive', checked); | ||
|
||
const adapterOptions = { projectId: this.args.project?.id }; | ||
await this.scenario.save({ adapterOptions }); | ||
|
||
this.notify.success(this.intl.t('dastAutomation.scenarioStatusUpdated')); | ||
} catch (error) { | ||
this.scenario.set('isActive', !checked); | ||
this.notify.error(parseError(error)); | ||
} | ||
}); | ||
} | ||
|
||
declare module '@glint/environment-ember-loose/registry' { | ||
export default interface Registry { | ||
'ProjectSettings::DastScenarioToggle': typeof ProjectSettingsDastScenarioStatusToggleComponent; | ||
} | ||
} |
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
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
Oops, something went wrong.