Skip to content

Commit

Permalink
Modifying test requests
Browse files Browse the repository at this point in the history
  • Loading branch information
1000-x-t30 committed Oct 17, 2024
1 parent 109a567 commit ca9d8d8
Show file tree
Hide file tree
Showing 30 changed files with 316 additions and 320 deletions.
13 changes: 7 additions & 6 deletions css/custom-field-maker.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

.customFieldFunction select {
min-height: 26px;
padding: 4px;
padding: 4px 24px 4px 4px;
line-height: 1.5;
font-size: 14px;
}
Expand Down Expand Up @@ -64,7 +64,7 @@
grid-template-columns: repeat(3, 1fr);
grid-template-areas:
"areaInput areaTitle areaField"
"areaTooltip areaPlaceholder areaPlaceholder";
"areaPlaceholder areaTooltip areaTooltip";
}
.customFieldGeneratorBasic label,
.customFieldGeneratorBasic dt,
Expand Down Expand Up @@ -94,6 +94,8 @@
/* ジェネレーター:バリデーター
-------------------------------------- */
.customFieldValidatorLabel {
background-color: transparent;
border: none;
cursor: pointer;
display: flex;
align-items: center;
Expand All @@ -107,22 +109,21 @@
border-right: 2px solid #333;
border-bottom: 2px solid #333;
transition: transform;
transform: rotateZ(-45deg);
transform: rotateZ(45deg);
transform-origin: center center;
}
.customFieldValidatorToggle.-open {
transform: rotateZ(-315deg);
}

/* アコーディオン
-------------------------------------- */
.customFieldAccordionContent {
overflow: hidden;
visibility: hidden;
transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
opacity: 0;
}

.customFieldAccordionContent.-open {
visibility: visible;
opacity: 1;
}

Expand Down
2 changes: 1 addition & 1 deletion dist/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -20727,7 +20727,7 @@
className: 'acms-admin-icon acms-admin-alert-icon-before acms-admin-icon-attention',
'aria-hidden': 'true',
}),
'typeとタイトルとフィールド、全てを入力しないとソースコードを生成できません。',
'タイプとタイトルとフィールド、全てを入力しないとソースコードを生成できません。',
e.createElement(
'button',
{
Expand Down
8 changes: 7 additions & 1 deletion src/components/cofirmLayouts/GroupTableLayoutConfirm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ export function GroupTableLayoutConfirm() {
)}
>
{fieldgroup.items.map((item, index) => {
if (item.type === 'text') {
if (
item.type === 'text' ||
item.type === 'tel' ||
item.type === 'number' ||
item.type === 'email' ||
item.type === 'password'
) {
return (
<WrapTable key={index} title={item.title}>
<td>{`{${item.name}}`}</td>
Expand Down
22 changes: 15 additions & 7 deletions src/components/cofirmLayouts/TableLayoutConfirm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ export function TableLayoutConfirm() {
if (!item.name) {
return null;
}
if (item.type === 'text') {
if (
item.type === 'text' ||
item.type === 'tel' ||
item.type === 'number' ||
item.type === 'email' ||
item.type === 'password'
) {
return (
<tr key={index}>
<th>{item.title}</th>
Expand Down Expand Up @@ -49,9 +55,10 @@ export function TableLayoutConfirm() {
<th>{item.title}</th>
<td>
{item.option.map(
(option) => `<!-- BEGIN_IF [{${item.name}}/eq/${option.value}] -->
${option.label}
<!-- END_IF -->`
(option) =>
`<!-- BEGIN_IF [{${item.name}}/eq/${option.value}] -->
${option.label}
<!-- END_IF -->`
)}
</td>
</tr>
Expand All @@ -64,9 +71,10 @@ export function TableLayoutConfirm() {
{`<!-- BEGIN ${item.name}:loop -->`}
{`<!-- BEGIN ${item.name}:glue -->,<!-- END ${item.name}:glue -->`}
{item.option.map(
(option) => `<!-- BEGIN_IF [{${item.name}}/eq/${option.value}] -->
${option.label}
<!-- END_IF -->`
(option) =>
`<!-- BEGIN_IF [{${item.name}}/eq/${option.value}] -->
${option.label}
<!-- END_IF -->`
)}
{`<!-- END ${item.name}:loop -->`}
</td>
Expand Down
8 changes: 7 additions & 1 deletion src/components/cofirmLayouts/UnitGroupTableLayoutConfirm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ export function UnitGroupTableLayoutConfirm() {
)}
>
{unitgroup.items.map((item, index) => {
if (item.type === 'text') {
if (
item.type === 'text' ||
item.type === 'tel' ||
item.type === 'number' ||
item.type === 'email' ||
item.type === 'password'
) {
return (
<WrapTable key={index} title={item.title}>
<td>{`{${item.name}}`}</td>
Expand Down
8 changes: 7 additions & 1 deletion src/components/cofirmLayouts/UnitTableLayoutConfirm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ export function UnitTableLayoutConfirm() {
if (!item.name) {
return null;
}
if (item.type === 'text') {
if (
item.type === 'text' ||
item.type === 'tel' ||
item.type === 'number' ||
item.type === 'email' ||
item.type === 'password'
) {
return (
<tr key={index}>
<th>{item.title}</th>
Expand Down
31 changes: 22 additions & 9 deletions src/components/genelator/FieldGroup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,25 @@ export function FieldGroup() {
}, [field, setGroupTitleName]);

const addGroup = useCallback(() => {
const flg = {
unDuplicatedField: false,
unAlert: false,
};
if (field.name === field.groupName) {
setField((prevState) => ({ ...prevState, duplicatedField: true }));
return;
}
if (field.type && field.title && field.name) {
setGroupTitleName(field.groupTitle, field.groupName);
addGroupItem(field);
} else {
setField((prevState) => ({ ...prevState, duplicatedField: false }));
flg.unDuplicatedField = true;
}
if (!field.type || !field.title || !field.name) {
setField((prevState) => ({ ...prevState, alert: true }));
} else {
setField((prevState) => ({ ...prevState, alert: false }));
flg.unAlert = true;
}

if (flg.unDuplicatedField && flg.unAlert) {
addGroupItem(field);
}
}, [field, setGroupTitleName, addGroupItem]);

Check warning on line 138 in src/components/genelator/FieldGroup.jsx

View workflow job for this annotation

GitHub Actions / build (20.x)

React Hook useCallback has an unnecessary dependency: 'setGroupTitleName'. Either exclude it or remove the dependency array

Expand All @@ -142,10 +152,6 @@ export function FieldGroup() {
return (
<div>
<div className="customFieldContainer">
<GroupAlert field={field} setField={setField} />
<DuplicateAlert field={field} setField={setField} />
<Alert field={field} setField={setField} />

<div>
<div className="acms-flex acms-justify-between" style={{ marginBottom: '1em' }}>
<h2
Expand All @@ -161,6 +167,7 @@ export function FieldGroup() {
</button>
)}
</div>
<GroupAlert field={field} setField={setField} />

{fieldgroup.title && fieldgroup.name ? (
<dl className="customFieldGeneratorGroup -openGroup" style={{ margin: 0 }}>
Expand Down Expand Up @@ -289,6 +296,12 @@ export function FieldGroup() {
<div>
<h2 className="customFieldHeading2">コード生成</h2>
<div className="customFieldFunction">
{(field.alert || field.duplicatedField) && (
<div>
<DuplicateAlert field={field} setField={setField} />
<Alert field={field} setField={setField} />
</div>
)}
<Basic field={field} setField={setField} />

{field.type === 'checkbox' && (
Expand Down
12 changes: 7 additions & 5 deletions src/components/genelator/UnitGroup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ export function UnitGroup() {
return;
}
if (field.type && field.title && field.name) {
setUnitGroupTitleName(field.groupName, field.groupTitle);
addUnitGroupItem(field);
} else {
setField((prevState) => ({ ...prevState, alert: true }));
Expand All @@ -142,10 +141,6 @@ export function UnitGroup() {
return (
<div>
<div className="customFieldContainer">
<GroupAlert field={field} setField={setField} />
<DuplicateAlert field={field} setField={setField} />
<Alert field={field} setField={setField} />

<div>
<div className="acms-flex acms-justify-between" style={{ marginBottom: '1em' }}>
<h2
Expand All @@ -161,6 +156,7 @@ export function UnitGroup() {
</button>
)}
</div>
<GroupAlert field={field} setField={setField} />

{unitgroup.title && unitgroup.name ? (
<dl className="customFieldGeneratorGroup -openGroup" style={{ margin: 0 }}>
Expand Down Expand Up @@ -289,6 +285,12 @@ export function UnitGroup() {
<div>
<h2 className="customFieldHeading2">コード生成</h2>
<div className="customFieldFunction">
{(field.alert || field.duplicatedField) && (
<div>
<DuplicateAlert field={field} setField={setField} />
<Alert field={field} setField={setField} />
</div>
)}
<Basic field={field} setField={setField} />

{field.type === 'checkbox' && (
Expand Down
2 changes: 1 addition & 1 deletion src/components/genelator/base/Alert.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function Alert(props) {
{alert ? (
<p className="acms-admin-alert acms-admin-alert-icon acms-admin-alert-danger" style={{ fontSize: '12px' }}>
<span className="acms-admin-icon acms-admin-alert-icon-before acms-admin-icon-attention" aria-hidden="true" />
typeとタイトルとフィールド、全てを入力しないとソースコードを生成できません。
タイプとタイトルとフィールド、全てを入力しないとソースコードを生成できません。
<button className="js-acms-alert-close acms-admin-alert-icon-after" onClick={onRemoveAlert}>
×
</button>
Expand Down
25 changes: 12 additions & 13 deletions src/components/genelator/base/Basic.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,19 @@ export function Basic(props) {
/>
</div>
</div>
{isPlaceholder && (
<div className="customFieldGeneratorBasicPlaceholder">
<label className="">プレースホルダー</label>
<div>
<input
type="text"
value={field.placeholder || ''}
onChange={(e) => handleInputChange(e, 'placeholder')}
className="acms-admin-form-width-full"
placeholder=""
/>
</div>
<div className="customFieldGeneratorBasicPlaceholder">
<label className="">プレースホルダー</label>
<div>
<input
type="text"
value={!isPlaceholder ? '' : field.placeholder || ''}
onChange={(e) => handleInputChange(e, 'placeholder')}
className="acms-admin-form-width-full"
placeholder=""
disabled={!isPlaceholder}
/>
</div>
)}
</div>
<div className="customFieldGeneratorBasicTooltip">
<label className="">ツールチップ</label>
<div>
Expand Down
Loading

0 comments on commit ca9d8d8

Please sign in to comment.