Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #SB-28144 : fix #265

Open
wants to merge 48 commits into
base: release-4.9.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
299257c
Create LICENSE
madhucr Jun 9, 2021
a2c398b
Merge pull request #2327 from Sunbird-Ed/add-license-1
swayangjit Jun 10, 2021
e3246f9
Issue #SB-000 merge: Merge branch 'release-4.0.0' into master
swayangjit Jul 14, 2021
6dcf5fa
Issue #SB-000 merge : Merge pull request #2403 from swayangjit/master
swayangjit Jul 14, 2021
87c24c1
Issue #SB-000 merge: Merge branch 'release-4.4.0' into master
swayangjit Jan 12, 2022
c16d81e
Issue #SB-000 merge: Merge branch 'release-4.4.1' into master
swayangjit Jan 12, 2022
0ae96d8
Issue #SB-000 merge: Merge branch 'release-4.4.2' into master
swayangjit Jan 12, 2022
f90c0e5
Issue #SB-000 merge: Merge pull request #2787 from swayangjit/master
swayangjit Jan 13, 2022
85f55e2
Merge branch 'release-4.7.0' of https://github.com/shikshalokam/Sunbi…
Feb 15, 2022
194b27f
Issue #SB-28129 feat: angular 10 migration
balakrishna10 Feb 15, 2022
304a475
Issue #SB-28129 feat: angular 10 migration
balakrishna10 Feb 15, 2022
62ea7e1
Issue SB-28686 fix: QA issue fix
Feb 15, 2022
1982141
Issue #SB-28129 feat: angular 11 migration
balakrishna10 Feb 16, 2022
5abdb8d
Issue #SB-28129 merge: Merge pull request #2828 from balakrishna10/r…
swayangjit Feb 16, 2022
21d473b
Issue SB-28325 feat : Add evidence to task and project
vishwaSuresh Feb 18, 2022
1d5e82d
Issue SB-28356" feat: Files option in project
Feb 21, 2022
fd230a1
Issue SB-28356" feat: Files option in project
Feb 21, 2022
ce10170
minor edits
Feb 21, 2022
80978ea
minor edits
Feb 21, 2022
15b9536
issue SB-28356 review edits
Feb 21, 2022
326c9d0
Merge pull request #256 from afnantl/release-4.8.0
kiranharidas187 Feb 21, 2022
9a55b5c
Issue #SB-28309 : fix : made checkmark icon appear for completed task…
apigeoneer Feb 23, 2022
8d31428
Issue #SB-28325 feat : Add files task and project level
vishwaSuresh Feb 23, 2022
94f0436
Merge branch 'release-4.8.0' into SB-28325
vishwaSuresh Feb 23, 2022
de3525f
Issue #SB-28309 : fix : 'observe again' button fix
apigeoneer Feb 24, 2022
a8f884c
Merge pull request #257 from apigeoneer/sb-28309
kiranharidas187 Feb 24, 2022
84c3260
Issue SB-28325 PR comments resolved
vishwaSuresh Feb 25, 2022
36c3604
Merge branch 'release-4.8.0' into master
kiranharidas187 Feb 25, 2022
46f7526
Merge pull request #253 from afnantl/master
kiranharidas187 Feb 25, 2022
be2a7b6
Issue SB-28325 feat: Task attachments delete
vishwaSuresh Feb 25, 2022
53dd399
Issue #SB-28325 feat : Attachment list for tasks
vishwaSuresh Mar 2, 2022
f34562c
Issue #SB-28716 : fix : project sync just after a project is created
rejneesh1 Mar 3, 2022
14e60e3
Issue #SB-28325 feat:Project level evidences
vishwaSuresh Mar 4, 2022
030c7d9
Issue SB-28325 feat: project level evidence upload
vishwaSuresh Mar 7, 2022
c73b305
Issue SB-28325 feat: project level evidence upload
vishwaSuresh Mar 7, 2022
2e5bd97
Issue #SB-28716 : fix : newly created project appears in the created …
rejneesh1 Mar 8, 2022
5d28268
Issue #SB-28716 : fix : removed unnecessary code
rejneesh1 Mar 8, 2022
a0001d6
Issue SB-28325 feat: PR comments
vishwaSuresh Mar 8, 2022
2e850dd
Merge pull request #258 from shikshalokam/SB-28325
kiranharidas187 Mar 8, 2022
a3797ea
Issue #SB-26450 fix : The entity added from search bar as well as sel…
5Amogh Mar 8, 2022
0232271
Issue #SB-28716 : fix : removed setting isAPrivateProgram & link keys…
rejneesh1 Mar 8, 2022
7cae9a3
Merge pull request #255 from apigeoneer/release-4.8.0
kiranharidas187 Mar 9, 2022
853a136
Merge pull request #261 from 5Amogh/SB-26450
kiranharidas187 Mar 9, 2022
46762c2
Issue #SB-28106 : fix : fixed the background of observation report s…
rejneesh1 Mar 9, 2022
f42b2b1
Merge branch 'release-4.9.0' of https://github.com/apigeoneer/Sunbird…
rejneesh1 Mar 11, 2022
100f52f
Issue #SB-28144 : fix : child question old response doesn't reappear …
rejneesh1 Mar 11, 2022
87599a6
Issue #SB-28144 : fix : corrected irrelevant changes
rejneesh1 Mar 11, 2022
ebf82fc
Issue #SB-28144 : fix : corrected irrelevant changes
rejneesh1 Mar 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Sunbird for Education

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
"styleext": "scss"
},
"@schematics/angular:component": {
"styleext": "scss"
"style": "scss"
}
}
}
5,193 changes: 3,081 additions & 2,112 deletions package-lock.json

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
"dependencies": {
"@angular-builders/custom-webpack": "^8.4.1",
"@angular-builders/dev-server": "^7.3.1",
"@angular/animations": "^9.1.13",
"@angular/common": "^9.1.13",
"@angular/core": "^9.1.13",
"@angular/forms": "^9.1.13",
"@angular/platform-browser": "^9.1.13",
"@angular/platform-browser-dynamic": "^9.1.13",
"@angular/router": "^9.1.13",
"@angular/animations": "^11.2.14",
"@angular/common": "^11.2.14",
"@angular/core": "^11.2.14",
"@angular/forms": "^11.2.14",
"@angular/platform-browser": "^11.2.14",
"@angular/platform-browser-dynamic": "^11.2.14",
"@angular/router": "^11.2.14",
"@ionic-native/android-permissions": "^5.30.0",
"@ionic-native/app-version": "^5.15.1",
"@ionic-native/camera": "^5.30.0",
Expand Down Expand Up @@ -164,7 +164,7 @@
"sb-notification": "0.0.2",
"sb-svg2pdf": "0.0.10",
"sb-tag-manager": "^3.9.19",
"tslib": "^1.10.0",
"tslib": "^2.0.0",
"uk.co.workingedge.phonegap.plugin.istablet": "^1.2.0",
"uuid": "^3.4.0",
"video.js": "7.4.1",
Expand All @@ -183,12 +183,12 @@
"ionic_enable_lint": false
},
"devDependencies": {
"@angular-devkit/architect": "^0.901.15",
"@angular-devkit/build-angular": "~0.901.15",
"@angular/cli": "~9.1.15",
"@angular/compiler": "~9.1.13",
"@angular/compiler-cli": "~9.1.13",
"@angular/language-service": "~9.1.13",
"@angular-devkit/architect": "^0.1102.18",
"@angular-devkit/build-angular": "~0.1102.18",
"@angular/cli": "~11.2.18",
"@angular/compiler": "~11.2.14",
"@angular/compiler-cli": "~11.2.14",
"@angular/language-service": "~11.2.14",
"@angularclass/hmr": "^2.1.3",
"@babel/core": "^7.5.5",
"@babel/plugin-proposal-class-properties": "^7.5.5",
Expand All @@ -212,8 +212,8 @@
"sonarqube-scanner": "^2.5.0",
"tiny-glob": "^0.2.9",
"ts-node": "^8.4.1",
"tslint": "~5.16.0",
"typescript": "~3.8.3"
"tslint": "~6.1.0",
"typescript": "~4.0.8"
},
"description": "An Ionic project",
"cordova": {
Expand Down
3 changes: 2 additions & 1 deletion scripts/deleteUnUsableIosIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function deleteUnUsableIosIcon(ionicIconFilePath) {
'newspaper.svg',
'attach.svg',
'image.svg',
'images.svg',
'map.svg',
'book.svg',
'checkmark-circle.svg',
Expand Down Expand Up @@ -132,7 +133,7 @@ function deleteUnUsableIosIcon(ionicIconFilePath) {
"sync-circle.svg",
"arrow-up-circle-outline.svg",
"arrow-down-circle-outline.svg",
"caret-forward-circle.svg"
"caret-forward-circle.svg",
].includes(file))) {
fs.unlinkSync(ionicIconFilePath + '/' + file);
}
Expand Down
23 changes: 21 additions & 2 deletions src/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2163,7 +2163,19 @@ app-user-home{
}
}

app-metadata-details{
app-add-file {
.icon-style{
border-radius: 50%;
padding: 10px;
background-image: linear-gradient( #dce7f3 50%, #adc3dd 100% );
box-shadow: 1px 3px 4px #666666;
}
.btn-space-btwn{
display: flex;
justify-content: space-between;
}
}
app-metadata-details,app-add-file {
.progress-bar-style{
height: 10px;
border-radius: 16px;
Expand Down Expand Up @@ -2307,4 +2319,11 @@ app-metadata-details{
text-transform: none;
}
}
}
.attachment-delete-alert{
background-color: red;
ion-button{
color:#adc3dd;
--color:green;
}
}
}
2 changes: 1 addition & 1 deletion src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const routes: Routes = [

@NgModule({
imports: [
RouterModule.forRoot(routes)
RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' })
],
exports: [RouterModule],
providers: [
Expand Down
2 changes: 2 additions & 0 deletions src/app/app.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,8 @@ export class RouterLinks {
public static readonly PROJECT_OPERATION_PAGE = `/${RouterLinks.PROJECT}/${RouterLinks.PROJECT_OPERATION}`;
public static readonly CREATE_PROJECT_PAGE = `/${RouterLinks.PROJECT}/${RouterLinks.CREATE_PROJECT}`;
public static readonly ATTACHMENTS_LIST = `/${RouterLinks.PROJECT}/${RouterLinks.ATTACHMENTS}`;
public static readonly ADD_FILE='add-file';
public static readonly ATTACHMENTS_LISTING = 'attachment-listing';


public static readonly SOLUTIONS = 'solutions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ export class CollectionDetailEtbPage implements OnInit {
this.subscribeSdkEvent();
});
this.ionContent.ionScroll.subscribe((event) => {
this.scrollPosition = event.scrollTop;
this.scrollPosition = event['scrollTop'];
});

this.events.subscribe(EventTopics.DEEPLINK_COLLECTION_PAGE_OPEN, (data) => {
Expand Down
33 changes: 33 additions & 0 deletions src/app/manage-learn/core/constants/actions.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,38 @@ export const actions = {
action: "files",
color: 'primary'
}
],

TASK_FILE_DESCRIPTION:{
label:'FRMELEMNTS_LBL_TASK_ATTACHMENTS_DESCRIPTION'
},
PROJECT_FILE_DESCRIPTION:{
label:'FRMELEMNTS_LBL_PROJECT_ATTACHMENTS_DESCRIPTION'
},
FILE_UPLOAD_OPTIONS:[
{
title: "CAMERA",
icon: "camera",
action: "openCamera",
color: 'primary'
},
{
title: "GALLERY",
icon: "images",
action: "openGallery",
color: 'primary'
},
{
title: "FILES",
icon: "document",
action: "openFiles",
color: 'primary'
},
{
title: "LINKS",
icon: "link-outline",
action: "openLink",
color: 'primary'
}
]
}
27 changes: 27 additions & 0 deletions src/app/manage-learn/core/guards/deactivate.guard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Injectable } from '@angular/core';

import { ActivatedRouteSnapshot,CanDeactivate, RouterStateSnapshot } from '@angular/router';

import { Observable } from 'rxjs';
import { AddFilePage } from '../../project/add-file/add-file.page';

@Injectable({
providedIn: 'root'
})
export class DeactivateGuard implements CanDeactivate<any>
{
component: Object;
route: ActivatedRouteSnapshot;

constructor(){
}

canDeactivate(component:AddFilePage,
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
nextState: RouterStateSnapshot) : Observable<any> | Promise<any> | any {
return !component.exitPage ? component.pageExitConfirm() : true;

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import { FILE_EXTENSION_HEADERS } from "../../constants";
export class AttachmentService {
mediaType: string;
texts: any;

payload : any;
actionSheetOpen : boolean = false;
constructor(
private camera: Camera,
private file: File,
Expand Down Expand Up @@ -41,6 +42,7 @@ export class AttachmentService {
}

async selectImage() {
this.actionSheetOpen = true
const actionSheet = await this.actionSheetController.create({
header: this.texts["FRMELEMNTS_MSG_SELECT_IMAGE_SOURCE"],
cssClass: 'sb-popover',
Expand Down Expand Up @@ -116,7 +118,7 @@ export class AttachmentService {
};

this.presentToast(this.texts["FRMELEMNTS_MSG_SUCCESSFULLY_ATTACHED"], "success");
this.actionSheetController.dismiss(data);
this.actionSheetOpen? this.actionSheetController.dismiss(data) : this.payload.push(data);
},
(error) => {
this.presentToast(this.texts["FRMELEMNTS_MSG_ERROR_WHILE_STORING_FILE"]);
Expand Down Expand Up @@ -147,12 +149,11 @@ export class AttachmentService {
isUploaded: false,
url: "",
};

this.presentToast(this.texts["FRMELEMNTS_MSG_SUCCESSFULLY_ATTACHED"], "success");
this.actionSheetController.dismiss(data);
this.actionSheetOpen? this.actionSheetController.dismiss(data) : this.payload.push(data);
}
} catch (error) {
this.presentToast(this.texts["FRMELEMNTS_MSG_ERROR_WHILE_STORING_FILE"]);
this.presentToast(this.texts["FRMELEMNTS_MSG_ERROR_WHILE_STORING_FILE"]);
}

// non working code for sdk30-android 11
Expand Down Expand Up @@ -203,4 +204,21 @@ export class AttachmentService {
deleteFile(fileName) {
return this.file.removeFile(this.directoryPath(), fileName);
}

async openAttachmentSource(type,payload) {
let data:any ='';
this.actionSheetOpen = false;
this.payload = payload;
switch(type){
case 'openCamera':
this.takePicture(this.camera.PictureSourceType.CAMERA);
break;
case 'openGallery':
this.takePicture(this.camera.PictureSourceType.PHOTOLIBRARY);
break;
case 'openFiles':
this.openFile();
break;
}
}
}
17 changes: 17 additions & 0 deletions src/app/manage-learn/core/services/project.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,4 +411,21 @@ export class ProjectService {
})
})
}

getLinks(links) {
let formattedLinks = links.replace(/[ ]/g, ',').split(',');
let linkArray = [];
formattedLinks.forEach(element => {
if(element){
let link = {
name: element,
type: 'link',
isUploaded: false,
url: "",
};
linkArray.push(link);
}
});
return linkArray.length ? linkArray : links;
}
}
12 changes: 10 additions & 2 deletions src/app/manage-learn/core/services/sync.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ export class SyncService {
if(showLoader){
this.loader.startLoader()
}
const project = { ...projectDetails};
const payload = this.removeKeys(project, ['isNew', 'isEdit']);
const project = { ...projectDetails };
const payload = this.removeKeys(project, ['isNew', 'isEdit', 'submissionDetails']);
delete payload._id;
const actualPayload = this.processPayload(payload);
//Else in submitted status projects, the sync API will Fail while redirecting to sync page
Expand Down Expand Up @@ -182,6 +182,14 @@ export class SyncService {

getAllAttachmentOfProject(project) {
let attachments = [];
// project leve attachments
if (project.attachments && project.attachments.length) {
for (const attachment of project.attachments) {
!attachment['sourcePath'] ? attachments.push(attachment) : null;
}
}

// Task leve attachments
for (const task of project.tasks) {
if (task.attachments && task.attachments.length) {
for (const attachment of task.attachments) {
Expand Down
21 changes: 21 additions & 0 deletions src/app/manage-learn/core/services/utils.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -737,4 +737,25 @@ return data;
}
return taskCount?.length;
}

getTabs(){
let tabs = [
{
name: "FRMELEMNTS_LBL_IMAGES",
value: "images",
type: 'image/jpeg'
},
{
name: "FRMELEMNTS_LBL_FILES",
value: "files",
type: "application/pdf"
},
{
name: "FRMELEMNTS_LBL_LINKS",
value: "links",
type: "link"
},
];
return tabs;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@
<app-no-data *ngIf="!submissions?.length"></app-no-data>
</ion-content>

<ion-footer no-shadow *ngIf="!disableObserveAgain">
<ion-footer no-shadow>
<ion-toolbar position="bottom">
<ion-row>
<ion-col>
<ion-col *ngIf="!disableObserveAgain">
<ion-button ion-button full (click)="observeAgain()" class="footerButton w-100">
{{ 'FRMELEMNTS_LBL_OBSERVE_AGAIN' | translate }}
</ion-button>
Expand Down
Loading