@brightspace-hmc/siren-sdk
Advanced tools
Comparing version 2.28.0 to 2.29.0
{ | ||
"name": "@brightspace-hmc/siren-sdk", | ||
"version": "2.28.0", | ||
"version": "2.29.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "", |
@@ -722,3 +722,5 @@ export const Rels = { | ||
sisCourseMerge: { | ||
searchCourseOfferings: 'Search-Course-Offerings' | ||
searchCourseOfferings: 'Search-Course-Offerings', | ||
select: 'select', | ||
deselect: 'deselect' | ||
} | ||
@@ -725,0 +727,0 @@ }, |
@@ -28,2 +28,6 @@ /** | ||
selectedCount() { | ||
return this._entity?.properties?.selectedCount; | ||
} | ||
totalCount() { | ||
@@ -30,0 +34,0 @@ return this._pagingInfo()?.totalCount; |
@@ -5,5 +5,6 @@ /** | ||
*/ | ||
import { Actions, Rels } from '../../hypermedia-constants.js'; | ||
import { Entity } from '../../es6/Entity.js'; | ||
import { OrganizationEntity } from '../../organizations/OrganizationEntity.js'; | ||
import { Rels } from '../../hypermedia-constants.js'; | ||
import { performSirenAction } from '../../es6/SirenAction.js'; | ||
@@ -32,2 +33,48 @@ export class CourseMergeOfferingEntity extends Entity { | ||
} | ||
hasSelectAction() { | ||
return this._entity?.hasActionByName(Actions.ipsis.sisCourseMerge.select); | ||
} | ||
hasDeselectAction() { | ||
return this._entity?.hasActionByName(Actions.ipsis.sisCourseMerge.deselect); | ||
} | ||
getSelectAction() { | ||
if (!this.hasSelectAction()) { | ||
return; | ||
} | ||
return this._entity.getActionByName(Actions.ipsis.sisCourseMerge.select); | ||
} | ||
getDeselectAction() { | ||
if (!this.hasDeselectAction()) { | ||
return; | ||
} | ||
return this._entity.getActionByName(Actions.ipsis.sisCourseMerge.deselect); | ||
} | ||
async select() { | ||
const action = this.getSelectAction(); | ||
if (!action) { | ||
return; | ||
} | ||
return await performSirenAction(this._token, action, null, true); | ||
} | ||
async deselect() { | ||
const action = this.getDeselectAction(); | ||
if (!action) { | ||
return; | ||
} | ||
return await performSirenAction(this._token, action, null, true); | ||
} | ||
updateEntity(entity) { | ||
this._entity = entity; | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
341715
9428