Skip to content

Commit 6ee6554

Browse files
author
Elliot Yibaebi
committed
complete service now integration
1 parent 7c24b72 commit 6ee6554

File tree

88 files changed

+4924
-2566
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+4924
-2566
lines changed

app/adapters/servicenow-config.ts

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/* eslint-disable ember/use-ember-data-rfc-395-imports */
2+
import CommondrfNestedAdapter from './commondrf-nested';
3+
import Store, { type Snapshot } from '@ember-data/store';
4+
import type { ModelSchema } from 'ember-data';
5+
import type ModelRegistry from 'ember-data/types/registries/model';
6+
import type ServiceNowConfigModel from 'irene/models/servicenow-config';
7+
8+
export default class ServiceNowConfigAdapter extends CommondrfNestedAdapter {
9+
_buildURL() {
10+
return this.buildURLFromBase(`${this.namespace}/servicenow`);
11+
}
12+
13+
updateRecord<K extends keyof ModelRegistry>(
14+
_: Store,
15+
_type: ModelSchema<K>,
16+
snapshot: Snapshot<K>
17+
) {
18+
const { riskThreshold } = snapshot.record as ServiceNowConfigModel;
19+
const url = this._buildURL();
20+
21+
return this.ajax(url, 'POST', {
22+
data: { risk_threshold: riskThreshold },
23+
});
24+
}
25+
26+
setNestedUrlNamespace(projectId: string) {
27+
this.namespace = `/api/projects/${projectId}`;
28+
}
29+
}
30+
31+
declare module 'ember-data/types/registries/adapter' {
32+
export default interface AdapterRegistry {
33+
'servicenow-config': ServiceNowConfigAdapter;
34+
}
35+
}

app/components/github-account/index.hbs

-71
This file was deleted.

app/components/github-account/index.scss

-29
This file was deleted.

app/components/jira-account/index.hbs

-102
This file was deleted.

app/components/jira-account/index.scss

-29
This file was deleted.

app/components/marketplace/integration-list/index.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,20 @@ export default class MarketplaceIntegrationListComponent extends Component {
1111
title: this.intl.t('github'),
1212
description: this.intl.t('integrateAppknoxTo') + this.intl.t('github'),
1313
logo: '../images/github-icon.png',
14-
link: 'authenticated.dashboard.organization-settings',
14+
link: 'authenticated.dashboard.organization-settings.integrations',
1515
},
1616
{
1717
title: this.intl.t('jira'),
1818
description: this.intl.t('integrateAppknoxTo') + this.intl.t('jira'),
1919
logo: '../images/jira-icon.png',
20-
link: 'authenticated.dashboard.organization-settings',
20+
link: 'authenticated.dashboard.organization-settings.integrations',
21+
},
22+
{
23+
title: this.intl.t('serviceNow.title'),
24+
description:
25+
this.intl.t('integrateAppknoxTo') + this.intl.t('serviceNow.title'),
26+
logo: '../images/service-now.png',
27+
link: 'authenticated.dashboard.organization-settings.integrations',
2128
},
2229
{
2330
title: this.intl.t('slack'),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<AkTypography
2+
data-test-githubAccount-title
3+
@variant='h5'
4+
@gutterBottom={{true}}
5+
>
6+
{{t 'githubIntegration'}}
7+
</AkTypography>
8+
9+
{{#if this.integratedUser}}
10+
<Organization::Integrations::IntegratedUi
11+
@imageSource='/images/github-icon.png'
12+
@imageAlt='Github icon'
13+
@hostURL='https://github.com'
14+
@username={{this.integratedUser.login}}
15+
@onDisconnectClick={{this.openRevokeGithubConfirmBox}}
16+
/>
17+
18+
{{else}}
19+
<AkTypography
20+
data-test-githubAccount-desc
21+
@variant='body2'
22+
@color='textSecondary'
23+
>
24+
{{#if @reconnect}}
25+
{{t 'integrationFailed'}}
26+
{{else}}
27+
{{t 'githubIntegrationDesc'}}
28+
{{/if}}
29+
</AkTypography>
30+
31+
<AkButton
32+
data-test-githubAccount-integrateBtn
33+
class='my-2'
34+
@loading={{this.integrateGithub.isRunning}}
35+
{{on 'click' (perform this.integrateGithub)}}
36+
>
37+
{{if @reconnect (t 'reconnect') (t 'integrateGithub')}}
38+
</AkButton>
39+
{{/if}}
40+
41+
<ConfirmBox
42+
@delegate={{this}}
43+
@disabled={{this.removeIntegration.isRunning}}
44+
@isActive={{this.showRevokeGithubConfirmBox}}
45+
@description={{t 'confirmBox.revokeGithub'}}
46+
@confirmText={{t 'disconnect'}}
47+
/>

0 commit comments

Comments
 (0)