Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
181 additions
and
263 deletions.
There are no files selected for viewing
8 changes: 5 additions & 3 deletions
8
...er/simple-dropzone-wrapper.component.html → ...rapper/adam-attach-wrapper.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
<div class="dropzone dropzone-container" [dropzone]="dropzoneConfig" [disabled]="disabled" (error)="onUploadError($event)" | ||
(success)="onUploadSuccess($event)" (drop)="onDrop($event)"> | ||
<div class="dropzone-content"> | ||
<div class="adam-dialog-container"> | ||
<div class="adam-dialog-content"> | ||
<ng-container #fieldComponent></ng-container> | ||
</div> | ||
<adam-browser (openUpload)="openUpload()" [url]="url" [metadataOfCmsObject]="" [config]="config"> | ||
</adam-browser> | ||
<div class="{{'field-' + config.index}}"> | ||
<div class="dropzone-previews"> | ||
</div> | ||
<span #invisibleClickable class="invisible-clickable" data-note="just a fake, invisible area for dropzone"></span> | ||
</div> | ||
<adam-hint class="field-hints"></adam-hint> | ||
</div> |
File renamed without changes.
57 changes: 57 additions & 0 deletions
57
src/app/eav-material-controls/adam/adam-attach-wrapper/adam-attach-wrapper.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { Component, OnInit, ViewContainerRef, Input, ViewChild, AfterContentInit, AfterViewInit, ElementRef } from '@angular/core'; | ||
import { FieldWrapper } from '../../../eav-dynamic-form/model/field-wrapper'; | ||
import { DropzoneDirective, DropzoneConfigInterface } from 'ngx-dropzone-wrapper'; | ||
import { FieldConfig } from '../../../eav-dynamic-form/model/field-config'; | ||
import { AdamBrowserComponent } from '../browser/adam-browser.component'; | ||
import { EavConfiguration } from '../../../shared/models/eav-configuration'; | ||
import { EavService } from '../../../shared/services/eav.service'; | ||
import { UrlHelper } from '../../../shared/helpers/url-helper'; | ||
import { FormGroup } from '@angular/forms'; | ||
|
||
@Component({ | ||
selector: 'app-adam-attach-wrapper', | ||
templateUrl: './adam-attach-wrapper.component.html', | ||
styleUrls: ['./adam-attach-wrapper.component.scss'] | ||
}) | ||
export class AdamAttachWrapperComponent implements FieldWrapper, OnInit { | ||
@ViewChild('fieldComponent', { read: ViewContainerRef }) fieldComponent: ViewContainerRef; | ||
@ViewChild('invisibleClickable') invisibleClickableReference: ElementRef; | ||
@ViewChild(AdamBrowserComponent) adamRef: AdamBrowserComponent; | ||
|
||
@Input() config: FieldConfig; | ||
group: FormGroup; | ||
|
||
url: string; | ||
|
||
private eavConfig: EavConfiguration; | ||
|
||
get disabled() { | ||
return this.group.controls[this.config.name].disabled; | ||
} | ||
|
||
constructor(private eavService: EavService) { | ||
this.eavConfig = this.eavService.getEavConfiguration(); | ||
} | ||
|
||
ngOnInit() { | ||
this.config.adam = this.adamRef; | ||
// const serviceRoot = 'http://2sxc-dnn742.dnndev.me/en-us/desktopmodules/2sxc/api/'; | ||
const serviceRoot = this.eavConfig.portalroot + 'desktopmodules/2sxc/api/'; | ||
// const url = UrlHelper.resolveServiceUrl('app-content/' + contentType + '/' + entityGuid + '/' + field, serviceRoot); | ||
const contentType = this.config.header.contentTypeName; | ||
// const contentType = '106ba6ed-f807-475a-b004-cd77e6b317bd'; | ||
const entityGuid = this.config.header.guid; | ||
// const entityGuid = '386ec145-d884-4fea-935b-a4d8d0c68d8d'; | ||
const field = this.config.name; | ||
// const field = 'HyperLinkStaticName'; | ||
this.url = UrlHelper.resolveServiceUrl(`app-content/${contentType}/${entityGuid}/${field}`, serviceRoot); | ||
} | ||
|
||
// /** | ||
// * triger click on clickable element for load open | ||
// */ | ||
openUpload() { | ||
console.log('openUpload click'); | ||
this.invisibleClickableReference.nativeElement.click(); | ||
} | ||
} |
1 change: 0 additions & 1 deletion
1
src/app/eav-material-controls/adam/browser/adam-browser.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/app/eav-material-controls/adam/dropzone-wrapper/dropzone-wrapper.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div class="dropzone dropzone-container" [dropzone]="dropzoneConfig" [disabled]="disabled" (error)="onUploadError($event)" | ||
(success)="onUploadSuccess($event)" (drop)="onDrop($event)"> | ||
<!-- <div class="dropzone-content"> --> | ||
<ng-container #fieldComponent></ng-container> | ||
<!-- </div> --> | ||
</div> |
3 changes: 3 additions & 0 deletions
3
src/app/eav-material-controls/adam/dropzone-wrapper/dropzone-wrapper.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.dropzone-container { | ||
height: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
src/app/eav-material-controls/adam/dropzone/dropzone.component.html
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
src/app/eav-material-controls/adam/dropzone/dropzone.component.spec.ts
This file was deleted.
Oops, something went wrong.
128 changes: 0 additions & 128 deletions
128
src/app/eav-material-controls/adam/dropzone/dropzone.component.ts
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.