Skip to content

added prettier.io as an experiment for code formatting #190

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

Open
wants to merge 3 commits into
base: develop-sling12
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 7 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Thanks for helping us improve Peregrine CMS!
title: ''
title: ""
labels: bug
assignees: ''

assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,9 +24,10 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
- OS: [e.g. iOS]

- Browser [e.g. chrome, safari]
- Version [e.g. 22]
- OS: [e.g. iOS]

**Additional context**
Add any other context about the problem here.
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Thanks for helping us improve Peregrine CMS!
title: ''
title: ""
labels: enhancement
assignees: ''

assignees: ""
---

**Please describe the problem.**
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

**Where has this been tested?**

*Browser (version):*
_Browser (version):_
5 changes: 5 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"tabWidth": 4,
"useTabs": true,
"vueIndentScriptAndStyle": true
}
4 changes: 2 additions & 2 deletions .properties/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"appname": "themecleanflex"
}
"appname": "themecleanflex"
}
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: java

branches:
only:
- develop
only:
- develop

jdk:
- openjdk8
- openjdk8
11 changes: 5 additions & 6 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ This project was created by the Sling Project Maven Archetype which created
two modules:

1. **core**: OSGi Bundle deployed to Sling which includes your Servlets, Filters,
Sling Models and much more. This module is **not intended** to
contain Sling Content.
Sling Models and much more. This module is **not intended** to
contain Sling Content.
2. **ui.apps**: JCR Content Module which is used to install a JCR Package into Sling
by using **Composum**. For that it must be installed and the Composum
Package Manager must be whitelisted.
by using **Composum**. For that it must be installed and the Composum
Package Manager must be whitelisted.

There are also two modules which provide some examples; these have the same name as
above but with an extension **.example**. These modules should not be deployed, they
Expand Down Expand Up @@ -41,13 +41,12 @@ but the most important reason is that a JCR Package allows the **Sling
Tooling** to update a single file rather than an entire Bundle and also
to import a Node from Sling into the project.


#### Build and Installation

The project is built quite simple:

mvn clean install

To install the OSGi bundle use the project **autoInstallBundle**:

mvn clean install -P autoInstallBundle
Expand Down
20 changes: 14 additions & 6 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
Expand All @@ -17,7 +17,11 @@
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>

<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -52,8 +56,10 @@
<extensions>true</extensions>
<configuration>
<instructions>
<Embed-Dependency>*;scope=compile;inline=true</Embed-Dependency>
<Sling-Model-Packages>com.themecleanflex.models</Sling-Model-Packages>
<Embed-Dependency
>*;scope=compile;inline=true</Embed-Dependency>
<Sling-Model-Packages
>com.themecleanflex.models</Sling-Model-Packages>
<_dsannotations>*</_dsannotations>
<_metatypeannotations>*</_metatypeannotations>
<_removeheaders>
Expand All @@ -76,7 +82,8 @@
<groupId>org.apache.sling</groupId>
<artifactId>maven-sling-plugin</artifactId>
<configuration>
<slingUrl>http://${sling.host}:${sling.port}/system/console</slingUrl>
<slingUrl
>http://${sling.host}:${sling.port}/system/console</slingUrl>
<user>${sling.user}</user>
<password>${sling.password}</password>
</configuration>
Expand Down Expand Up @@ -170,7 +177,8 @@
</dependency>

<dependency>
<artifactId>org.apache.sling.scripting.sightly.compiler.java</artifactId>
<artifactId
>org.apache.sling.scripting.sightly.compiler.java</artifactId>
<version>1.0.8</version>
<groupId>org.apache.sling</groupId>
<scope>provided</scope>
Expand Down
87 changes: 40 additions & 47 deletions core/src/main/java/com/themecleanflex/models/AccordionModel.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
package com.themecleanflex.models;

import com.peregrine.model.api.ImageInfo;
import com.peregrine.nodetypes.models.AbstractComponent;
import com.peregrine.nodetypes.models.IComponent;
import java.awt.Dimension;
import java.util.List;
import javax.inject.Inject;
import javax.inject.Inject;
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.Exporter;
import org.apache.sling.models.annotations.Model;

import javax.inject.Inject;

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

/*
//GEN[:DATA
{
Expand Down Expand Up @@ -492,25 +490,23 @@

//GEN[:DEF
@Model(
adaptables = Resource.class,
resourceType = "themecleanflex/components/accordion",
defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL,
adapters = IComponent.class
adaptables = Resource.class,
resourceType = "themecleanflex/components/accordion",
defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL,
adapters = IComponent.class
)
@Exporter(
name = "jackson",
extensions = "json"
)

@Exporter(name = "jackson", extensions = "json")
//GEN]
public class AccordionModel extends AbstractComponent {

public AccordionModel(Resource r) { super(r); }
public AccordionModel(Resource r) {
super(r);
}

//GEN[:INJECT
/* {"type":"string","x-source":"inject","x-form-label":"Collapse Style","x-form-group":"style","x-form-type":"materialradio","x-default":"accordion","properties":{"toggle":{"x-form-name":"Toggle","x-form-value":"toggle"},"accordion":{"x-form-name":"Accordion","x-form-value":"accordion"}}} */
//GEN[:INJECT
/* {"type":"string","x-source":"inject","x-form-label":"Collapse Style","x-form-group":"style","x-form-type":"materialradio","x-default":"accordion","properties":{"toggle":{"x-form-name":"Toggle","x-form-value":"toggle"},"accordion":{"x-form-name":"Accordion","x-form-value":"accordion"}}} */
@Inject
@Default(values ="accordion")
@Default(values = "accordion")
private String toggletype;

/* {"type":"string","x-source":"inject","x-form-label":"Show Title","x-form-group":"style","x-form-type":"materialswitch"} */
Expand All @@ -531,16 +527,16 @@ public class AccordionModel extends AbstractComponent {

/* {"type":"string","x-source":"inject","x-form-label":"Image Source","x-form-visible":"model.mediatype == 'image' and model.showmedia == 'true'","x-form-group":"style","x-form-type":"pathbrowser","x-form-browserRoot":"/content/themecleanflex/assets","x-default":"","x-annotate":"size"} */
@Inject
@Default(values ="")
@Default(values = "")
private String imagesrc;

@Inject
@ImageInfo(name="imagesrc")
@ImageInfo(name = "imagesrc")
private Dimension imagesrcSize;

/* {"type":"string","x-source":"inject","x-form-label":"Video Source","x-form-visible":"model.mediatype == 'video' and model.showmedia == 'true'","x-form-group":"style","x-form-type":"pathbrowser","x-form-browserRoot":"/content/themecleanflex/assets","x-default":""} */
@Inject
@Default(values ="")
@Default(values = "")
private String videosrc;

/* {"type":"string","x-source":"inject","x-form-label":"Media Alt Text/Title","x-form-visible":"model.showmedia == 'true'","x-form-group":"style","x-form-type":"text"} */
Expand All @@ -549,22 +545,22 @@ public class AccordionModel extends AbstractComponent {

/* {"type":"string","x-source":"inject","x-form-label":"Width","x-form-group":"style","x-form-type":"materialrange","x-form-visible":"model.showmedia == 'true'","x-default":50,"x-form-min":10,"x-form-max":100} */
@Inject
@Default(values ="50")
@Default(values = "50")
private String mediawidth;

/* {"type":"string","x-source":"inject","x-form-label":"Media Position","x-form-type":"materialradio","x-form-group":"style","x-form-visible":"model.showmedia == 'true'","x-default":"before","properties":{"type1":{"x-form-name":"Before Content","x-form-value":"before"},"type2":{"x-form-name":"After Content","x-form-value":"after"}}} */
@Inject
@Default(values ="before")
@Default(values = "before")
private String mediaposition;

/* {"type":"string","x-source":"inject","x-form-label":"Show Card Border","x-form-group":"style","x-form-type":"materialswitch","x-default":"true"} */
@Inject
@Default(values ="true")
@Default(values = "true")
private String cardborder;

/* {"type":"string","x-source":"inject","x-form-label":"Rounded Corners","x-form-group":"style","x-form-type":"materialselect","x-default":"none","properties":{"none":{"x-form-name":"none","x-form-value":"none"},"small":{"x-form-name":"small","x-form-value":"small"},"medium":{"x-form-name":"medium","x-form-value":"medium"},"large":{"x-form-name":"large","x-form-value":"large"},"full":{"x-form-name":"full","x-form-value":"full"}}} */
@Inject
@Default(values ="none")
@Default(values = "none")
private String roundedcorners;

/* {"type":"string","x-source":"inject","x-form-label":"Accordion/Toggle","x-form-group":"content","x-form-type":"collection","properties":{"title":{"type":"string","x-source":"inject","x-form-label":"Title","x-form-type":"text"},"text":{"type":"string","x-source":"inject","x-form-label":"Text","x-form-type":"texteditor"}}} */
Expand All @@ -581,17 +577,17 @@ public class AccordionModel extends AbstractComponent {

/* {"type":"string","x-form-group":"advanced","x-source":"inject","x-form-label":"Semantic Element","x-form-type":"materialselect","x-default":"section","properties":{"section":{"x-form-name":"section","x-form-value":"section"},"article":{"x-form-name":"article","x-form-value":"article"},"main":{"x-form-name":"main","x-form-value":"main"},"div":{"x-form-name":"div","x-form-value":"div"},"header":{"x-form-name":"header","x-form-value":"header"},"nav":{"x-form-name":"nav","x-form-value":"nav"},"footer":{"x-form-name":"footer","x-form-value":"footer"}}} */
@Inject
@Default(values ="section")
@Default(values = "section")
private String htmlelement;

/* {"type":"string","x-source":"inject","x-form-label":"Block Color Scheme","x-form-type":"materialradio","x-form-group":"style","x-default":"","properties":{"none":{"x-form-name":"None","x-form-value":""},"light":{"x-form-name":"Light","x-form-value":"light"},"dark":{"x-form-name":"Dark","x-form-value":"dark"}}} */
@Inject
@Default(values ="")
@Default(values = "")
private String colorscheme;

/* {"type":"string","x-source":"inject","x-form-label":"Custom Background","x-form-group":"style","x-form-type":"materialswitch","x-default":"false"} */
@Inject
@Default(values ="false")
@Default(values = "false")
private String custombackground;

/* {"type":"string","x-source":"inject","x-form-label":"Background Type","x-form-group":"style","x-form-type":"materialradio","x-form-visible":"model.custombackground == 'true'","properties":{"color":{"x-form-name":"Color","x-form-value":"color"},"gradient":{"x-form-name":"Gradient","x-form-value":"gradient"},"image":{"x-form-name":"Image","x-form-value":"image"},"video":{"x-form-name":"Video","x-form-value":"video"}}} */
Expand All @@ -600,7 +596,7 @@ public class AccordionModel extends AbstractComponent {

/* {"type":"string","x-source":"inject","x-form-label":"Background Video","x-form-group":"style","x-form-type":"pathbrowser","x-form-visible":"model.backgroundtype == 'video' and model.custombackground == 'true'","x-default":"https://www.youtube.com/embed/Ju86mknumYM","x-form-browserRoot":"/content/themecleanflex/assets"} */
@Inject
@Default(values ="https://www.youtube.com/embed/Ju86mknumYM")
@Default(values = "https://www.youtube.com/embed/Ju86mknumYM")
private String bgvideo;

/* {"type":"string","x-source":"inject","x-form-label":"Background Image","x-form-type":"pathbrowser","x-form-group":"style","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-form-browserRoot":"/content/themecleanflex/assets"} */
Expand All @@ -609,17 +605,17 @@ public class AccordionModel extends AbstractComponent {

/* {"type":"string","x-source":"inject","x-form-label":"Background X Position","x-form-type":"materialrange","x-form-group":"style","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */
@Inject
@Default(values ="50")
@Default(values = "50")
private String bgxposition;

/* {"type":"string","x-source":"inject","x-form-label":"Background Y Position","x-form-group":"style","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */
@Inject
@Default(values ="50")
@Default(values = "50")
private String bgyposition;

/* {"type":"string","x-source":"inject","x-form-label":"Background Size Style","x-form-type":"text","x-form-group":"style","x-default":"cover"} */
@Inject
@Default(values ="cover")
@Default(values = "cover")
private String bgsize;

/* {"type":"string","x-source":"inject","x-form-label":"Overlay","x-form-type":"materialswitch","x-form-group":"style","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'"} */
Expand All @@ -628,32 +624,32 @@ public class AccordionModel extends AbstractComponent {

/* {"type":"string","x-source":"inject","x-form-label":"Overlay Color","x-form-group":"style","x-form-type":"color","x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"#ffffff"} */
@Inject
@Default(values ="#ffffff")
@Default(values = "#ffffff")
private String overlaycolor;

/* {"type":"string","x-source":"inject","x-form-label":"Overlay opacity","x-form-group":"style","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */
@Inject
@Default(values ="50")
@Default(values = "50")
private String overlayopacity;

/* {"type":"string","x-source":"inject","x-form-label":"Background Color","x-form-group":"style","x-form-type":"color","x-form-visible":"(model.backgroundtype == 'color' or model.backgroundtype == 'gradient') and model.custombackground == 'true'","x-default":"#ffffff"} */
@Inject
@Default(values ="#ffffff")
@Default(values = "#ffffff")
private String bgcolor;

/* {"type":"string","x-source":"inject","x-form-label":"Color 2","x-form-group":"style","x-form-type":"color","x-form-visible":"model.backgroundtype == 'gradient' and model.custombackground == 'true'","x-default":"#c0c0c0"} */
@Inject
@Default(values ="#c0c0c0")
@Default(values = "#c0c0c0")
private String color2;

/* {"type":"string","x-source":"inject","x-form-label":"Block Width","x-form-type":"materialradio","x-form-group":"style","x-default":"default","properties":{"default":{"x-form-name":"Default","x-form-value":"default"},"full":{"x-form-name":"Full Width","x-form-value":"full"},"article":{"x-form-name":"Article Width","x-form-value":"article"}}} */
@Inject
@Default(values ="default")
@Default(values = "default")
private String blockwidth;

/* {"type":"string","x-source":"inject","x-form-label":"Full Height","x-form-type":"materialswitch","x-form-group":"style","x-default":"false"} */
@Inject
@Default(values ="false")
@Default(values = "false")
private String fullheight;

/* {"type":"string","x-source":"inject","x-form-label":"Top Padding","x-form-type":"materialrange","x-form-min":0,"x-form-max":300,"x-form-group":"style","x-form-visible":"model.fullheight != 'true'"} */
Expand All @@ -668,11 +664,10 @@ public class AccordionModel extends AbstractComponent {
@Inject
private String contentname;

//GEN]

//GEN]

//GEN[:GETTERS
/* {"type":"string","x-source":"inject","x-form-label":"Collapse Style","x-form-group":"style","x-form-type":"materialradio","x-default":"accordion","properties":{"toggle":{"x-form-name":"Toggle","x-form-value":"toggle"},"accordion":{"x-form-name":"Accordion","x-form-value":"accordion"}}} */
//GEN[:GETTERS
/* {"type":"string","x-source":"inject","x-form-label":"Collapse Style","x-form-group":"style","x-form-type":"materialradio","x-default":"accordion","properties":{"toggle":{"x-form-name":"Toggle","x-form-value":"toggle"},"accordion":{"x-form-name":"Accordion","x-form-value":"accordion"}}} */
public String getToggletype() {
return toggletype;
}
Expand Down Expand Up @@ -845,11 +840,9 @@ public String getBottompadding() {
public String getContentname() {
return contentname;
}
//GEN]


//GEN]

//GEN[:CUSTOMGETTERS
//GEN]
//GEN[:CUSTOMGETTERS
//GEN]

}
Loading