Skip to content

Commit

Permalink
datefields bug, folder in media library fix
Browse files Browse the repository at this point in the history
  • Loading branch information
reinvanoyen committed Oct 24, 2024
1 parent fd8ac64 commit b7dca1c
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 31 deletions.
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"/js/app.js": "/js/app.js?id=cca782392d5c21be6a3420881af9c366",
"/js/app.js": "/js/app.js?id=421f94c4e76ff90ad8b56d037c27e657",
"/js/manifest.js": "/js/manifest.js?id=22bb55ce20c9c883a45b5c11d8eca703",
"/js/vendor.js": "/js/vendor.js?id=a21c2dcb4fdd557ce1ec6c040ad40be4",
"/css/app.css": "/css/app.css?id=d75c395a1c5c29d8b4c39d09727b550c"
Expand Down
22 changes: 12 additions & 10 deletions resources/js/core/ui/directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@ function Directory(props) {
}

return (
<div className={'directory directory--'+viewMode} onClick={e => props.onClick(e, props.directory)}>
<div className="directory__icon">
<Icon name={'folder'} style={[iconStyle, 'alt']} />
</div>
<div className="directory__content">
<div className="directory__name">
{props.directory.name}
<>
<div className={'directory directory--'+viewMode} onClick={e => props.onClick(e, props.directory)}>
<div className="directory__icon">
<Icon name={'folder'} style={[iconStyle, 'alt']} />
</div>
<div className="directory__type">
{i18n.get('snippets.directory')}
<div className="directory__content">
<div className="directory__name">
{props.directory.name}
</div>
<div className="directory__type">
{i18n.get('snippets.directory')}
</div>
</div>
</div>
</div>
</>
);
}

Expand Down
18 changes: 2 additions & 16 deletions resources/js/core/ui/icon.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
import React, {useEffect, useState} from 'react';
import React from 'react';
import helpers from "../../util/helpers";
import useOnMount from "../../hooks/use-on-mount";

function Icon(props) {

const [state, setState] = useState({
style: props.style
});

const onClick = e => {
e.stopPropagation();
props.onClick();
};

useOnMount(() => {
if (props.onClick) {
setState({
...state,
style: [...state.style, 'icon--clickable']
});
}
});

return (
<span className={helpers.className('icon', state.style)} onClick={props.onClick ? onClick : null}>
<span className={helpers.className('icon', props.style)} onClick={props.onClick ? onClick : null}>
{props.name}
</span>
);
Expand Down
2 changes: 1 addition & 1 deletion src/Cmf.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(ModuleRegistry $modules)
*/
public function getVersion(): string
{
return '0.3.3';
return '0.3.4';
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/Components/DateField.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public function provision(ModelResource $model, array &$attributes)
*/
public function save(Model $model, Request $request)
{
$model->{$this->getName()} = $request->input($this->getName());
if ($request->input($this->getName())) {
$model->{$this->getName()} = $request->input($this->getName());
}
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/Components/DateTimeField.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public function provision(ModelResource $model, array &$attributes)
*/
public function save(Model $model, Request $request)
{
$model->{$this->getName()} = $request->input($this->getName());
if ($request->input($this->getName())) {
$model->{$this->getName()} = $request->input($this->getName());
}
}

/**
Expand Down

0 comments on commit b7dca1c

Please sign in to comment.