Commit 43fed127 authored by julienmege's avatar julienmege Committed by benjaminParisel

fix(validation) Artifact name size limitation set to 228 characters. (#2535)

* fix(validation) Artifact name size limitation set to 228 characters.

-also review CSS to allows the display of long artifact name every where

closes [BS-18911](https://bonitasoft.atlassian.net/browse/BS-18911)
parent 9bd3b5d1
......@@ -5,7 +5,7 @@
class ArtifactNameValidationController {
constructor(gettextCatalog) {
this.maxlength = 240;
this.maxlength = 228;
this.validators = {
pattern: gettextCatalog.getString('Name must contains only alphanumeric characters with no space'),
maxlength: gettextCatalog.getString('Name must be less than {{maxlength}} characters long', this)
......
<div class="modal-header">
<h3 class="modal-title" translate>Export {{ctrl.page.name}}</h3>
<h3 class="modal-title break-word" translate>Export {{ctrl.page.name}}</h3>
</div>
<form class="form EditorHeader-exportForm" name="exportPage">
<div class="modal-body" id="modal-export-page">
......
<div class="modal-header">
<h3 class="modal-title" translate>Save {{ctrl.page.name}} as...</h3>
<h3 class="modal-title break-word" translate>Save {{ctrl.page.name}} as...</h3>
</div>
<form class="form" name="newPage">
<div class="modal-body" id="modal-save-page-as">
......
......@@ -12,7 +12,7 @@
{{ type }}
</translate>
:
<span style="margin-left: 2px" class="badge" ng-repeat="artifact in artifacts">
<span style="margin-left: 2px" class="badge break-word" ng-repeat="artifact in artifacts">
{{ artifact.name }}
</span>
</li>
......
......@@ -2,7 +2,7 @@
<div class="modal-header">
<h3 class="modal-title" translate>Confirm deletion</h3>
</div>
<div class="modal-body" translate>
<div class="modal-body break-word" translate>
Are you sure you want to delete the {{ artifact.type }} <b>{{ artifact.name }}</b>?
</div>
<div class="modal-footer">
......
<div class="Preview">
<nav class="navbar Preview-header" role="navigation">
<div class="navbar-header">
<span class="Preview-artifact-name" translate>Preview - {{pageName}}</span>
<navbar-toggle on-click="isNavCollapsed = !isNavCollapsed"></navbar-toggle>
<span class="navbar-brand" translate>Preview - {{pageName}}</span>
</div>
<div class="Preview-toolbar collapse navbar-collapse" uib-collapse="isNavCollapsed">
<ul class="nav navbar-nav">
......
......@@ -18,6 +18,15 @@
margin: auto;
}
}
&-artifact-name {
float: left;
padding: 15px 15px;
font-size: 18px;
line-height: 20px;
word-break: break-all;
word-wrap: break-word;
}
}
.Preview-viewport {
......
......@@ -233,3 +233,9 @@ html, body {
transform: translate3d(4px, 0, 0);
}
}
.break-word
{
word-wrap: break-word;
}
......@@ -40,7 +40,7 @@ describe('artifact name vaildation', function() {
expect(element.find('div[uib-tooltip-popup] .tooltip-inner').text()).toBe('Name must contains only alphanumeric characters with no space');
});
it('should display an error message in tooltip when name has more than 240 characters', function() {
it('should display an error message in tooltip when name has more than 228 characters', function() {
const longName = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890' +
'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890' +
'1234567890123456789012345678901234567890TooLong';
......@@ -50,7 +50,7 @@ describe('artifact name vaildation', function() {
expect(element.hasClass('ng-invalid')).toBeTruthy();
expect(element.hasClass('ng-invalid-maxlength')).toBeTruthy();
expect(element.find('div[uib-tooltip-popup] .tooltip-inner').text()).toBe('Name must be less than 240 characters long');
expect(element.find('div[uib-tooltip-popup] .tooltip-inner').text()).toBe('Name must be less than 228 characters long');
});
it('should display tooltip on top left by default', function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment