Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix project settings deprecation
Browse files Browse the repository at this point in the history
future-pirate-king committed Oct 17, 2024
1 parent 3e58742 commit 6d6bc6b
Showing 13 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ export default class ProjectSettingsAnalysisSettingsVulnerabilityListComponent e
}

get vulnerabilityPreferences() {
return this.vulnerabilityListResponse?.toArray() || [];
return this.vulnerabilityListResponse?.slice() || [];
}

get vulnerability() {
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ export default class ProjectSettingsGeneralSettingsAddProjectCollaboratorTableCo
}

get orgMembers() {
return this.orgMemberRecordResponse?.toArray().sortBy('created:desc') || [];
return this.orgMemberRecordResponse?.slice().sortBy('created:desc') || [];
}

get hasNoOrgMembers() {
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ export default class ProjectSettingsGeneralSettingsAddProjectTeamTableComponent
}

get organizationTeams() {
return this.orgTeamRecordResponse?.toArray().sortBy('created:desc') || [];
return this.orgTeamRecordResponse?.slice().sortBy('created:desc') || [];
}

get hasNoOrgTeams() {
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ export default class ProjectSettingsGeneralSettingsCollaboratorsTableComponent e

get projectCollaborators() {
return (
this.projectCollaboratorsResponse?.toArray().sortBy('created:desc') || []
this.projectCollaboratorsResponse?.slice().sortBy('created:desc') || []
);
}

Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ export default class ProjectSettingsGeneralSettingsDyanmicscanAutomationSettings
}

get scenarioList() {
return this.projectScenarios?.toArray() || [];
return this.projectScenarios?.slice() || [];
}

@action reloadProjectScenarios() {
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ export default class ProjectSettingsGeneralSettingsJiraProjectComponent extends
}

get jiraProjects() {
return this.jiraProjectsResponse?.toArray() || [];
return this.jiraProjectsResponse?.slice() || [];
}

get hasJIRAProject() {
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ export default class ProjectSettingsGeneralSettingsProjectTeamTableComponent ext
}

get projectTeamList() {
return this.projectTeamListResponse?.toArray().sortBy('created:desc') || [];
return this.projectTeamListResponse?.slice().sortBy('created:desc') || [];
}

get hasNoProjectTeams() {
2 changes: 1 addition & 1 deletion app/components/project-settings/view-scenario/index.ts
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ export default class ProjectSettingsViewScenarioComponent extends Component<Proj
})
);

this.parameterList = parameterList.toArray();
this.parameterList = parameterList.slice();
} catch (error) {
this.notify.error(parseError(error));
}
10 changes: 5 additions & 5 deletions app/models/dynamicscan.ts
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ export default class DynamicscanModel extends Model {
@service declare intl: IntlService;

// Generic dynamic scan info
@belongsTo('file', { async: true })
@belongsTo('file', { async: true, inverse: null })
declare file: AsyncBelongsTo<FileModel>;

@attr('number')
@@ -22,10 +22,10 @@ export default class DynamicscanModel extends Model {
declare status: number;

// User actions
@belongsTo('user', { async: true })
@belongsTo('user', { async: true, inverse: null })
declare startedByUser: AsyncBelongsTo<UserModel>;

@belongsTo('user', { async: true })
@belongsTo('user', { async: true, inverse: null })
declare stoppedByUser: AsyncBelongsTo<UserModel>;

// Scan user preferences
@@ -38,7 +38,7 @@ export default class DynamicscanModel extends Model {
@attr('string')
declare platformVersion: string;

@belongsTo('scan-parameter-group')
@belongsTo('scan-parameter-group', { async: true, inverse: null })
declare scanParameterGroups: AsyncBelongsTo<ScanParameterModel>;

@attr('boolean')
@@ -91,7 +91,7 @@ export default class DynamicscanModel extends Model {
@attr('number')
declare time: number;

@belongsTo('available-device')
@belongsTo('available-device', { async: true, inverse: null })
declare availableDevice: AsyncBelongsTo<AvailableDeviceModel>;

async extendTime(time: number) {
2 changes: 1 addition & 1 deletion app/models/github-repo.ts
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ export default class GithubRepoModel extends Model {
@attr()
declare repoDetails: GithubRepoDetails;

@belongsTo('project')
@belongsTo('project', { async: true, inverse: null })
declare project: AsyncBelongsTo<ProjectModel>;
}

2 changes: 1 addition & 1 deletion app/models/jira-repo.ts
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ export default class JiraRepoModel extends Model {
@attr('number')
declare risk_threshold: number;

@belongsTo('project')
@belongsTo('project', { async: true, inverse: null })
declare project: AsyncBelongsTo<ProjectModel>;
}

6 changes: 3 additions & 3 deletions app/models/scan-parameter-group.ts
Original file line number Diff line number Diff line change
@@ -29,13 +29,13 @@ export default class ScanParameterGroupModel extends Model {
@attr('date')
declare updatedOn: Date;

@belongsTo('project')
@belongsTo('project', { async: true, inverse: null })
declare project: AsyncBelongsTo<ProjectModel>;

@belongsTo('user')
@belongsTo('user', { async: true, inverse: null })
declare lastUpdatedBy: AsyncBelongsTo<UserModel> | null;

@hasMany('scan-parameter', { inverse: 'scanParameterGroup' })
@hasMany('scan-parameter', { inverse: 'scanParameterGroup', async: true })
declare scanParameters: AsyncHasMany<ScanParameterModel>;
}

4 changes: 2 additions & 2 deletions app/models/scan-parameter.ts
Original file line number Diff line number Diff line change
@@ -19,10 +19,10 @@ export default class ScanParameterModel extends Model {
@attr('date')
declare updatedOn: Date;

@belongsTo('user')
@belongsTo('user', { async: true, inverse: null })
declare lastUpdatedBy: AsyncBelongsTo<UserModel> | null;

@belongsTo('scan-parameter-group', { inverse: 'scanParameters' })
@belongsTo('scan-parameter-group', { inverse: 'scanParameters', async: true })
declare scanParameterGroup: AsyncBelongsTo<ScanParameterGroupModel>;
}

0 comments on commit 6d6bc6b

Please sign in to comment.