Fix typos in component properties (#1560)

* Fix typo `fallbackThubnail` -> `fallbackThumbnail`

* Fix typo `showUdoNotificationBar` -> `showNotificationBar`

Update upload mis-spelled properties to 'showNotificationBar' since
showUndoNotificationBar is already a method on the drag area component

Refs #1559

* Fix test cases
This commit is contained in:
Will Abson
2017-01-28 14:52:23 +00:00
committed by Mario Romano
parent 09b98e7071
commit 5519f9fb00
9 changed files with 23 additions and 23 deletions

View File

@@ -177,7 +177,7 @@ platformBrowserDynamic().bootstrapModule(AppModule);
| `data` | DataTableAdapter | instance of **ObjectDataTableAdapter** | data source | | `data` | DataTableAdapter | instance of **ObjectDataTableAdapter** | data source |
| `multiselect` | boolean | false | Toggles multiple row selection, renders checkboxes at the beginning of each row | | `multiselect` | boolean | false | Toggles multiple row selection, renders checkboxes at the beginning of each row |
| `actions` | boolean | false | Toggles data actions column | | `actions` | boolean | false | Toggles data actions column |
| `fallbackThubnail` | string | | Fallback image for row ehre thubnail is missing| | `fallbackThumbnail` | string | | Fallback image for row ehre thubnail is missing|
### Events ### Events

View File

@@ -178,7 +178,7 @@ The properties currentFolderId, folderNode and node are the entry initialization
| `navigate` | boolean | true | Toggles navigation to folder content or file preview | | `navigate` | boolean | true | Toggles navigation to folder content or file preview |
| `navigationMode` | string (click\|dblclick) | dblclick | User interaction for folder navigation or file preview | | `navigationMode` | string (click\|dblclick) | dblclick | User interaction for folder navigation or file preview |
| `thumbnails` | boolean | false | Show document thumbnails rather than icons | | `thumbnails` | boolean | false | Show document thumbnails rather than icons |
| `fallbackThubnail` | string | | Fallback image for row ehre thubnail is missing| | `fallbackThumbnail` | string | | Path to fallback image to use if the row thumbnail is missing |
| `multiselect` | boolean | false | Toggles multiselect mode | | `multiselect` | boolean | false | Toggles multiselect mode |
| `contentActions` | boolean | false | Toggles content actions for each row | | `contentActions` | boolean | false | Toggles content actions for each row |
| `contextMenuActions` | boolean | false | Toggles context menus for each row | | `contextMenuActions` | boolean | false | Toggles context menus for each row |

View File

@@ -8,7 +8,7 @@
[data]="data" [data]="data"
[actions]="contentActions" [actions]="contentActions"
[multiselect]="multiselect" [multiselect]="multiselect"
[fallbackThumbnail]="fallbackThubnail" [fallbackThumbnail]="fallbackThumbnail"
(showRowContextMenu)="onShowRowContextMenu($event)" (showRowContextMenu)="onShowRowContextMenu($event)"
(showRowActionsMenu)="onShowRowActionsMenu($event)" (showRowActionsMenu)="onShowRowActionsMenu($event)"
(executeRowAction)="onExecuteRowAction($event)" (executeRowAction)="onExecuteRowAction($event)"

View File

@@ -54,7 +54,7 @@ export class DocumentListComponent implements OnInit, OnChanges, AfterContentIni
baseComponentPath = module.id.replace('/components/document-list.component.js', ''); baseComponentPath = module.id.replace('/components/document-list.component.js', '');
@Input() @Input()
fallbackThubnail: string = this.baseComponentPath + '/assets/images/ft_ic_miscellaneous.svg'; fallbackThumbnail: string = this.baseComponentPath + '/assets/images/ft_ic_miscellaneous.svg';
@Input() @Input()
navigate: boolean = true; navigate: boolean = true;

View File

@@ -99,7 +99,7 @@ Follow the 3 steps below:
```html ```html
<alfresco-upload-button [showUdoNotificationBar]="true" <alfresco-upload-button [showNotificationBar]="true"
[uploadFolders]="true" [uploadFolders]="true"
[multipleFiles]="false" [multipleFiles]="false"
[acceptedFilesType]=".jpg,.gif,.png,.svg" [acceptedFilesType]=".jpg,.gif,.png,.svg"
@@ -121,7 +121,7 @@ import { UploadModule } from 'ng2-alfresco-upload';
@Component({ @Component({
selector: 'alfresco-app-demo', selector: 'alfresco-app-demo',
template: `<alfresco-upload-button [showUdoNotificationBar]="true" template: `<alfresco-upload-button [showNotificationBar]="true"
[uploadFolders]="false" [uploadFolders]="false"
[multipleFiles]="false" [multipleFiles]="false"
[acceptedFilesType]="'.jpg,.gif,.png,.svg'" [acceptedFilesType]="'.jpg,.gif,.png,.svg'"
@@ -171,7 +171,7 @@ Attribute | Description
Attribute | Options | Default | Description | Mandatory Attribute | Options | Default | Description | Mandatory
--- | --- | --- | --- | --- --- | --- | --- | --- | ---
`showUdoNotificationBar` | *boolean* | true | Hide/show notification bar | `showNotificationBar` | *boolean* | true | Hide/show notification bar |
`uploadFolders` | *boolean* | false | Allow/disallow upload folders (only for chrome) | `uploadFolders` | *boolean* | false | Allow/disallow upload folders (only for chrome) |
`multipleFiles` | *boolean* | false | Allow/disallow multiple files | `multipleFiles` | *boolean* | false | Allow/disallow multiple files |
`acceptedFilesType` | *string* | * | array of allowed file extensions , example: ".jpg,.gif,.png,.svg" | `acceptedFilesType` | *string* | * | array of allowed file extensions , example: ".jpg,.gif,.png,.svg" |
@@ -251,7 +251,7 @@ Attribute | Description
Attribute | Options | Default | Description | Mandatory Attribute | Options | Default | Description | Mandatory
--- | --- | --- | --- | --- --- | --- | --- | --- | ---
`showUdoNotificationBar` | *boolean* | true | Hide/show notification bar | `showNotificationBar` | *boolean* | true | Hide/show notification bar |
`currentFolderPath` | *string* | '/Sites/swsdp/documentLibrary' | define the path where the files are uploaded | `currentFolderPath` | *string* | '/Sites/swsdp/documentLibrary' | define the path where the files are uploaded |
`versioning` | *boolean* | false | Versioning false is the default uploader behaviour and it rename using an integer suffix if there is a name clash. Versioning true to indicate that a major version should be created | `versioning` | *boolean* | false | Versioning false is the default uploader behaviour and it rename using an integer suffix if there is a name clash. Versioning true to indicate that a major version should be created |

View File

@@ -31,7 +31,7 @@ import { UploadService } from './src/services/upload.service';
* Components provided: * Components provided:
* - A button to upload files * - A button to upload files
* <alfresco-upload-button [showDialogUpload]="boolean" * <alfresco-upload-button [showDialogUpload]="boolean"
* [showUdoNotificationBar]="boolean" * [showNotificationBar]="boolean"
* [uploadFolders]="boolean" * [uploadFolders]="boolean"
* [multipleFiles]="boolean" * [multipleFiles]="boolean"
* [acceptedFilesType]="string"> * [acceptedFilesType]="string">

View File

@@ -26,7 +26,7 @@ declare let componentHandler: any;
const ERROR_FOLDER_ALREADY_EXIST = 409; const ERROR_FOLDER_ALREADY_EXIST = 409;
/** /**
* <alfresco-upload-button [showUdoNotificationBar]="boolean" * <alfresco-upload-button [showNotificationBar]="boolean"
* [uploadFolders]="boolean" * [uploadFolders]="boolean"
* [multipleFiles]="boolean" * [multipleFiles]="boolean"
* [acceptedFilesType]="string" * [acceptedFilesType]="string"
@@ -35,7 +35,7 @@ const ERROR_FOLDER_ALREADY_EXIST = 409;
* *
* This component, provide a set of buttons to upload files to alfresco. * This component, provide a set of buttons to upload files to alfresco.
* *
* @InputParam {boolean} [true] showUdoNotificationBar - hide/show notification bar. * @InputParam {boolean} [true] showNotificationBar - hide/show notification bar.
* @InputParam {boolean} [false] versioning - true to indicate that a major version should be created * @InputParam {boolean} [false] versioning - true to indicate that a major version should be created
* @InputParam {boolean} [false] uploadFolders - allow/disallow upload folders (only for chrome). * @InputParam {boolean} [false] uploadFolders - allow/disallow upload folders (only for chrome).
* @InputParam {boolean} [false] multipleFiles - allow/disallow multiple files. * @InputParam {boolean} [false] multipleFiles - allow/disallow multiple files.
@@ -56,7 +56,7 @@ export class UploadButtonComponent {
private static DEFAULT_ROOT_ID: string = '-root-'; private static DEFAULT_ROOT_ID: string = '-root-';
@Input() @Input()
showUdoNotificationBar: boolean = true; showNotificationBar: boolean = true;
@Input() @Input()
uploadFolders: boolean = false; uploadFolders: boolean = false;
@@ -160,7 +160,7 @@ export class UploadButtonComponent {
if (files.length) { if (files.length) {
let latestFilesAdded = this.uploadService.addToQueue(files); let latestFilesAdded = this.uploadService.addToQueue(files);
this.uploadService.uploadFilesInTheQueue(this.rootFolderId, path, this.onSuccess); this.uploadService.uploadFilesInTheQueue(this.rootFolderId, path, this.onSuccess);
if (this.showUdoNotificationBar) { if (this.showNotificationBar) {
this._showUndoNotificationBar(latestFilesAdded); this._showUndoNotificationBar(latestFilesAdded);
} }
} }

View File

@@ -66,7 +66,7 @@ describe('UploadDragAreaComponent', () => {
}); });
it('should show an folder non supported error in console when the file type is empty', () => { it('should show an folder non supported error in console when the file type is empty', () => {
component.showUdoNotificationBar = false; component.showNotificationBar = false;
spyOn(logService, 'error'); spyOn(logService, 'error');
let fileFake = new File([''], 'folder-fake', {type: ''}); let fileFake = new File([''], 'folder-fake', {type: ''});
@@ -77,7 +77,7 @@ describe('UploadDragAreaComponent', () => {
it('should show an folder non supported error in the notification bar when the file type is empty', () => { it('should show an folder non supported error in the notification bar when the file type is empty', () => {
component.showErrorNotificationBar = jasmine.createSpy('_showErrorNotificationBar'); component.showErrorNotificationBar = jasmine.createSpy('_showErrorNotificationBar');
component.showUdoNotificationBar = true; component.showNotificationBar = true;
let fileFake = new File([''], 'folder-fake', {type: ''}); let fileFake = new File([''], 'folder-fake', {type: ''});
component.onFilesDropped([fileFake]); component.onFilesDropped([fileFake]);
@@ -88,7 +88,7 @@ describe('UploadDragAreaComponent', () => {
it('should upload the list of files dropped', () => { it('should upload the list of files dropped', () => {
component.currentFolderPath = '/root-fake-/sites-fake/folder-fake'; component.currentFolderPath = '/root-fake-/sites-fake/folder-fake';
component.onSuccess = null; component.onSuccess = null;
component.showUdoNotificationBar = false; component.showNotificationBar = false;
uploadService.addToQueue = jasmine.createSpy('addToQueue'); uploadService.addToQueue = jasmine.createSpy('addToQueue');
uploadService.uploadFilesInTheQueue = jasmine.createSpy('uploadFilesInTheQueue'); uploadService.uploadFilesInTheQueue = jasmine.createSpy('uploadFilesInTheQueue');
@@ -104,7 +104,7 @@ describe('UploadDragAreaComponent', () => {
it('should show the loading messages in the notification bar when the files are dropped', () => { it('should show the loading messages in the notification bar when the files are dropped', () => {
component.currentFolderPath = '/root-fake-/sites-fake/folder-fake'; component.currentFolderPath = '/root-fake-/sites-fake/folder-fake';
component.onSuccess = null; component.onSuccess = null;
component.showUdoNotificationBar = true; component.showNotificationBar = true;
uploadService.uploadFilesInTheQueue = jasmine.createSpy('uploadFilesInTheQueue'); uploadService.uploadFilesInTheQueue = jasmine.createSpy('uploadFilesInTheQueue');
component.showUndoNotificationBar = jasmine.createSpy('_showUndoNotificationBar'); component.showUndoNotificationBar = jasmine.createSpy('_showUndoNotificationBar');
@@ -166,7 +166,7 @@ describe('UploadDragAreaComponent', () => {
xit('should throws an exception and show it in the notification bar when the folder already exist', done => { xit('should throws an exception and show it in the notification bar when the folder already exist', done => {
component.currentFolderPath = '/root-fake-/sites-fake/folder-fake'; component.currentFolderPath = '/root-fake-/sites-fake/folder-fake';
component.showUdoNotificationBar = true; component.showNotificationBar = true;
fixture.detectChanges(); fixture.detectChanges();
let fakeRest = { let fakeRest = {

View File

@@ -44,7 +44,7 @@ export class UploadDragAreaComponent {
private static DEFAULT_ROOT_ID: string = '-root-'; private static DEFAULT_ROOT_ID: string = '-root-';
@Input() @Input()
showUdoNotificationBar: boolean = true; showNotificationBar: boolean = true;
@Input() @Input()
versioning: boolean = false; versioning: boolean = false;
@@ -83,13 +83,13 @@ export class UploadDragAreaComponent {
this.uploadService.addToQueue(files); this.uploadService.addToQueue(files);
this.uploadService.uploadFilesInTheQueue(this.rootFolderId, this.currentFolderPath, this.onSuccess); this.uploadService.uploadFilesInTheQueue(this.rootFolderId, this.currentFolderPath, this.onSuccess);
let latestFilesAdded = this.uploadService.getQueue(); let latestFilesAdded = this.uploadService.getQueue();
if (this.showUdoNotificationBar) { if (this.showNotificationBar) {
this.showUndoNotificationBar(latestFilesAdded); this.showUndoNotificationBar(latestFilesAdded);
} }
} else { } else {
let errorMessage: any; let errorMessage: any;
errorMessage = this.translateService.get('FILE_UPLOAD.MESSAGES.FOLDER_NOT_SUPPORTED'); errorMessage = this.translateService.get('FILE_UPLOAD.MESSAGES.FOLDER_NOT_SUPPORTED');
if (this.showUdoNotificationBar) { if (this.showNotificationBar) {
this.showErrorNotificationBar(errorMessage.value); this.showErrorNotificationBar(errorMessage.value);
} else { } else {
this.logService.error(errorMessage.value); this.logService.error(errorMessage.value);
@@ -143,7 +143,7 @@ export class UploadDragAreaComponent {
for (let i = 0; i < entries.length; i++) { for (let i = 0; i < entries.length; i++) {
this._traverseFileTree(entries[i]); this._traverseFileTree(entries[i]);
} }
if (this.showUdoNotificationBar) { if (this.showNotificationBar) {
let latestFilesAdded = this.uploadService.getQueue(); let latestFilesAdded = this.uploadService.getQueue();
this.showUndoNotificationBar(latestFilesAdded); this.showUndoNotificationBar(latestFilesAdded);
} }
@@ -152,7 +152,7 @@ export class UploadDragAreaComponent {
error => { error => {
let errorMessagePlaceholder = this.getErrorMessage(error.response); let errorMessagePlaceholder = this.getErrorMessage(error.response);
let errorMessage = this.formatString(errorMessagePlaceholder, [folder.name]); let errorMessage = this.formatString(errorMessagePlaceholder, [folder.name]);
if (this.showUdoNotificationBar) { if (this.showNotificationBar) {
this.showErrorNotificationBar(errorMessage); this.showErrorNotificationBar(errorMessage);
} else { } else {
this.logService.error(errorMessage); this.logService.error(errorMessage);