Skip to content

Commit

Permalink
Merge pull request #2369 from abhishek-K-P/sprint-16-dev
Browse files Browse the repository at this point in the history
Sprint 16 dev
  • Loading branch information
abhishek-K-P authored Jul 27, 2024
2 parents 3c6142b + 73ae986 commit 63058d6
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,10 @@ export class WidgetContentService {
if (content.endDate) {
urlData.queryParams = { ...urlData.queryParams, planType: 'cbPlan', endDate: content.endDate }
}
if (content.contentId && content.contentId.includes('ext_')) {
urlData.url = `/app/toc/ext/${content.contentId}`
urlData.queryParams = {}
}
return urlData
}
isBatchInProgress(batchData: any) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
</div>
</div> -->
<div class="flex flex-col gap-1" *ngIf="scrolled">
<div class="text-xl leading-6 text-white font-bold truncate-5">{{ handleCapitalize(extContentReadData?.name) }}
<div class="text-xl leading-6 text-white font-bold text-scrol-custom">{{ handleCapitalize(extContentReadData?.name) }}
</div>
<div class="text-sm source-text font-semibold break-words" #contentSource [ngClass]="{'sourceEllipsis': sourceEllipsis}" title="{{content?.source}}">
{{ 'cardcontentv2.by' | translate }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@
}
}

.text-scrol-custom {
height: 200px;
overflow-y: auto;
}

@media screen and (max-width: 1000px) {
.confirmation-modal, .enroll-modal {
max-width: 90vw !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
{{ content?.lastUpdatedOn | date: 'dd-MMM-yyyy' }}
</li>
<li *ngIf="content?.duration">
<img src="/assets/icons/content/separator.svg"> {{ content?.duration | pipeDurationTransform: 'hms' }}
<img src="/assets/icons/content/separator.svg"> {{ checkForCiosDuration(content) | pipeDurationTransform: 'hms' }}
</li>
<!-- <li><img src="/assets/icons/content/separator.svg"> Ratings</li> -->
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ export class LearnSearchComponent implements OnInit, OnChanges, OnDestroy {
fuzzy: false,
},
}
extSearchRequestObject = {
filterCriteriaMap: {
},
requestedFields: [],
pageNumber: 0,
pageSize: 50,
facets: [
'topic',
],
orderBy: 'createdOn',
orderDirection: 'desc',
searchString: '',
}
totalResults: any
defaultThumbnail = ''
myFilters: any = []
Expand Down Expand Up @@ -374,7 +387,7 @@ export class LearnSearchComponent implements OnInit, OnChanges, OnDestroy {
data.request.filters = { ...data.request.filters, 'secureSettings.organisation': orgId }
}
this.searchResults = []
this.searchSrvc.fetchSearchDataByCategory(data).subscribe((response: any) => {
this.searchSrvc.fetchSearchDataByCategory(data).subscribe(async (response: any) => {
if (response && response.result && response.result.count) {
response.result.content.forEach((res: any) => {
if (res.courseCategory === NsContent.ECourseCategory.MODERATED_COURSE ||
Expand All @@ -396,7 +409,14 @@ export class LearnSearchComponent implements OnInit, OnChanges, OnDestroy {
})
this.searchResults = response.result.content
}
this.totalResults = response.result.count
this.extSearchRequestObject.searchString = data.request.query
const resExtSearch = await this.searchSrvc.fetchSearchDataforCios(this.extSearchRequestObject).toPromise().catch(_error => {})
if (resExtSearch && resExtSearch.data && resExtSearch.data.length > 0) {
resExtSearch.data.forEach((ele: any) => {
this.searchResults.unshift(ele)
})
}
this.totalResults = (response.result.count) ? response.result.count : this.searchResults.length
// this.facets = response.result.facets
this.primaryCategoryType = []
this.contentType = []
Expand Down Expand Up @@ -465,4 +485,11 @@ export class LearnSearchComponent implements OnInit, OnChanges, OnDestroy {
queryParams: urlData.queryParams,
})
}

checkForCiosDuration(item: any) {
if (item && item.contentId && item.contentId.includes('ext_')) {
return item.duration * 60
}
return item.duration
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { SearchApiService } from '../../search/apis/search-api.service'
const API_END_POINTS = {
SEARCH_V6: `/apis/proxies/v8/sunbirdigot/search`,
SEARCH_V4: `/apis/proxies/v8/sunbirdigot/v4/search`,
SEARCH_EXT_CONTENT: `/apis/proxies/v8/cios/v1/search/content`,
}

@Injectable({
Expand All @@ -33,6 +34,9 @@ export class GbSearchService {
fetchSearchDataByCategory(request: any): Observable<any> {
return this.http.post<any>(API_END_POINTS.SEARCH_V4, request)
}
fetchSearchDataforCios(request: any): Observable<any> {
return this.http.post<any>(API_END_POINTS.SEARCH_EXT_CONTENT, request)
}
public notifyOther(data: any) {
if (data) {
this.removeFilter.next(data)
Expand Down

0 comments on commit 63058d6

Please sign in to comment.