Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LPS-108168 SF #43

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
7081f4a
LPS-111055 Add props to FormRenderer component
aline-doleron Apr 8, 2020
6376b5a
LPS-111055 Configure pagination range according to SuccessPage visibi…
aline-doleron Apr 8, 2020
309e9da
LPS-111055 Get page number by a given node
aline-doleron Apr 8, 2020
799b4f7
LPS-111055 Add pagination style
aline-doleron Apr 8, 2020
52c4f67
LPS-111055 Remove methods that were moved to PageRenderer component
aline-doleron Apr 8, 2020
360fcb0
LPS-111055 Add a new page after the given page index
aline-doleron Apr 8, 2020
3341cb7
LPS-111055 Reset page by the given page index
aline-doleron Apr 8, 2020
d7cbf17
LPS-111055 Change string of Page title
aline-doleron Apr 8, 2020
8342655
LPS-111055 Move SuccessPage files from FormBuilder package to FormRen…
aline-doleron Apr 8, 2020
d7ee152
LPS-111055 Add parameters used by PageRenderer
aline-doleron Apr 8, 2020
709744d
LPS-111055 Create template of MultiPages
aline-doleron Apr 8, 2020
d9d0499
LPS-111055 Disable Success Page for Element sets
aline-doleron Apr 8, 2020
094d0fd
LPS-111055 Add methods to handle page actions
aline-doleron Apr 8, 2020
bba3dab
LPS-111055 Add dropdown of page actions
aline-doleron Apr 8, 2020
6a871a6
LPS-111055 Add buttons to Add new page and add success page
aline-doleron Apr 8, 2020
9b5fb8f
LPS-111055 SF
aline-doleron Apr 8, 2020
8b54513
LPS-111055 Avoid blinking wizard pagination on "Element Sets" screen
aline-doleron Apr 8, 2020
00a71be
LPS-111055 Add util methods
aline-doleron Apr 8, 2020
11b9d4c
LPS-111055 Adjust css to meet the design requirements
aline-doleron Apr 8, 2020
020a93c
LPS-111055 Set Success Page enabled by default
aline-doleron Apr 8, 2020
09e57b3
LPS-111055 Add new words
aline-doleron Apr 8, 2020
0e75056
LPS-111055 Auto sf
aline-doleron Apr 8, 2020
1869699
LPS-111055 Change type of comment
aline-doleron Apr 10, 2020
ab69750
LPS-111055 Change variable name
aline-doleron Apr 10, 2020
f2fcbd1
LPS-111055 Change key language
aline-doleron Apr 10, 2020
c1d28ce
LPS-111055 Remove unused method and file
aline-doleron Apr 10, 2020
d994dff
LPS-111055 Fix key
aline-doleron Apr 10, 2020
92f8697
LPS-108168 Add missing parameters
aline-doleron May 13, 2020
96eb1dd
LPS-108168 Fix div closing tag
aline-doleron May 14, 2020
0b16d2e
LPS-108168 Remove success page tests
aline-doleron May 14, 2020
cce0fd4
LPS-108168 Add arguments on dispatch call
aline-doleron May 14, 2020
a449a90
LPS-111879 - Fix Forms#ViewSuccessPage test
cvanut Apr 17, 2020
4796a3c
LPS-108168 - Adjustments in DeletePages test
cvanut Apr 30, 2020
5a142d6
LPS-108168 - Fix tests that use editPageTitle
cvanut May 3, 2020
a4bd24f
LPS-108168 - Fix addPage and add fieldPositionNumber to tests.
cvanut May 4, 2020
b34fbc3
LPS-108168 - Fix Jump to Page tests.
cvanut May 7, 2020
f40b818
LPS-108168 - FormsJumpToPage#ViewPagesAfterJump.
cvanut May 11, 2020
b4cefe2
LPS-108168 - Fix add text to Paragraph field with CKeditor.
cvanut May 12, 2020
82b26c9
LPS-108168 - Adjust variable name - key_fieldLocation.
cvanut May 13, 2020
28dda48
LPS-108168 SF
May 14, 2020
3171704
LPS-108168 SF
May 14, 2020
dce05e7
LPS-108168 SF
May 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,33 @@ $c: '.ddm-form-pagination';
padding: 0;
position: relative;

&.bottom .ddm-paginated-builder-dropdown {
bottom: 25px;
}

&.top .ddm-paginated-builder-dropdown {
top: 45px;
}
}

.horizontal-line {
background-color: #cdced9;
height: 1px;
margin-bottom: 40px;
margin-top: 40px;
padding: 0 10px;
}

.page {
padding: 0;
position: relative;

h5.pagination {
color: #a7a9bc;
font-size: 10px;
text-transform: uppercase;
}

.ddm-paginated-builder-dropdown {
position: absolute;
right: 3rem;
Expand All @@ -60,6 +87,31 @@ $c: '.ddm-form-pagination';
}

&.top .ddm-paginated-builder-dropdown {
top: 45px;
right: 20px;
top: 20px;
}

.add-page-button-container {
align-items: center;
display: flex;
margin: 20px 0;

.add-page-button {
margin: 0 10px;
white-space: nowrap;
}

.horizontal-line {
background-color: #cdced9;
height: 1px;
margin: 4px 0;
padding: 0;
width: 100%;
}
}

.sheet {
margin: 0;
padding: 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
* details.
*/

import '../SuccessPage/SuccessPage.es';

import {PagesVisitor, compose} from 'dynamic-data-mapping-form-renderer';
import FormRenderer from 'dynamic-data-mapping-form-renderer/js/components/FormRenderer/FormRenderer.es';
import Component from 'metal-jsx';
Expand Down Expand Up @@ -83,23 +81,25 @@ class FormBuilderBase extends Component {
paginationMode,
portletNamespace,
spritemap,
successPageSettings,
view,
} = props;

return (
<div class="ddm-form-builder-wrapper">
<div class="container ddm-form-builder">
<div class="sheet">
<FormRenderer
activePage={activePage}
editable={true}
editingLanguageId={editingLanguageId}
pages={this.preparePagesForRender(pages)}
paginationMode={paginationMode}
portletNamespace={portletNamespace}
ref="FormRenderer"
spritemap={spritemap}
/>
</div>
<FormRenderer
activePage={activePage}
editable={true}
editingLanguageId={editingLanguageId}
pages={this.preparePagesForRender(pages)}
paginationMode={paginationMode}
portletNamespace={portletNamespace}
ref="FormRenderer"
spritemap={spritemap}
successPageSettings={successPageSettings}
view={view}
/>
</div>
</div>
);
Expand Down Expand Up @@ -189,6 +189,15 @@ FormBuilderBase.PROPS = {
*/

view: Config.string(),

/**
* @default undefined
* @instance
* @memberof FormBuilder
* @type {?bool}
*/

viewMode: Config.bool(),
};

export default compose(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import './EditablePageHeader.soy';

import {PagesVisitor} from 'dynamic-data-mapping-form-renderer';
import dom from 'metal-dom';
import {EventHandler} from 'metal-events';
import Component from 'metal-jsx';

Expand Down Expand Up @@ -48,16 +49,22 @@ const withEditablePageHeader = (ChildComponent) => {
const {pages} = this.props;
const total = pages.length;
const visitor = new PagesVisitor(pages);
let lastPageIndex = total;

if (pages[pages.length - 1].contentRenderer == 'success') {
lastPageIndex = total - 1;
}

return visitor.mapPages((page, pageIndex) => {
return {
...page,
headerRenderer: 'editable',
pageIndex,
placeholder: sub(
Liferay.Language.get('untitled-page-x-of-x'),
[pageIndex + 1, total]
),
pagination: sub(Liferay.Language.get('page-x-of-x'), [
pageIndex + 1,
lastPageIndex,
]),
placeholder: Liferay.Language.get('page-title'),
total,
};
});
Expand All @@ -71,17 +78,30 @@ const withEditablePageHeader = (ChildComponent) => {
);
}

_getPageNumber(node) {
let pageNumber;

const element = dom.closest(node, '[data-ddm-page]');

if (element) {
pageNumber = parseInt(element.dataset.ddmPage, 10);
}

return pageNumber;
}

_handlePageDescriptionChanged(event) {
const {activePage, editingLanguageId, pages} = this.props;
const {delegateTarget} = event;
const {editingLanguageId, pages} = this.props;
const {delegateTarget, target} = event;
const {dispatch} = this.context;
const currentPage = this._getPageNumber(target);
const value = delegateTarget.value;
const visitor = new PagesVisitor(pages);

dispatch(
'pagesUpdated',
visitor.mapPages((page, pageIndex) => {
if (pageIndex === activePage) {
if (pageIndex === currentPage) {
page = {
...page,
description: value,
Expand All @@ -98,16 +118,17 @@ const withEditablePageHeader = (ChildComponent) => {
}

_handlePageTitleChanged(event) {
const {activePage, editingLanguageId, pages} = this.props;
const {delegateTarget} = event;
const {editingLanguageId, pages} = this.props;
const {delegateTarget, target} = event;
const {dispatch} = this.context;
const currentPage = this._getPageNumber(target);
const value = delegateTarget.value;
const visitor = new PagesVisitor(pages);

dispatch(
'pagesUpdated',
visitor.mapPages((page, pageIndex) => {
if (pageIndex === activePage) {
if (pageIndex === currentPage) {
page = {
...page,
localizedTitle: {
Expand Down
Loading