Skip to content

Commit

Permalink
[Add] Added hidden and is_group checkbox. #102
Browse files Browse the repository at this point in the history
  • Loading branch information
yoneyan committed May 13, 2022
1 parent 0b5cb7d commit b5a60e8
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 3 deletions.
102 changes: 101 additions & 1 deletion src/components/Dashboard/JPNIC/JPNIC.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
import {Button, Dialog, DialogActions, DialogContent, DialogTitle, Grid, TextField} from "@mui/material";
import {
Button,
Checkbox,
Dialog,
DialogActions,
DialogContent,
DialogTitle,
FormControlLabel,
Grid,
TextField
} from "@mui/material";
import React, {Dispatch, SetStateAction, useEffect, useState} from "react";
import {DefaultServiceJPNICData, JPNICData} from "../../../interface";
import {useSnackbar} from "notistack";
Expand Down Expand Up @@ -103,6 +113,27 @@ export function JPNICDetail(props: {
return (
<StyledDivRoot2>
<StyledRootForm noValidate autoComplete="off">
<FormControlLabel
value="グループハンドル"
control={<Checkbox />}
label="グループハンドル"
labelPlacement="end"
checked={jpnicCopy.is_group}
onChange={event => {
setJPNICCopy({...jpnicCopy, hidden: !jpnicCopy.is_group});
}}
/>
<FormControlLabel
value="非公開"
control={<Checkbox />}
label="非公開"
labelPlacement="end"
checked={jpnicCopy.hidden}
onChange={event => {
setJPNICCopy({...jpnicCopy, hidden: !jpnicCopy.hidden});
}}
/>
<br/>
<StyledTextFieldVeryShort1
required
id="tech_v4_jpnic_handle"
Expand Down Expand Up @@ -252,6 +283,33 @@ export function JPNICDetail(props: {
}}
/>
<br/>
<StyledTextFieldVeryShort1
required
id="outlined-required"
label="Title"
InputProps={{
readOnly: lockInfo,
}}
value={jpnicCopy.title}
variant="outlined"
onChange={event => {
setJPNICCopy({...jpnicCopy, title: event.target.value});
}}
/>
<StyledTextFieldVeryShort1
required
id="outlined-required"
label="Title(English)"
InputProps={{
readOnly: lockInfo,
}}
value={jpnicCopy.title_en}
variant="outlined"
onChange={event => {
setJPNICCopy({...jpnicCopy, title_en: event.target.value});
}}
/>
<br/>
<StyledTextFieldVeryShort1
required
id="outlined-required"
Expand Down Expand Up @@ -375,6 +433,27 @@ export function JPNICTechAdd(props: {
</DialogTitle>
<DialogContent dividers>
<StyledRootForm noValidate autoComplete="off">
<FormControlLabel
value="グループハンドル"
control={<Checkbox />}
label="グループハンドル"
labelPlacement="end"
checked={jpnic.is_group}
onChange={event => {
setJPNIC({...jpnic, is_group: !jpnic.is_group});
}}
/>
<FormControlLabel
value="非公開"
control={<Checkbox />}
label="非公開"
labelPlacement="end"
checked={jpnic.hidden}
onChange={event => {
setJPNIC({...jpnic, hidden: !jpnic.hidden});
}}
/>
<br/>
<StyledTextFieldVeryShort1
required
id="v4_jpnic_jandle"
Expand Down Expand Up @@ -489,6 +568,27 @@ export function JPNICTechAdd(props: {
}}
/>
<br/>
<StyledTextFieldVeryShort1
required
id="outlined-required"
label="Title"
value={jpnic.title}
variant="outlined"
onChange={event => {
setJPNIC({...jpnic, title: event.target.value});
}}
/>
<StyledTextFieldVeryShort1
required
id="outlined-required"
label="Title(English)"
value={jpnic.title_en}
variant="outlined"
onChange={event => {
setJPNIC({...jpnic, title_en: event.target.value});
}}
/>
<br/>
<StyledTextFieldVeryShort1
required
id="outlined-required"
Expand Down
20 changes: 18 additions & 2 deletions src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,15 @@ export interface JPNICData {
CreatedAt: string,
UpdatedAt: string,
DeletedAt: string,
is_group: boolean,
hidden: boolean,
address: string,
address_en: string,
country: string,
dept: string,
dept_en: string,
title: string,
title_en: string,
fax: string,
v4_jpnic_handle: string,
v6_jpnic_handle: string,
Expand Down Expand Up @@ -456,6 +460,8 @@ export interface ServiceAddData {
}

export interface ServiceAddJPNICData {
is_group: boolean,
hidden: boolean,
org: string,
org_en: string,
mail: string,
Expand All @@ -464,8 +470,10 @@ export interface ServiceAddJPNICData {
address_en: string,
name: string,
name_en: string,
dept_en: string,
dept: string,
dept_en: string,
title: string,
title_en: string,
country: string,
tel: string,
fax: string,
Expand Down Expand Up @@ -720,11 +728,15 @@ export const DefaultServiceJPNICData: JPNICData = {
CreatedAt: "",
UpdatedAt: "",
DeletedAt: "",
is_group: false,
hidden: false,
address: "",
address_en: "",
country: "",
dept: "",
dept_en: "",
title: "",
title_en: "",
fax: "",
v4_jpnic_handle: "",
v6_jpnic_handle: "",
Expand All @@ -739,6 +751,8 @@ export const DefaultServiceJPNICData: JPNICData = {
}

export const DefaultServiceAddJPNICData: ServiceAddJPNICData = {
is_group: false,
hidden: false,
org: "",
org_en: "",
mail: "",
Expand All @@ -747,8 +761,10 @@ export const DefaultServiceAddJPNICData: ServiceAddJPNICData = {
address_en: "",
name: "",
name_en: "",
dept_en: "",
dept: "",
dept_en: "",
title: "",
title_en: "",
country: "",
tel: "",
fax: "",
Expand Down

0 comments on commit b5a60e8

Please sign in to comment.