Skip to content

Commit 450ff45

Browse files
Merge pull request #213 from venkykandagaddala/create-sectors
Fixed build issues
2 parents 2e570b6 + 34a7d24 commit 450ff45

File tree

2 files changed

+55
-56
lines changed

2 files changed

+55
-56
lines changed

project/ws/app/src/lib/routes/home/routes/sectors/add-sector/add-sector.component.ts

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { MatDialog, MatDialogConfig } from '@angular/material/dialog'
44
import { ActivatedRoute, Router } from '@angular/router'
55
import * as _ from 'lodash'
66
import { AddThumbnailComponent } from '../../add-thumbnail/add-thumbnail.component'
7-
import { ImageCropComponent } from '../../image-crop/image-crop.component'
7+
// import { ImageCropComponent } from '../../image-crop/image-crop.component'
88
import { environment } from '../../../../../../../../../../src/environments/environment'
99
import { MatSnackBar } from '@angular/material/snack-bar'
1010
import { SectorsService } from '../sectors.service'
@@ -63,7 +63,7 @@ export class AddSectorComponent implements OnInit {
6363
this.router.navigate([`/app/home/sectors`])
6464
}
6565
this.isLoading = false
66-
}, error => {
66+
}, error => {
6767
this.snackBar.open(error, 'X', { duration: sectorConstants.duration })
6868
this.isLoading = false
6969
})
@@ -106,7 +106,7 @@ export class AddSectorComponent implements OnInit {
106106
if (!file) {
107107
return
108108
}
109-
const formdata = new FormData()
109+
// const formdata = new FormData()
110110
const fileName = file.name
111111

112112
if (
@@ -127,58 +127,58 @@ export class AddSectorComponent implements OnInit {
127127
return
128128
}
129129

130-
const dialogRef = this.dialog.open(ImageCropComponent, {
131-
width: '70%',
132-
data: {
133-
isRoundCrop: false,
134-
imageFile: file,
135-
width: sectorConstants.width,
136-
height: sectorConstants.width,
137-
isThumbnail: true,
138-
imageFileName: fileName,
139-
},
140-
})
130+
// const dialogRef = this.dialog.open(ImageCropComponent, {
131+
// width: '70%',
132+
// data: {
133+
// isRoundCrop: false,
134+
// imageFile: file,
135+
// width: sectorConstants.width,
136+
// height: sectorConstants.width,
137+
// isThumbnail: true,
138+
// imageFileName: fileName,
139+
// },
140+
// })
141141

142-
dialogRef.afterClosed().subscribe({
143-
next: (result: File) => {
144-
if (result) {
145-
formdata.append('content', result, fileName)
146-
let randomNumber = ''
147-
// tslint:disable-next-line: no-increment-decrement
148-
for (let i = 0; i < 16; i++) {
149-
randomNumber += Math.floor(Math.random() * 10)
150-
}
142+
// dialogRef.afterClosed().subscribe({
143+
// next: (result: File) => {
144+
// if (result) {
145+
// formdata.append('content', result, fileName)
146+
// let randomNumber = ''
147+
// // tslint:disable-next-line: no-increment-decrement
148+
// for (let i = 0; i < 16; i++) {
149+
// randomNumber += Math.floor(Math.random() * 10)
150+
// }
151151

152-
const requestBody = {
153-
request: {
154-
content: {
155-
code: randomNumber,
156-
contentType: 'Asset',
157-
createdBy: this.currentUser,
158-
creator: this.currentUser,
159-
mimeType: 'image/png',
160-
mediaType: 'image',
161-
name: fileName,
162-
language: ['English'],
163-
license: 'CC BY 4.0',
164-
primaryCategory: 'Asset',
165-
},
166-
},
167-
}
168-
this.sectorsService.createImageContent(requestBody).subscribe((res: any) => {
169-
this.sectorsService
170-
.upload(formdata, {
171-
contentId: res.result.identifier,
172-
contentType: this.sectorsService.CONTENT_BASE_STATIC,
173-
}).subscribe((data: any) => {
174-
if (data.result) {
175-
this.addSectorForm.controls.appIcon.setValue(this.generateUrl(data.result.artifactUrl))
176-
}
177-
})
178-
})
179-
}
180-
},
181-
})
152+
// const requestBody = {
153+
// request: {
154+
// content: {
155+
// code: randomNumber,
156+
// contentType: 'Asset',
157+
// createdBy: this.currentUser,
158+
// creator: this.currentUser,
159+
// mimeType: 'image/png',
160+
// mediaType: 'image',
161+
// name: fileName,
162+
// language: ['English'],
163+
// license: 'CC BY 4.0',
164+
// primaryCategory: 'Asset',
165+
// },
166+
// },
167+
// }
168+
// this.sectorsService.createImageContent(requestBody).subscribe((res: any) => {
169+
// this.sectorsService
170+
// .upload(formdata, {
171+
// contentId: res.result.identifier,
172+
// contentType: this.sectorsService.CONTENT_BASE_STATIC,
173+
// }).subscribe((data: any) => {
174+
// if (data.result) {
175+
// this.addSectorForm.controls.appIcon.setValue(this.generateUrl(data.result.artifactUrl))
176+
// }
177+
// })
178+
// })
179+
// }
180+
// },
181+
// })
182182
}
183183

184184
// format the URL to dispaly sector image

project/ws/app/src/lib/routes/home/routes/sectors/sector-list-view/sector-list-view.component.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
</div>
1919
</div>
2020
</div>
21-
<mat-table #table matSort [ngStyle]="{'height': bodyHeight}" [matSortActive]="tableData!.sortColumn"
22-
[matSortDirection]="tableData!.sortState" [dataSource]="dataSource"
23-
class="example-table table1 responsiveTable">
21+
<mat-table #table matSort [matSortActive]="tableData!.sortColumn" [matSortDirection]="tableData!.sortState"
22+
[dataSource]="dataSource" class="example-table table1 responsiveTable">
2423

2524
<ng-container matColumnDef="{{col.key}}" *ngFor="let col of tableData!.columns">
2625
<mat-header-cell *matHeaderCellDef mat-sort-header> {{col.displayName}} </mat-header-cell>

0 commit comments

Comments
 (0)