Skip to content

Commit

Permalink
Merge branch 'dev' into randomizedID
Browse files Browse the repository at this point in the history
  • Loading branch information
JustSeenn committed May 4, 2022
2 parents c6a6e84 + c6a3707 commit eb64467
Show file tree
Hide file tree
Showing 89 changed files with 7,811 additions and 7,404 deletions.
2 changes: 1 addition & 1 deletion backoffice/app/attribute/views/attribute-detail.html
Expand Up @@ -12,7 +12,7 @@
<div class="col-sm-6">
<input type="text" class="form-control" id="code" translate
translate-attr-placeholder='attribute.detail.ph1' ng-model="attribute.code"
ng-disabled="isEditMode" required>
ng-disabled="isEditMode">
</div>
</div>
<div class="form-group">
Expand Down
2 changes: 1 addition & 1 deletion backoffice/app/category/views/modals/category-new.html
Expand Up @@ -10,7 +10,7 @@ <h3 translate>category.new.createNewCat</h3>
<div class="form-group">
<label for="code" class="col-sm-2 control-label" translate>category.new.code</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="code" translate translate-attr-placeholder='category.new.ph1' ng-model="category.code" required />
<input type="text" class="form-control" id="code" translate translate-attr-placeholder='category.new.ph1' ng-model="category.code" />
</div>
</div>
<div class="form-group">
Expand Down
4 changes: 2 additions & 2 deletions backoffice/app/cmsBlocks/cmsBlocks.controllers.js
Expand Up @@ -44,8 +44,8 @@ CmsBlocksControllers.controller("CmsBlocksListCtrl", [
]);

CmsBlocksControllers.controller("CmsBlocksDetailCtrl", [
"$scope", "CmsBlocksApi", "$routeParams", "$location", "toastService", "$http","$modal","$rootScope", "$timeout", "$translate", "$rootScope",
function ($scope, CmsBlocksApi, $routeParams, $location, toastService, $http, $modal, $rootScope, $timeout, $translate, $rootScope) {
"$scope", "CmsBlocksApi", "$routeParams", "$location", "toastService", "$http","$modal","$rootScope", "$q", "$translate", "$rootScope",
function ($scope, CmsBlocksApi, $routeParams, $location, toastService, $http, $modal, $rootScope, $q, $translate, $rootScope) {
$scope.isEditMode = false;
$scope.lang = $rootScope.adminLang;
$scope.modules = [];
Expand Down
2 changes: 1 addition & 1 deletion backoffice/app/cmsBlocks/views/cmsBlocksDetail.html
Expand Up @@ -17,7 +17,7 @@
<div class="col-sm-12">
<label class="col-sm-2 control-label" translate>cmsBlocks.detail.code</label>
<div class="col-sm-10">
<input type="text" name="code" class="form-control" ng-model="cmsBlock.code" required ng-disabled="cmsBlock.code === 'invoice'" />
<input type="text" name="code" class="form-control" ng-model="cmsBlock.code" ng-disabled="cmsBlock.code === 'invoice'" required />
<div ng-messages="form.id.$error" role="alert">
<div ng-message="required" ng-show="form.id.$dirty" translate>cmsBlocks.detail.champRequis</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion backoffice/app/family/views/family-new.html
Expand Up @@ -19,7 +19,7 @@ <h3><span translate>family.new.t1</span>{{typeName}}</h3>
<br/><br/>
<label for="code" class="col-sm-2 control-label" translate>family.new.code</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="code" translate translate-attr-placeholder='family.new.ph2' ng-model="family.code" required>
<input type="text" class="form-control" id="code" translate translate-attr-placeholder='family.new.ph2' ng-model="family.code">
</div>
</div>
<div class="form-group" style="margin: 0px 0px 15px 0px;" ng-hide="parents.length == 0">
Expand Down
2 changes: 1 addition & 1 deletion backoffice/app/mail/views/mail-detail.html
Expand Up @@ -74,7 +74,7 @@
<div style="width: 50%;float: right;margin-top:10px" ng-if="isEditMode">
<div class="col-md-10">
<label translate>mail.detail.attachment</label>
<ns-upload-files is-selected="nsUploadFiles.isSelected" accepttype="application/pdf" id="mail._id" multiple="false" type="mail" before-function="before()"
<ns-upload-files is-selected="nsUploadFiles.isSelected" accepttype="application/pdf" id="mail._id" multiple="false" type="mail" before-function="before"
after-function="after" lang="lang" on-error="uploadError()"></ns-upload-files>
<table style="border:1px solid black; margin-bottom: 15px;max-width:100%; table-layout: fixed;">
<tr ng-repeat-start="file in mail.translation[lang].attachments">
Expand Down
2 changes: 1 addition & 1 deletion backoffice/app/medias/views/modals/medias-mass-new.html
Expand Up @@ -8,7 +8,7 @@ <h3 translate>medias.multi.title</h3>
<p translate>medias.multi.uploadInfo</p>
</div>
<div style="margin-top: 20px;text-align: center;">
<ns-upload-files accepttype=".zip" multiple="false" type="mediaMass" before-function="beforeMediaMass()" after-function="uploadedMediaMass" entity="local.insertDBMediaUpload"></ns-upload-files>
<ns-upload-files accepttype=".zip" multiple="false" type="mediaMass" before-function="beforeMediaMass" after-function="uploadedMediaMass" entity="local.insertDBMediaUpload"></ns-upload-files>
<div style="text-align: center;">
<input type="checkbox" ng-model="local.insertDBMediaUpload" ng-true-value="true" id="inDBMedia" ng-false-value="false">
<label for="inDBMedia" translate>medias.medias.uploadInsert</label>
Expand Down
2 changes: 1 addition & 1 deletion backoffice/app/modules/views/modal/modules-new.html
Expand Up @@ -8,7 +8,7 @@ <h3 translate>modules.new.createNewModule</h3>
<p translate style="text-align: center;">modules.addMod</p>
<div class="col-md-12" style="text-align: center;">
<div class="col-md-6" style="width: 100%;">
<ns-upload-files is-selected="nsUploadFiles.isSelected" accepttype=".zip" multiple="false" type="module" before-function="before()" after-function="uploaded" on-error="uploadError()"></ns-upload-files>
<ns-upload-files is-selected="nsUploadFiles.isSelected" accepttype=".zip" multiple="false" type="module" before-function="before" after-function="uploaded" on-error="uploadError()"></ns-upload-files>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion backoffice/app/picto/picto.controllers.js
Expand Up @@ -189,7 +189,7 @@ PictoControllers.controller('PictoNewCtrl', [
};

$scope.save = function (back) {
if ($scope.picto === undefined || $scope.picto.code === "" || $scope.picto.title === "") {
if ($scope.picto === undefined || $scope.picto.title === "") {
toastService.toast("danger", $translate.instant("picto.details.formPictoIncomplete"));
return;
}
Expand Down
3 changes: 1 addition & 2 deletions backoffice/app/picto/views/picto-details.html
Expand Up @@ -61,8 +61,7 @@ <h4 style="text-transform: uppercase" translate>picto.details.saveFirst</h4>
<div class="form-group row">
<label for="code" class="col-sm-3 control-label" translate>picto.details.code</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="code" ng-model="picto.code" name="code"
required>
<input type="text" class="form-control" id="code" ng-model="picto.code" name="code">
</div>
</div>
<br />
Expand Down
2 changes: 1 addition & 1 deletion backoffice/app/product/product.controllers.js
Expand Up @@ -376,7 +376,7 @@ ProductControllers.controller("nsProductCategories", [
tab.push({id: productID, checked: true});
}
//we save
CategoryV2.save({_id: node._id, productsList: tab}, function () {
CategoryV2.save({_id: node._id, code: node.code, productsList: tab}, function () {

});
};
Expand Down
Expand Up @@ -3,7 +3,7 @@ <h3 translate>product.general.infoGen</h3>
<div class="col-sm-11">
<label for="code" class="col-sm-2 control-label" translate>product.general.code</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="code" name="code" ng-model="product.code" ng-disabled="isEditMode" required>
<input type="text" class="form-control" id="code" name="code" ng-model="product.code" ng-disabled="isEditMode">
<div class="ns-error-message">
<div ng-show="(form.code.$dirty || form.nsSubmitted) && form.code.$error.required" translate>product.general.fieldReq</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion backoffice/app/productBundle/bundleProduct.controllers.js
Expand Up @@ -313,7 +313,7 @@ BundleProductControllers.controller("BundleProductCtrl", [
});
}
}else{
strInvalidFields = checkForm(["code", "name"]);
strInvalidFields = checkForm(["name"]);
}
//we remove ", "
if(strInvalidFields.substring(strInvalidFields.length-2, strInvalidFields.length) == ", "){
Expand Down
2 changes: 1 addition & 1 deletion backoffice/app/productSimple/simpleProduct.controllers.js
Expand Up @@ -219,7 +219,7 @@ SimpleProductControllers.controller("SimpleProductCtrl", [
});
}
} else {
strInvalidFields = checkForm(["code", "name"]);
strInvalidFields = checkForm(["name"]);
}
//we remove ", "
if (strInvalidFields.substring(strInvalidFields.length - 2, strInvalidFields.length) == ", ") {
Expand Down
2 changes: 1 addition & 1 deletion backoffice/app/shipment/views/shipment-detail.html
Expand Up @@ -36,7 +36,7 @@
<input type="text" class="form-control" id="code" translate translate-attr-placeholder='shipment.detail.ph1'
ng-model="shipment.code"
name="code"
required>
>
</div>
</div>
<div class="form-group">
Expand Down
2 changes: 1 addition & 1 deletion backoffice/app/staticPage/views/staticPage-new.html
Expand Up @@ -9,7 +9,7 @@
<label class="col-sm-2 control-label" translate>static.new.code</label>
<div class="col-sm-4">
<input type="text" class="form-control ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched" id="code" translate translate-attr-placeholder='static.new.ph1'
ng-model="static.code" required="" />
ng-model="static.code" required />
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion backoffice/app/supplier/views/supplier-new.html
Expand Up @@ -16,7 +16,7 @@
<div class="form-group">
<label for="code" class="col-sm-2 control-label" translate>supplier.new.code</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="code" translate translate-attr-placeholder='supplier.new.ph1' ng-model="supplier.code" required>
<input type="text" class="form-control" id="code" translate translate-attr-placeholder='supplier.new.ph1' ng-model="supplier.code">
</div>
</div>
<div class="form-group">
Expand Down
2 changes: 1 addition & 1 deletion backoffice/app/system/views/system.html
Expand Up @@ -107,7 +107,7 @@ <h3 translate>system.environment.other.dlAllDocumentTitle</h3>
<div class="form-group">
<label translate>system.environment.other.uploadAllDocument</label>
<ns-upload-files accepttype=".zip" multiple="false" type="document" is-selected="isSelected"
before-function="beforeDocument()" after-function="uploadedDocument"></ns-upload-files>
before-function="beforeDocument" after-function="uploadedDocument"></ns-upload-files>
<div translate>system.environment.other.uploadAllDocumentInfo</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion backoffice/app/themes/views/modals/themes-new.html
Expand Up @@ -6,7 +6,7 @@ <h3 translate>themes.new.createNewTheme</h3>
<div class="row">
<div class="col-md-12">
<label translate="">themes.newtheme</label>
<ns-upload-files accepttype=".zip" multiple="false" type="theme" before-function="beforeTheme()" after-function="uploadedTheme" on-error="onErrorUploadTheme()"></ns-upload-files>
<ns-upload-files accepttype=".zip" multiple="false" type="theme" before-function="beforeTheme" after-function="uploadedTheme" on-error="onErrorUploadTheme()"></ns-upload-files>
<div ng-show="showThemeLoading" id="overlayModule">
<div class="fa fa-spinner fa-spin" style="font-size: 70px;"></div>
</div>
Expand Down
28 changes: 14 additions & 14 deletions backoffice/js/directives.js
Expand Up @@ -2271,7 +2271,7 @@ adminCatagenDirectives.directive("nsUploadFiles", [
entity: "=",
showalt: '@',
accepttype: '@',
beforeFunction: '&',
beforeFunction: '=',
afterFunction: '=',
onError: '&',
styleProp: '=',
Expand Down Expand Up @@ -2321,7 +2321,7 @@ adminCatagenDirectives.directive("nsUploadFiles", [
for (var i = 0; i < files.length; i++) {
var file = files[i];
if (!file.$error) {
$scope.beforeFunction();
if(typeof $scope.beforeFunction === 'function') $scope.beforeFunction();
if ($scope.type === "module"){
$scope.up = Upload.upload({
url: 'v2/modules/upload',
Expand Down Expand Up @@ -2403,63 +2403,63 @@ adminCatagenDirectives.directive("nsUploadFiles", [
case 'productsVariant':
case 'products': {
$scope.images.push(response.data);
$scope.afterFunction({data: response.data});
if(typeof $scope.afterFunction === 'function') $scope.afterFunction({data: response.data});
break;
}
case 'picto': {
$scope.entity.filename = response.data.name;
$scope.afterFunction({data: response.data});
if(typeof $scope.afterFunction === 'function') $scope.afterFunction({data: response.data});
break;
}
case 'trademark': {
$scope.entity.logo = response.data.name;
$scope.afterFunction({data: response.data});
if(typeof $scope.afterFunction === 'function') $scope.afterFunction({data: response.data});
break;
}
case 'language': {
$scope.entity.img = response.data.path;
$scope.afterFunction({data: response.data});
if(typeof $scope.afterFunction === 'function') $scope.afterFunction({data: response.data});
break;
}
case 'article': {
$scope.entity.img = response.data.path;
$scope.afterFunction({data: response.data});
if(typeof $scope.afterFunction === 'function') $scope.afterFunction({data: response.data});
break;
}
case 'media': {
$scope.entity.link = response.data.path;
$scope.entity._id = response.data.id;
$scope.idOptional = response.data.id;
$scope.afterFunction({data: response.data});
if(typeof $scope.afterFunction === 'function') $scope.afterFunction({data: response.data});
break;
}
case 'gallery': {
$scope.entity = response.data;
$scope.images.push(response.data);
$scope.afterFunction({data: response.data});
if(typeof $scope.afterFunction === 'function') $scope.afterFunction({data: response.data});
break;
}
case 'slider': {
$scope.images.push(response.data);
$scope.afterFunction({data: response.data});
if(typeof $scope.afterFunction === 'function') $scope.afterFunction({data: response.data});
break;
}
case 'module': {
$scope.afterFunction({module: response.data});
if(typeof $scope.afterFunction === 'function') $scope.afterFunction({module: response.data});
break;
}
case 'attribute': {
$scope.entity.value = response.data.path;
$scope.afterFunction({data: response.data});
if(typeof $scope.afterFunction === 'function') $scope.afterFunction({data: response.data});
break;
}
case 'option': {
$scope.entity.value[$scope.entity.line] = response.data.path;
$scope.afterFunction({data: response.data});
if(typeof $scope.afterFunction === 'function') $scope.afterFunction({data: response.data});
break;
}
default:
$scope.afterFunction({data: response.data});
if(typeof $scope.afterFunction === 'function') $scope.afterFunction({data: response.data});
break;
}
$scope.disableUpload = false;
Expand Down

0 comments on commit eb64467

Please sign in to comment.