Skip to content

New Form and Datalist component #162

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

Draft
wants to merge 80 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
c7e6576
introduction of a forms component
reusr1 Aug 12, 2020
eec8db3
Added success page and failure message dialog options
qial Aug 13, 2020
e3cb545
Added more options to Form's model
qial Aug 17, 2020
f0b255b
Updated form component with test submit code
qial Aug 17, 2020
289a91e
Updated form to use javascript function correctly and fixed dialog is…
qial Aug 19, 2020
d4dc94d
Fixed failure message coming through
qial Aug 19, 2020
cbfe6d7
Updated submitfunction workings
qial Aug 19, 2020
2bb5e16
Updated submitfunction to correctly handle all forms of functions and…
qial Aug 20, 2020
74bb4e7
Fixed functions inside of objects, but doesn't fail well when the obj…
qial Aug 20, 2020
07ce128
Fixed functions inside nested objects in the submitfunction dialog
qial Aug 20, 2020
77057b8
Changed defaultSubmit to onSubmit, changed function not found alert t…
qial Aug 20, 2020
fd9728f
Fixed some styling issues, cleaned up form dialog with hints
qial Aug 20, 2020
5152f32
Updated onSubmit closure to better format so 'this' is carried over
qial Aug 20, 2020
88ca794
Cleaned up useless cases in the submit function loop
qial Aug 20, 2020
75dcf2f
Updated error messages for bad json in the form field model
qial Aug 20, 2020
0196f01
Added _blank target to form model docs link, and removed inline editi…
qial Aug 20, 2020
9c83f7b
poc style implementation of a data list component and a save/load han…
reusr1 Aug 20, 2020
35849d3
Merge branch 'issues/136' of https://github.com/headwirecom/themeclea…
reusr1 Aug 20, 2020
ce28f34
Updated form samples and added sample-all with all supported inputs
qial Aug 21, 2020
99450b8
Updated sample content to fix jcr import error
qial Aug 21, 2020
4184cc1
#136 added styles to error messages and submit btn
smcgrath0 Aug 24, 2020
ba6e404
Fixed Submit button text and other issues with formatting
qial Aug 24, 2020
77c84f1
#136 added transition for error message
smcgrath0 Aug 24, 2020
6ae0a1c
#136 added submit button in all example schemas and removed in markup
smcgrath0 Aug 24, 2020
b44317b
Merge branch 'issues/136' of https://github.com/headwirecom/themeclea…
smcgrath0 Aug 24, 2020
f247851
#136 added styles for all inputs
smcgrath0 Aug 24, 2020
9c24c09
#136 added button alignment and size dialog/styling
smcgrath0 Aug 24, 2020
3862af1
#136 fixed class string/fixed font on textarea/select
smcgrath0 Aug 25, 2020
e7da0a8
updated inline settings for failure messages
qial Aug 25, 2020
5dac11f
Added groups to the input type sample form
qial Aug 25, 2020
3fb9e95
#136 fixed form alignment issue/group styling/checkbox alignment
smcgrath0 Aug 25, 2020
2e29646
#136 dialog button size: sm,lg -> small, large
smcgrath0 Aug 25, 2020
797f0f0
Merge branch 'issues/136' of https://github.com/headwirecom/themeclea…
smcgrath0 Aug 25, 2020
c0b1a49
#156 initial markup
smcgrath0 Aug 25, 2020
c9eceb6
#156 added sortable styles
smcgrath0 Aug 26, 2020
68970ee
#156 built out datalist dialog options
qial Aug 26, 2020
eef1767
#156 fixed table configuration dialog headers
qial Aug 26, 2020
f86a1bb
#156 reordered dialog option for datalist
qial Aug 26, 2020
71cb5e1
#156 updating datalist to load data from localStorage according to di…
qial Aug 27, 2020
79f72a4
#156 styles to dialog
smcgrath0 Aug 27, 2020
b1861da
Merge branch 'issues/156' of https://github.com/headwirecom/themeclea…
smcgrath0 Aug 27, 2020
09f9ab5
#156 added pagination and reformatted hatch
smcgrath0 Aug 27, 2020
b258694
#156 updated endpointurl so datalist can easily load backing data jso…
qial Aug 27, 2020
725c805
#156 added mobile table, removed sorting, fixed header/strip colors
smcgrath0 Aug 28, 2020
874abdb
#156 added text to show when datalist is not configured
smcgrath0 Aug 28, 2020
39a908d
#156 updated loadfunction code and fixed dialog names and error logging
qial Aug 31, 2020
2d8341a
#156 added selected actions
smcgrath0 Aug 31, 2020
c907cd4
Merge branch 'issues/156' of https://github.com/headwirecom/themeclea…
smcgrath0 Aug 31, 2020
0f8b2f3
#156 fixed string error in mounted
smcgrath0 Aug 31, 2020
8d7a1f4
#156 removed pagination
smcgrath0 Aug 31, 2020
9ebf951
#156 Added a start to the forms documentation. Still needs more infor…
qial Aug 31, 2020
1750217
#156 start of datalist docs
smcgrath0 Sep 1, 2020
b614b41
#156 added deletebutton event
smcgrath0 Sep 1, 2020
12f4b29
#156 added hover style to action buttons
smcgrath0 Sep 1, 2020
88413f6
#156 Updated datalist docs, added deletefuntion config and started re…
qial Sep 1, 2020
b8bcf2f
#156 updated documentation with quickstart instructions
qial Sep 2, 2020
1bbea53
#156 squashing bugs in the delete functionality, cleaned up data load…
qial Sep 2, 2020
79a37da
#156 fixed always checked when no elements in table
smcgrath0 Sep 2, 2020
f8b02c4
#156 put selectable action in its own column
smcgrath0 Sep 2, 2020
7b1bef0
#156 hid empty rows and fixed json stringify
qial Sep 2, 2020
6fe91ec
#156 added text alignment for individual columns
smcgrath0 Sep 3, 2020
5cbca32
#156 text align defaults to left if not set
smcgrath0 Sep 3, 2020
c681126
#156 added row alignment
smcgrath0 Sep 3, 2020
366508d
#156 added mobile actions
smcgrath0 Sep 3, 2020
6234679
#156 updated docs and delete function on formsapp
qial Sep 4, 2020
fa60012
#156 added default mobile table style
smcgrath0 Sep 4, 2020
3ced731
Merge branch 'issues/156' of https://github.com/headwirecom/themeclea…
smcgrath0 Sep 4, 2020
51c8a9c
#136 removed form error transition
smcgrath0 Sep 4, 2020
448ee96
#156 fixed datalist deleting and loading
qial Sep 4, 2020
66f1353
#156 updated form submitfunction loop to be simpler, fixed formatting…
qial Sep 4, 2020
f3f372f
Bringing in changes so that failure text no longer times out
qial Sep 4, 2020
fe2c405
Merge remote-tracking branch 'upstream/issues/136' into issues/136
qial Sep 4, 2020
056aa96
#136 removing a final setTimeout on the error message
qial Sep 4, 2020
e6508b9
\#156 Merging in form changes from issues/136 branch
qial Sep 4, 2020
d9f11fd
Merge branch 'develop' of https://github.com/headwirecom/themeclean-f…
smcgrath0 Sep 4, 2020
733a4a3
#156 fixed desktop table when gets too large
smcgrath0 Sep 8, 2020
c4438fd
#156 fixed if no success page is configured
smcgrath0 Sep 8, 2020
72e6bb9
#156 fixed successpage not working on javascript functions
smcgrath0 Sep 8, 2020
64adeb7
peregrine-cms#460 - Added the Image Info annotation to the Peregrine …
reggie7 Dec 23, 2020
1efc1a5
Merge remote-tracking branch 'origin/develop-sling12' into issues/156
Mar 4, 2021
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
4 changes: 2 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>7</source>
<target>7</target>
<source>${archetype.java.version}</source>
<target>${archetype.java.version}</target>
</configuration>
</plugin>
<plugin>
Expand Down
291 changes: 291 additions & 0 deletions core/src/main/java/com/themecleanflex/models/CardModel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,291 @@
package com.themecleanflex.models;

import com.peregrine.nodetypes.models.AbstractComponent;
import com.peregrine.nodetypes.models.IComponent;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Default;
import org.apache.sling.models.annotations.DefaultInjectionStrategy;
import org.apache.sling.models.annotations.Model;

import javax.inject.Inject;

import com.peregrine.model.api.ImageInfo;
import java.awt.Dimension;


/*
//GEN[:DATA
{
"name": "Card",
"modelName": "Card",
"componentPath": "themecleanflex/components/cards/cards",
"package": "com.themecleanflex.models",
"classNameParent": "AbstractComponent",
"definitions": {
"Card": {
"type": "string",
"x-source": "inject",
"x-form-label": "Cards",
"x-form-fieldLabel": "title",
"x-form-type": "collection",
"x-collection-type": "Card",
"properties": {
"title": {
"type": "string",
"x-source": "inject",
"x-form-label": "Card Title",
"x-form-visible": "model.showtitle == 'true'",
"x-form-type": "text"
},
"text": {
"type": "string",
"x-source": "inject",
"x-form-label": "Card Text",
"x-form-visible": "model.showtext == 'true'",
"x-form-type": "texteditor"
},
"image": {
"type": "string",
"x-source": "inject",
"x-form-label": "Card Image",
"x-form-type": "pathbrowser",
"x-form-browserRoot": "/content/themecleanflex/assets",
"x-annotate": "size"
},
"imagewidth": {
"type": "string",
"x-source": "inject",
"x-form-label": "Image Width",
"x-form-type": "materialrange",
"x-default": "100",
"x-form-min": "10",
"x-form-max": "100"
},
"imagealttext": {
"type": "string",
"x-source": "inject",
"x-form-label": "Image Alt Text",
"x-form-type": "text"
},
"buttontext": {
"type": "string",
"x-source": "inject",
"x-form-label": "Button Text",
"x-form-visible": "model.showbutton == 'true'",
"x-form-type": "text"
},
"buttonlink": {
"type": "string",
"x-source": "inject",
"x-form-label": "Button Link",
"x-form-visible": "model.showbutton == 'true'",
"x-form-type": "pathbrowser",
"x-form-browserRoot": "/content/themecleanflex/pages"
},
"buttoncolor": {
"type": "string",
"x-source": "inject",
"x-form-label": "Button Color",
"x-form-type": "materialselect",
"x-default": "primary",
"properties": {
"primary": {
"x-form-name": "Primary",
"x-form-value": "primary"
},
"secondary": {
"x-form-name": "Secondary",
"x-form-value": "secondary"
},
"success": {
"x-form-name": "Success",
"x-form-value": "success"
},
"danger": {
"x-form-name": "Danger",
"x-form-value": "danger"
},
"warning": {
"x-form-name": "Warning",
"x-form-value": "warning"
},
"info": {
"x-form-name": "Info",
"x-form-value": "info"
}
}
},
"buttonsize": {
"type": "string",
"x-source": "inject",
"x-form-label": "Button Size",
"x-form-type": "materialselect",
"x-default": "default",
"properties": {
"default": {
"x-form-name": "Default",
"x-form-value": "default"
},
"large": {
"x-form-name": "Large",
"x-form-value": "large"
},
"small": {
"x-form-name": "Small",
"x-form-value": "small"
}
}
},
"buttonalign": {
"type": "string",
"x-source": "inject",
"x-form-label": "Button Alignment",
"x-form-type": "materialselect",
"x-default": "center",
"properties": {
"left": {
"x-form-name": "Left",
"x-form-value": "left"
},
"center": {
"x-form-name": "Center",
"x-form-value": "center"
},
"right": {
"x-form-name": "Right",
"x-form-value": "right"
}
}
}
}
}
}
}
//GEN]
*/

//GEN[:DEF
@Model(
adaptables = Resource.class,
defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL,
adapters = IComponent.class
)
//GEN]
public class CardModel extends AbstractComponent {

public CardModel(final Resource r) { super(r); }

//GEN[:INJECT
/* {"type":"string","x-source":"inject","x-form-label":"Card Title","x-form-visible":"model.showtitle == 'true'","x-form-type":"text"} */
@Inject
private String title;

/* {"type":"string","x-source":"inject","x-form-label":"Card Text","x-form-visible":"model.showtext == 'true'","x-form-type":"texteditor"} */
@Inject
private String text;

/* {"type":"string","x-source":"inject","x-form-label":"Card Image","x-form-type":"pathbrowser","x-form-browserRoot":"/content/themecleanflex/assets","x-annotate":"size"} */
@Inject
private String image;

@Inject
@ImageInfo(name="image")
private Dimension imageSize;

/* {"type":"string","x-source":"inject","x-form-label":"Image Width","x-form-type":"materialrange","x-default":"100","x-form-min":"10","x-form-max":"100"} */
@Inject
@Default(values ="100")
private String imagewidth;

/* {"type":"string","x-source":"inject","x-form-label":"Image Alt Text","x-form-type":"text"} */
@Inject
private String imagealttext;

/* {"type":"string","x-source":"inject","x-form-label":"Button Text","x-form-visible":"model.showbutton == 'true'","x-form-type":"text"} */
@Inject
private String buttontext;

/* {"type":"string","x-source":"inject","x-form-label":"Button Link","x-form-visible":"model.showbutton == 'true'","x-form-type":"pathbrowser","x-form-browserRoot":"/content/themecleanflex/pages"} */
@Inject
private String buttonlink;

/* {"type":"string","x-source":"inject","x-form-label":"Button Color","x-form-type":"materialselect","x-default":"primary","properties":{"primary":{"x-form-name":"Primary","x-form-value":"primary"},"secondary":{"x-form-name":"Secondary","x-form-value":"secondary"},"success":{"x-form-name":"Success","x-form-value":"success"},"danger":{"x-form-name":"Danger","x-form-value":"danger"},"warning":{"x-form-name":"Warning","x-form-value":"warning"},"info":{"x-form-name":"Info","x-form-value":"info"}}} */
@Inject
@Default(values ="primary")
private String buttoncolor;

/* {"type":"string","x-source":"inject","x-form-label":"Button Size","x-form-type":"materialselect","x-default":"default","properties":{"default":{"x-form-name":"Default","x-form-value":"default"},"large":{"x-form-name":"Large","x-form-value":"large"},"small":{"x-form-name":"Small","x-form-value":"small"}}} */
@Inject
@Default(values ="default")
private String buttonsize;

/* {"type":"string","x-source":"inject","x-form-label":"Button Alignment","x-form-type":"materialselect","x-default":"center","properties":{"left":{"x-form-name":"Left","x-form-value":"left"},"center":{"x-form-name":"Center","x-form-value":"center"},"right":{"x-form-name":"Right","x-form-value":"right"}}} */
@Inject
@Default(values ="center")
private String buttonalign;


//GEN]

//GEN[:GETTERS
/* {"type":"string","x-source":"inject","x-form-label":"Card Title","x-form-visible":"model.showtitle == 'true'","x-form-type":"text"} */
public String getTitle() {
return title;
}

/* {"type":"string","x-source":"inject","x-form-label":"Card Text","x-form-visible":"model.showtext == 'true'","x-form-type":"texteditor"} */
public String getText() {
return text;
}

/* {"type":"string","x-source":"inject","x-form-label":"Card Image","x-form-type":"pathbrowser","x-form-browserRoot":"/content/themecleanflex/assets","x-annotate":"size"} */
public String getImage() {
return image;
}

public Dimension getImageSize() {
return imageSize;
}

/* {"type":"string","x-source":"inject","x-form-label":"Image Width","x-form-type":"materialrange","x-default":"100","x-form-min":"10","x-form-max":"100"} */
public String getImagewidth() {
return imagewidth;
}

/* {"type":"string","x-source":"inject","x-form-label":"Image Alt Text","x-form-type":"text"} */
public String getImagealttext() {
return imagealttext;
}

/* {"type":"string","x-source":"inject","x-form-label":"Button Text","x-form-visible":"model.showbutton == 'true'","x-form-type":"text"} */
public String getButtontext() {
return buttontext;
}

/* {"type":"string","x-source":"inject","x-form-label":"Button Link","x-form-visible":"model.showbutton == 'true'","x-form-type":"pathbrowser","x-form-browserRoot":"/content/themecleanflex/pages"} */
public String getButtonlink() {
return buttonlink;
}

/* {"type":"string","x-source":"inject","x-form-label":"Button Color","x-form-type":"materialselect","x-default":"primary","properties":{"primary":{"x-form-name":"Primary","x-form-value":"primary"},"secondary":{"x-form-name":"Secondary","x-form-value":"secondary"},"success":{"x-form-name":"Success","x-form-value":"success"},"danger":{"x-form-name":"Danger","x-form-value":"danger"},"warning":{"x-form-name":"Warning","x-form-value":"warning"},"info":{"x-form-name":"Info","x-form-value":"info"}}} */
public String getButtoncolor() {
return buttoncolor;
}

/* {"type":"string","x-source":"inject","x-form-label":"Button Size","x-form-type":"materialselect","x-default":"default","properties":{"default":{"x-form-name":"Default","x-form-value":"default"},"large":{"x-form-name":"Large","x-form-value":"large"},"small":{"x-form-name":"Small","x-form-value":"small"}}} */
public String getButtonsize() {
return buttonsize;
}

/* {"type":"string","x-source":"inject","x-form-label":"Button Alignment","x-form-type":"materialselect","x-default":"center","properties":{"left":{"x-form-name":"Left","x-form-value":"left"},"center":{"x-form-name":"Center","x-form-value":"center"},"right":{"x-form-name":"Right","x-form-value":"right"}}} */
public String getButtonalign() {
return buttonalign;
}


//GEN]

//GEN[:CUSTOMGETTERS
//GEN]

}
Loading