[ADF-1968] fix packaging issues i18n and assets (#2665)

* fix packaging issues i18n and assets

* remove other not used fodler
This commit is contained in:
Eugenio Romano
2017-11-17 15:08:26 +00:00
committed by GitHub
parent 1021cba9fc
commit a8e209c5b5
14 changed files with 99 additions and 191 deletions

View File

@@ -109,7 +109,9 @@ module.exports = {
return resourcePath.replace('assets/', 'bundles/assets/') + url;
},
publicPath: (url, resourcePath)=> {
return resourcePath + url;
var component = resourcePath.substring(0, resourcePath.indexOf('/'));
var path = resourcePath.replace(component, '');
return path + url;
}
}
}
@@ -145,7 +147,7 @@ module.exports = {
... alfrescoLibs.map(lib => {
return {
from: `${lib}/i18n/`,
to: `${lib}/bundles/assets/${lib}/i18n/`
to: `${lib}/bundles/assets/adf-${lib}/i18n/`
}
})
]),

View File

@@ -2,13 +2,6 @@ npm-debug.log
.idea
.npmrc
coverage/
demo/
dist/
node_modules
typings/
fonts/
/.editorconfig
/.travis.yml
/*.json
@@ -17,3 +10,18 @@ fonts/
/gulpfile.ts
/.npmignore
/.happypack
**/*.html
**/*.js
**/*.ts
!**/*.d.ts
!**/adf-content-services.js
coverage/
demo/
dist/
node_modules
typings/
fonts/
i18n/
assets/

View File

@@ -62,8 +62,8 @@ import { DirectiveModule } from './directive';
provide: TRANSLATION_PROVIDER,
multi: true,
useValue: {
name: '@alfresco/content-services',
source: '@alfresco/content-services'
name: 'adf-content-services',
source: 'assets/adf-content-services'
}
}
],

View File

@@ -2,13 +2,6 @@ npm-debug.log
.idea
.npmrc
coverage/
demo/
dist/
node_modules
typings/
fonts/
/.editorconfig
/.travis.yml
/*.json
@@ -17,3 +10,17 @@ fonts/
/gulpfile.ts
/.npmignore
/.happypack
**/*.html
**/*.js
**/*.ts
!**/*.d.ts
!**/adf-core.js
coverage/
demo/
dist/
node_modules
typings/
fonts/
i18n/
assets/

View File

@@ -85,8 +85,8 @@ export function createTranslateLoader(http: HttpClient, logService: LogService)
provide: TRANSLATION_PROVIDER,
multi: true,
useValue: {
name: '@alfresco/core',
source: '@alfresco/core'
name: 'adf-core',
source: 'assets/adf-core'
}
}
],

View File

@@ -1,97 +0,0 @@
# Node Permission Directive
<!-- markdown-toc start - Don't edit this section. npm run toc to generate it-->
<!-- toc -->
- [Properties](#properties)
- [HTML element example](#html-element-example)
- [Angular component example](#angular-component-example)
* [Implementing the NodePermissionSubject interface](#implementing-the-nodepermissionsubject-interface)
* [Defining your components as an EXTENDIBLE_COMPONENT parent component](#defining-your-components-as-an-extendible_component-parent-component)
<!-- tocstop -->
<!-- markdown-toc end -->
The `NodePermissionDirective` allows you to disable an HTML element or Angular component
by taking a collection of the `MinimalNodeEntity` instances and checking the particular permission.
The decorated element will be disabled if:
- there are no nodes in the collection
- at least one of the nodes has no expected permission
## Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| adf-node-permission | [Permissions](https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-alfresco-core/src/models/permissions.enum.ts) | null | Node permission to check (create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions)|
| adf-nodes | MinimalNodeEntity[] | [] | Nodes to check permission for |
## HTML element example
The best example to show `NodePermissionDirective` in action is by binding DocumentList selection property to a toolbar button.
For example the "Delete" button should be disabled if no selection is present or if user has no rights to delete at least one node in the selection.
```html
<adf-toolbar title="toolbar example">
<button md-icon-button
adf-node-permission="delete"
[adf-nodes]="documentList.selection">
<md-icon>delete</md-icon>
</button>
</adf-toolbar>
<adf-document-list #documentList ...>
...
</adf-document-list>
```
The button will become disabled by default, and is going to change its state once user selects/unselects one or multiple documents that current user has permission to delete.
## Angular component example
You can apply the directive on any angular component which implements the NodePermissionSubject interface. The upload drag area component can be a good candidate, since this one implements that interface. Applying the directive on an angular component is pretty much the same as applying it on an html element.
```html
<alfresco-upload-drag-area
[parentId]="..."
[versioning]="..."
[adf-node-permission]="'create'"
[adf-nodes]="getCurrentDocumentListNode()">
...
</alfresco-upload-drag-area>
```
When designing a component you want to work this directive with, you have two important things to care about.
### Implementing the NodePermissionSubject interface
The component has to implement the NodePermissionSubject interface which basically means it has to have a boolean **disabled** property. This is the property which will be set by the directive.
```js
import { NodePermissionSubject } from 'ng2-alfresco-core';
@Component({...})
export class UploadDragAreaComponent implements NodePermissionSubject {
public disabled: boolean = false;
}
```
### Defining your components as an EXTENDIBLE_COMPONENT parent component
The directive will look up the component in the dependency injection tree, up to at most one step above the current DI level (@Host). Because of this, you have to provide your component with forward referencing as the EXTENDIBLE_COMPONENT.
```js
import { EXTENDIBLE_COMPONENT } from 'ng2-alfresco-core';
@Component({
...
providers: [
{ provide: EXTENDIBLE_COMPONENT, useExisting: forwardRef(() => UploadDragAreaComponent)}
]
})
export class UploadDragAreaComponent implements NodePermissionSubject { ... }
```

View File

@@ -2,13 +2,6 @@ npm-debug.log
.idea
.npmrc
coverage/
demo/
dist/
node_modules
typings/
fonts/
/.editorconfig
/.travis.yml
/*.json
@@ -17,3 +10,17 @@ fonts/
/gulpfile.ts
/.npmignore
/.happypack
**/*.html
**/*.js
**/*.ts
!**/*.d.ts
!**/adf-insights.js
coverage/
demo/
dist/
node_modules
typings/
fonts/
i18n/
assets/

View File

@@ -42,8 +42,8 @@ import { DiagramsModule } from './diagram';
provide: TRANSLATION_PROVIDER,
multi: true,
useValue: {
name: '@alfresco/insights',
source: '@alfresco/insights'
name: 'adf-insights',
source: 'assets/adf-insights'
}
}
],

View File

@@ -2,13 +2,6 @@ npm-debug.log
.idea
.npmrc
coverage/
demo/
dist/
node_modules
typings/
fonts/
/.editorconfig
/.travis.yml
/*.json
@@ -17,3 +10,17 @@ fonts/
/gulpfile.ts
/.npmignore
/.happypack
**/*.html
**/*.js
**/*.ts
!**/*.d.ts
!**/adf-process-services.js
coverage/
demo/
dist/
node_modules
typings/
fonts/
i18n/
assets/

View File

@@ -50,8 +50,8 @@ import { PeopleModule } from './people';
provide: TRANSLATION_PROVIDER,
multi: true,
useValue: {
name: '@alfresco/process-services',
source: '@alfresco/process-services'
name: 'adf-process-services',
source: 'assets/adf-process-services'
}
}
],