saburab / angular-schema-form-nwp-file-upload

Angular Schema Form File Upload by Netzwerkplan
MIT License
13 stars 24 forks source link

Two $templateCache(s) in the dist files, request for versioning #16

Open vikaskonsam opened 7 years ago

vikaskonsam commented 7 years ago

There are two $templateCache pointing to the same template path in the distribution files. I think this has happened because the source file already has a $templatecache in it. My assumption is that the template should only be injected when you the run gulp build tasks. The templateCache in the source file also does not have any reference to the form.i18n object and it looks like this is the template which was used earlier.

Also, will it be possible to use the form.i18n labels only if it exists else fallback to the modules labels or have default labels preferably in english?

Example: We already had translation defined. However, since, with the latest update, they are no longer used in the template we have been getting elements without labels only to realize later that these labels are being defined as a part of the form object.

$translateProvider.translations('en', {
        'modules.upload.dndNotSupported': 'Drag n drop not surpported by your browser',
        'modules.attribute.fields.required.caption': 'Required',
        'modules.upload.descriptionMultifile': 'Drop your file(s) here',
        'modules.upload.descriptionSinglefile': 'Drop your file here',
        'buttons.add': 'Open file browser',
        'modules.upload.field.filename': 'Filename',
        'modules.upload.field.preview': 'Preview',
        'modules.upload.multiFileUpload': 'Multifile upload',
        'modules.upload.field.progress': 'Progress',
        'buttons.upload': 'Upload'
    });

Further, form.i18n is used only for the singleFileUpload template and not in the multifileUpload template.

Also, please add release versions so that we can target specific versions which worked for us.

vikaskonsam commented 7 years ago

Created a PR to support

  1. fallback to labels (defined using $translateprovider) if form.i18n is not available.
  2. Removed the unnecessary $templateCache definition from dist files and also from the src file
  3. Used form.i18n definition in multifileUpload template which was missing
  4. Updated readme file