Skip to content

Commit

Permalink
fix project settings deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
future-pirate-king committed Oct 15, 2024
1 parent f77e133 commit 7117c9a
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default class ProjectSettingsAnalysisSettingsVulnerabilityListComponent e
}

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

get vulnerability() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class ProjectSettingsGeneralSettingsCollaboratorsTableComponent e

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

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

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

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

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

get hasJIRAProject() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion app/components/project-settings/view-scenario/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
10 changes: 5 additions & 5 deletions app/models/dynamicscan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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
Expand All @@ -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')
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion app/models/github-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
2 changes: 1 addition & 1 deletion app/models/jira-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
6 changes: 3 additions & 3 deletions app/models/scan-parameter-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
4 changes: 2 additions & 2 deletions app/models/scan-parameter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down

0 comments on commit 7117c9a

Please sign in to comment.