Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/sergey-dev' into optimizing-gene…
Browse files Browse the repository at this point in the history
…rated-styles
  • Loading branch information
talp-525 committed Oct 25, 2022
2 parents c047c53 + 807b8b0 commit 23df289
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 14 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

## Changelog

### 1.4.1 build 1
### 1.4.2 build 1
* Added the Ability to Copy the URL Path
* Added the Preview Page for Templates

### 1.4.1
* Editing Pages in Pages-List

### 1.4.0
Expand Down
2 changes: 1 addition & 1 deletion altrpnjs/config/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,5 +234,5 @@ export const profiler: ProfilerConfig = {
export const validator: ValidatorConfig = {
}

export const altrp_version:string = '1.4.1'
export const altrp_version:string = '1.4.2'
export const url:string = Env.get('APP_URL')
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,30 @@ class CustomizerSettingsPanel extends React.Component {
let Url = ''

if (this.props.customizer.source) {
let { web_url } = this.props.customizer.source
try{
if(this.state.customizer?.settings?.external){
let {web_url} = this.props.customizer.source
try {
if (this.state.customizer?.settings?.external) {

Url = `${document.location.origin}/api/v1/${this.state.customizer.name}`
} else {
} else {
let strippedDownUrl = new URL(web_url)
Url = document.location.origin
+strippedDownUrl.pathname
+ strippedDownUrl.pathname
}

} catch (e) {
alert('Error while parsing source URL')
console.error(e);
}
}
let relativeUrl = ''
if (this.props.customizer.source) {
let { web_url } = this.props.customizer.source
try{
let strippedDownUrl = new URL(web_url)
relativeUrl = strippedDownUrl.pathname
Url = document.location.origin
+strippedDownUrl.pathname
}catch (e){
alert('Error while parsing source URL')
console.error(e);
Expand Down Expand Up @@ -467,9 +481,12 @@ class CustomizerSettingsPanel extends React.Component {
<div className="controller-container__label control-select__label controller-label">Url:</div>
<div className="Customizer-url__block">
<CopyToClipboard onCopy={this.UrlCopy} text={Url}>
<button className="btn btn_success">Copy url</button>
<button className="btn btn_success">Copy Full URL</button>
</CopyToClipboard>
<CopyToClipboard onCopy={this.UrlCopy} text={relativeUrl}>
<button className="btn btn_success">Copy URL Path</button>
</CopyToClipboard>
<div className={this.state.copy ? "text-copy__url on" : "text-copy__url"}>url copied successfully!</div>
<div className={this.state.copy ? "text-copy__url on" : "text-copy__url"}>url copied!</div>
</div>
<input value={Url} readOnly={true} className="url-text"/>
</div>
Expand Down
4 changes: 3 additions & 1 deletion resources/modules/customizer/src/sass/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,6 @@ textarea.control-field{
display: flex;
align-items: center;
justify-content: center;
width: 100px;
height: 38px;

&:hover {
Expand All @@ -930,6 +929,9 @@ textarea.control-field{
}
}

& .btn_success:not(:last-child) {
margin-right: 12px;
}
}

.url-text {
Expand Down
2 changes: 2 additions & 0 deletions resources/modules/editor/src/js/classes/elements/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ class Button extends BaseElement {

actionsControllers(this);

actionsControllers(this, 'Hover Actions', 'hover_');

//</editor-fold>

this.startControlSection('position_section', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ import {
TAB_STYLE,
CONTROLLER_CHOOSE,
CONTROLLER_SHADOW,
CONTROLLER_REPEATER,
CONTROLLER_MEDIA
} from "../modules/ControllersManager";
import Repeater from "../Repeater";
import { CONDITIONS_OPTIONS } from "../../../../../front-app/src/js/helpers";
import { actionsControllers } from "../../decorators/actions-controllers";

class InputTextCommon extends BaseElement {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,27 @@ class ButtonWidget extends Component {
actionsManager.unregisterWidgetActions(this.props.element.getId());
}

onMouseEnter = async (e) => {
e.persist();
if (isEditor()) {
e.preventDefault();
} else if (this.props.element.getResponsiveLockedSetting("hover_actions", null, []).length) {
e.preventDefault();
e.stopPropagation();
const actionsManager = (
await import(/* webpackChunkName: 'ActionsManager' */
"../../../../../front-app/src/js/classes/modules/ActionsManager.js"
)
).default;
await actionsManager.callAllWidgetActions(
this.props.element.getIdForAction(),
'click',
this.props.element.getLockedSettings("hover_actions", []),
this.props.element
);
}
}

/**
* Клик по кнопке
* @param e
Expand Down Expand Up @@ -582,6 +603,7 @@ class ButtonWidget extends Component {

let button = <button
onClick={this.onClick}
onMouseEnter={this.onMouseEnter}
className={classes}
id={this.element.getLockedSettings('position_css_id')}
title={tooltip || null}
Expand All @@ -602,6 +624,7 @@ class ButtonWidget extends Component {
<a
href={url}
onClick={this.onClick}
onMouseEnter={this.onMouseEnter}
className={classes}
target={target}
title={tooltip || null}
Expand All @@ -612,7 +635,7 @@ class ButtonWidget extends Component {
);
} else {
link = (
<Link to={url} href={url} onClick={this.onClick} target={target} className={classes} title={tooltip || null}>
<Link to={url} href={url} onClick={this.onClick} onMouseEnter={this.onMouseEnter} target={target} className={classes} title={tooltip || null}>
{" "}
{buttonInner}
</Link>
Expand Down
2 changes: 1 addition & 1 deletion webpack.editor.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module.exports = {
},

{
test: /(\.(woff|woff2|eot|ttf|otf)|slick.svg|spritesheet.svg)$/,
test: /(\.(woff|woff2|eot|ttf|otf)|slick.svg|spritesheet.svg|jsoneditor-icons.svg)$/,
use: ["file-loader"]
}
]
Expand Down

0 comments on commit 23df289

Please sign in to comment.