Skip to content

Commit

Permalink
Merge pull request #106 from gupta-arpan/release-6.2.0
Browse files Browse the repository at this point in the history
Issue #42 feat: Merge Release 6.2.0 into C4GT_Issue_42 branch
  • Loading branch information
rajnishdargan authored Sep 5, 2023
2 parents a0bc2dc + a7ecb41 commit 045b6ca
Show file tree
Hide file tree
Showing 64 changed files with 2,289 additions and 3,227 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ Thumbs.db


# Web components Files
project-sunbird-sunbird-questionset-editor-web-component-*
project-sunbird-sunbird-questionset-editor-web-component-*

.env
7 changes: 5 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"node_modules/@project-sunbird/sunbird-quml-player-web-component/sunbird-quml-player.js",
"src/assets/libs/iziToast/iziToast.min.js",
"node_modules/jquery.fancytree/dist/jquery.fancytree-all-deps.min.js",
"node_modules/@project-sunbird/sunbird-file-upload-library/sunbird-file-upload-library.js",
"src/assets/lib/dimmer.min.js",
"src/assets/lib/transition.min.js",
"src/assets/lib/modal.min.js",
Expand Down Expand Up @@ -176,9 +177,10 @@
"karmaConfig": "projects/questionset-editor-library/karma.conf.js",
"scripts": [
"src/assets/libs/iziToast/iziToast.min.js",
"node_modules/jquery/dist/jquery.min.js"
"node_modules/jquery/dist/jquery.min.js",
"node_modules/@project-sunbird/sunbird-file-upload-library/sunbird-file-upload-library.js"
],
"codeCoverageExclude": [
"codeCoverageExclude": [
"projects/questionset-editor-library/src/lib/interfaces/*/*.ts"
]
}
Expand Down Expand Up @@ -238,6 +240,7 @@
"node_modules/@project-sunbird/sunbird-quml-player-web-component/sunbird-quml-player.js",
"src/assets/libs/iziToast/iziToast.min.js",
"node_modules/jquery.fancytree/dist/jquery.fancytree-all-deps.min.js",
"node_modules/@project-sunbird/sunbird-file-upload-library/sunbird-file-upload-library.js",
"src/assets/lib/dimmer.min.js",
"src/assets/lib/transition.min.js",
"src/assets/lib/modal.min.js",
Expand Down
2 changes: 0 additions & 2 deletions docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ config: {
review: string[],
},
maxDepth: number, //Ex.: 1
publicStorageAccount: 'url', //Ex.: https://dockstorage.blob.core.windows.net/
assetConfig: object,
objectType: 'string', //Ex.: QuestionSet
primaryCategory: 'string', //Ex.: Practice Question Set
Expand Down Expand Up @@ -180,7 +179,6 @@ Description of the properties for the config:
| `iconClass` | It is `string` and that defines the icon of root node | true | `fa fa-book` |
| `children` | It is an `object` and If maxdepth is 0 than children inside the root node defines the content type. **For example:** `children: {Question: ["Multiple Choice Question", "Subjective Question"]}` | true | |
| `contentPolicyUrl` | It is `string` and It defines where should the content policy link will be redirected. | true | `/term-of-use.html` |
| `publicStorageAccount` | It is `url` and URL of the blob storage **For example:** `https://dockstorage.blob.core.windows.net/` | true | |
| `mode` | It is `string` and that defines the mode in editor is to be loaded. **For example:** `edit / review / read / sourcingReview / orgReview` | false | `edit` |
| `editableFields` | It is an `object` and that defines the mode in editor is to be loaded. | false | `{ sourcingreview: [], orgreview: [], review: [], }` |
| `maxDepth` | It is `number` and Defines the depth to which the textbook is to be created. If the depth is 1, hierarchy should have level1 described. | false | **For example:** `1` |
Expand Down
53 changes: 47 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
"@project-sunbird/client-services": "5.0.0",
"@project-sunbird/common-form-elements-full": "^6.0.3",
"@project-sunbird/sb-styles": "0.0.9",
"@project-sunbird/sunbird-quml-player-web-component": "2.1.0",
"@project-sunbird/sunbird-resource-library": "6.1.0",
"@project-sunbird/sunbird-quml-player-web-component": "2.2.0-beta.0",
"@project-sunbird/sunbird-file-upload-library": "1.0.2",
"@project-sunbird/sunbird-resource-library": "6.2.0-beta.0",
"@project-sunbird/telemetry-sdk": "0.0.29",
"@types/jquery": "^3.5.5",
"alphanum-sort": "^1.0.2",
Expand Down Expand Up @@ -82,6 +83,7 @@
"protractor": "~7.0.0",
"ts-node": "~7.0.0",
"tslint": "~6.1.0",
"typescript": "4.9.5"
"typescript": "4.9.5",
"dotenv": "^16.3.1"
}
}
1 change: 0 additions & 1 deletion projects/questionset-editor-library-wc/src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@
@import "./../../questionset-editor-library/src/lib/components/qumlplayer-page/qumlplayer-page.component.scss";
@import "./../../questionset-editor-library/src/lib/components/slider/slider.component.scss";
@import "./../../questionset-editor-library/src/lib/components/template/template.component.scss";
@import "./../../questionset-editor-library/src/lib/components/term-and-condition/term-and-condition.component.scss";
@import "./../../questionset-editor-library/src/lib/components/translations/translations.component.scss";

2 changes: 1 addition & 1 deletion projects/questionset-editor-library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@project-sunbird/sunbird-questionset-editor",
"version": "6.1.0",
"version": "6.2.0-beta.5",
"dependencies": {
"tslib": "^2.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,6 @@ describe('AssetBrowserComponent', () => {
expect(result).toEqual("image/png,image/jpeg");
});

it('#initializeImagePicker() should set showImagePicker to true', () => {
spyOn(component, 'initializeImagePicker').and.callThrough();
component.initializeImagePicker();
expect(component.showImagePicker).toBeTruthy();
});

it('#outputEventHandler() should log event', () => {
spyOn(component, 'outputEventHandler').and.callThrough();
component.outputEventHandler({});
expect(component.outputEventHandler).toHaveBeenCalled();
})

it('#getMyImages() should return images on API success', async () => {
const response = mockData.serverResponse;
response.result = {
Expand Down Expand Up @@ -139,7 +127,7 @@ describe('AssetBrowserComponent', () => {
expect(component.imageFormValid).toEqual(false);
expect(component.formConfig).toBeTruthy();
})
it('#uploadAndUseImage should upload image on API success', async () => {
xit('#uploadAndUseImage should upload image on API success', async () => {
const createMediaAssetResponse = mockData.serverResponse;
createMediaAssetResponse.result = {
node_id: 'do_123'
Expand Down Expand Up @@ -212,10 +200,10 @@ describe('AssetBrowserComponent', () => {
it('#uploadToBlob() should upload blob on API success', () => {
let signedURL = '/test';
let file = new File([], 'filename');
let config = {};
let csp = 'azure'
let questionService: QuestionService= TestBed.inject(QuestionService);
spyOn(questionService.http, 'put').and.returnValue(of({"responseCode": "OK"}));
component.uploadToBlob(signedURL, file, config).subscribe(data => {
spyOn(questionService, 'uploadToBlob').and.returnValue(of({"responseCode": "OK"}));
component.uploadToBlob(signedURL, file, csp).subscribe(data => {
expect(data.responseCode).toEqual('OK');
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,11 @@ export class AssetBrowserComponent implements OnInit, OnDestroy {
showErrorMsg: boolean;
errorMsg: string;
query: string;
uploader;
isClosable = true;
loading = false;
public mediaobj;
public editorInstance: any;
public assetsCount: any;
public searchMyInput = '';
public searchAllInput: any;
showAddButton: boolean;
appIcon;
public formData: any;
public assestData = {};
Expand Down Expand Up @@ -64,14 +60,6 @@ export class AssetBrowserComponent implements OnInit, OnDestroy {
return result.toString();
}

initializeImagePicker() {
this.showImagePicker = true;
}

outputEventHandler(event) {
console.log(JSON.stringify(event));
}

getMyImages(offset, query?, search?) {
this.assetsCount = 0;
if (!search) {
Expand Down Expand Up @@ -273,15 +261,15 @@ export class AssetBrowserComponent implements OnInit, OnDestroy {
}

uploadToBlob(signedURL, file, config): Observable<any> {
return this.questionService.http.put(signedURL, file, config).pipe(catchError(err => {
const csp = _.get(this.editorService.editorConfig, 'context.cloudStorage.provider', 'azure');
return this.questionService.uploadToBlob(signedURL, file, csp).pipe(catchError(err => {
const errInfo = { errorMsg: _.get(this.configService.labelConfig, 'messages.error.018') };
this.isClosable = true;
this.loading = false;
return throwError(this.editorService.apiErrorHandling(err, errInfo));
}), map(data => data));
}


dismissImageUploadModal() {
if (this.isClosable) {
this.showImagePicker = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,8 @@ export class CkeditorToolComponent implements OnInit, AfterViewInit, OnChanges {
}

uploadToBlob(signedURL, file, config): Observable<any> {
return this.questionService.http.put(signedURL, file, config).pipe(catchError(err => {
const csp = _.get(this.editorService.editorConfig, 'context.cloudStorage.provider', 'azure');
return this.questionService.uploadToBlob(signedURL, file, csp).pipe(catchError(err => {
const errInfo = { errorMsg: _.get(this.configService.labelConfig, 'messages.error.018') };
this.isClosable = true;
this.loading = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,7 @@
<div class="ui">
<div class="ui twelve column grid m-0 ">
<!-- Left Sidebar for cards -->
<div class="p-50 sb-folder-menu" *ngIf="isObjectTypeCollection">
<div> {{configService.labelConfig?.lbl?.folders}} </div>
<a class="profile-avtar computer only p-0 pr-10" tabindex="0">
<div suiDropdown class="ui dropdown right top pointing z-index-9" id="dropdown-menu-list-header">
<i class="icon ellipsis vertical h-1" aria-hidden="true" [ngClass]="{'sb-disable-icon': isStatusReviewMode}" (click)="onClickFolder()"></i>
<div class="menu" suiDropdownMenu *ngIf="!isStatusReviewMode">
<button type="button" class="item fs-0-785 bg-none"
libTelemetryInteract
[telemetryInteractEdata]="telemetryService.getTelemetryInteractEdata('open_popup','click',configService.labelConfig?.lbl?.createHierarchyCsv,
this.telemetryService.telemetryPageId,{key: 'dialog_id', value: configService.labelConfig?.lbl?.createHierarchyCsv})"
(click)="hanndleCsvEmitter({type: 'createCsv'})" [disabled]="csvDropDownOptions.isDisableCreateCsv">
<i class="icon folder outline sb-color-primary" [ngClass]="{'sb-disable-icon': csvDropDownOptions.isDisableCreateCsv}" aria-hidden="true"></i>
<span class="text" [ngClass]="{'label-disable': csvDropDownOptions.isDisableCreateCsv}">{{configService.labelConfig?.lbl?.createHierarchyCsv}}</span>
</button>
<div class="ui divider"></div>
<button libTelemetryInteract
[telemetryInteractEdata]="telemetryService.getTelemetryInteractEdata('csv_download','click',configService.labelConfig?.lbl?.downloadFoldersInCSV,
this.telemetryService.telemetryPageId,{key: 'identifier', value: collectionId})"
type="button" class="item fs-0-785 bg-none" (click)="hanndleCsvEmitter({type: 'downloadCsv'})" [disabled]="csvDropDownOptions.isDisableDownloadCsv">
<i class="icon download sb-color-primary" [ngClass]="{'sb-disable-icon': csvDropDownOptions.isDisableDownloadCsv}" aria-hidden="true"></i>
<span class="text" [ngClass]="{'label-disable': csvDropDownOptions.isDisableDownloadCsv}" >
{{configService.labelConfig?.lbl?.downloadFoldersInCSV}}</span>
</button>
<div class="ui divider">
</div>
<button
libTelemetryInteract
[telemetryInteractEdata]="telemetryService.getTelemetryInteractEdata('open_popup','click',configService.labelConfig?.lbl?.uploadUpdateCSV,
this.telemetryService.telemetryPageId,{key: 'dialog_id', value: configService.labelConfig?.lbl?.uploadUpdateCSV})"
type="button" class="item fs-0-785 bg-none" (click)="hanndleCsvEmitter({type: 'updateCsv'})" [disabled]="csvDropDownOptions.isDisableUpdateCsv">
<i class="icon upload sb-color-primary" aria-hidden="true" [ngClass]="{'label-disable': csvDropDownOptions.isDisableUpdateCsv}"></i>
<span class="text" [ngClass]="{'label-disable': csvDropDownOptions.isDisableUpdateCsv}" >
{{configService.labelConfig?.lbl?.uploadUpdateCSV}}
</span>
</button>
</div>
</div>
</a>
</div>
<div class="three wide column p-0 overflow-y mb-40 h-100vh" [ngClass]="{'mt-50': isObjectTypeCollection}">
<div class="three wide column p-0 overflow-y mb-40 h-100vh">
<lib-fancy-tree *ngIf="collectionTreeNodes && collectionTreeNodes.data && ishierarchyConfigSet"
[nodes]="collectionTreeNodes" [options]="{ showConnectors: true }" [buttonLoaders]="buttonLoaders"
(treeEventEmitter)="treeEventListener($event)" class="sb-collectionTree-fancyTree sb-collectionTree-fancyTreelist sb-questionset-scroll">
Expand Down
Loading

0 comments on commit 045b6ca

Please sign in to comment.