Browse Source

remove unused file

pull/1/head
farhantock 11 months ago
parent
commit
8fd8da71e9
  1. 33
      src/views/Pages/Page403/Page403.js
  2. 9
      src/views/Pages/Page403/Page403.test.js
  3. 6
      src/views/Pages/Page403/package.json
  4. 35
      src/views/Pages/Page404/Page404.js
  5. 9
      src/views/Pages/Page404/Page404.test.js
  6. 6
      src/views/Pages/Page404/package.json
  7. 35
      src/views/Pages/Page500/Page500.js
  8. 9
      src/views/Pages/Page500/Page500.test.js
  9. 6
      src/views/Pages/Page500/package.json
  10. 68
      src/views/Pages/Register/Register.js
  11. 9
      src/views/Pages/Register/Register.test.js
  12. 6
      src/views/Pages/Register/package.json
  13. 46
      src/views/Users/User.js
  14. 15
      src/views/Users/User.test.js
  15. 78
      src/views/Users/Users.js
  16. 10
      src/views/Users/Users.test.js
  17. 31
      src/views/Users/UsersData.js
  18. 6
      src/views/Users/package.json

33
src/views/Pages/Page403/Page403.js

@ -1,33 +0,0 @@
import React, { Component } from 'react';
import { Button, Col, Container, Input, InputGroup, InputGroupAddon, InputGroupText, Row } from 'reactstrap';
class Page403 extends Component {
logOut = () => {
window.localStorage.clear();
this.props.history.push('/login')
}
render() {
return (
<div className="app flex-row align-items-center">
<Container>
<Row className="justify-content-center">
<Col md="6">
<div className="clearfix">
<h1 className="float-left display-3 mr-4">403</h1>
<h4 className="pt-3">Oops! <br></br>Kamu pergi ke halaman yang terlarang!</h4>
<p className="text-muted float-left">Halaman tidak bisa di akses!</p>
</div>
<div style={{alignItems:'center'}}>
<Button size="sm" color="warning" onClick={() => this.logOut()}>Back To Login</Button>
</div>
</Col>
</Row>
</Container>
</div>
);
}
}
export default Page403;

9
src/views/Pages/Page403/Page403.test.js

@ -1,9 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom';
import Page404 from './Page403';
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<Page403 />, div);
ReactDOM.unmountComponentAtNode(div);
});

6
src/views/Pages/Page403/package.json

@ -1,6 +0,0 @@
{
"name": "Page403",
"version": "0.0.0",
"private": true,
"main": "./Page403.js"
}

35
src/views/Pages/Page404/Page404.js

@ -1,35 +0,0 @@
import React, { Component } from 'react';
import { Button, Col, Container, Input, InputGroup, InputGroupAddon, InputGroupText, Row } from 'reactstrap';
class Page404 extends Component {
render() {
return (
<div className="app flex-row align-items-center">
<Container>
<Row className="justify-content-center">
<Col md="6">
<div className="clearfix">
<h1 className="float-left display-3 mr-4">404</h1>
<h4 className="pt-3">Oops! You're lost.</h4>
<p className="text-muted float-left">The page you are looking for was not found.</p>
</div>
<InputGroup className="input-prepend">
<InputGroupAddon addonType="prepend">
<InputGroupText>
<i className="fa fa-search"></i>
</InputGroupText>
</InputGroupAddon>
<Input size="16" type="text" placeholder="What are you looking for?" />
<InputGroupAddon addonType="append">
<Button color="info">Search</Button>
</InputGroupAddon>
</InputGroup>
</Col>
</Row>
</Container>
</div>
);
}
}
export default Page404;

9
src/views/Pages/Page404/Page404.test.js

@ -1,9 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom';
import Page404 from './Page404';
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<Page404 />, div);
ReactDOM.unmountComponentAtNode(div);
});

6
src/views/Pages/Page404/package.json

@ -1,6 +0,0 @@
{
"name": "Page404",
"version": "0.0.0",
"private": true,
"main": "./Page404.js"
}

35
src/views/Pages/Page500/Page500.js

@ -1,35 +0,0 @@
import React, { Component } from 'react';
import { Button, Col, Container, Input, InputGroup, InputGroupAddon, InputGroupText, Row } from 'reactstrap';
class Page500 extends Component {
render() {
return (
<div className="app flex-row align-items-center">
<Container>
<Row className="justify-content-center">
<Col md="6">
<span className="clearfix">
<h1 className="float-left display-3 mr-4">500</h1>
<h4 className="pt-3">Houston, we have a problem!</h4>
<p className="text-muted float-left">The page you are looking for is temporarily unavailable.</p>
</span>
<InputGroup className="input-prepend">
<InputGroupAddon addonType="prepend">
<InputGroupText>
<i className="fa fa-search"></i>
</InputGroupText>
</InputGroupAddon>
<Input size="16" type="text" placeholder="What are you looking for?" />
<InputGroupAddon addonType="append">
<Button color="info">Search</Button>
</InputGroupAddon>
</InputGroup>
</Col>
</Row>
</Container>
</div>
);
}
}
export default Page500;

9
src/views/Pages/Page500/Page500.test.js

@ -1,9 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom';
import Page500 from './Page500';
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<Page500 />, div);
ReactDOM.unmountComponentAtNode(div);
});

6
src/views/Pages/Page500/package.json

@ -1,6 +0,0 @@
{
"name": "Page500",
"version": "0.0.0",
"private": true,
"main": "./Page500.js"
}

68
src/views/Pages/Register/Register.js

@ -1,68 +0,0 @@
import React, { Component } from 'react';
import { Button, Card, CardBody, CardFooter, Col, Container, Form, Input, InputGroup, InputGroupAddon, InputGroupText, Row } from 'reactstrap';
class Register extends Component {
render() {
return (
<div className="app flex-row align-items-center">
<Container>
<Row className="justify-content-center">
<Col md="9" lg="7" xl="6">
<Card className="mx-4">
<CardBody className="p-4">
<Form>
<h1>Register</h1>
<p className="text-muted">Create your account</p>
<InputGroup className="mb-3">
<InputGroupAddon addonType="prepend">
<InputGroupText>
<i className="icon-user"></i>
</InputGroupText>
</InputGroupAddon>
<Input type="text" placeholder="Username" autoComplete="username" />
</InputGroup>
<InputGroup className="mb-3">
<InputGroupAddon addonType="prepend">
<InputGroupText>@</InputGroupText>
</InputGroupAddon>
<Input type="text" placeholder="Email" autoComplete="email" />
</InputGroup>
<InputGroup className="mb-3">
<InputGroupAddon addonType="prepend">
<InputGroupText>
<i className="icon-lock"></i>
</InputGroupText>
</InputGroupAddon>
<Input type="password" placeholder="Password" autoComplete="new-password" />
</InputGroup>
<InputGroup className="mb-4">
<InputGroupAddon addonType="prepend">
<InputGroupText>
<i className="icon-lock"></i>
</InputGroupText>
</InputGroupAddon>
<Input type="password" placeholder="Repeat password" autoComplete="new-password" />
</InputGroup>
<Button color="success" block>Create Account</Button>
</Form>
</CardBody>
<CardFooter className="p-4">
<Row>
<Col xs="12" sm="6">
<Button className="btn-facebook mb-1" block><span>facebook</span></Button>
</Col>
<Col xs="12" sm="6">
<Button className="btn-twitter mb-1" block><span>twitter</span></Button>
</Col>
</Row>
</CardFooter>
</Card>
</Col>
</Row>
</Container>
</div>
);
}
}
export default Register;

9
src/views/Pages/Register/Register.test.js

@ -1,9 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom';
import Register from './Register';
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<Register />, div);
ReactDOM.unmountComponentAtNode(div);
});

6
src/views/Pages/Register/package.json

@ -1,6 +0,0 @@
{
"name": "Register",
"version": "0.0.0",
"private": true,
"main": "./Register.js"
}

46
src/views/Users/User.js

@ -1,46 +0,0 @@
import React, { Component } from 'react';
import { Card, CardBody, CardHeader, Col, Row, Table } from 'reactstrap';
import usersData from './UsersData'
class User extends Component {
render() {
const user = usersData.find(user => user.id.toString() === this.props.match.params.id)
const userDetails = user ? Object.entries(user) : [['id', (<span><i className="text-muted icon-ban"></i> Not found</span>)]]
return (
<div className="animated fadeIn">
<Row>
<Col lg={6}>
<Card>
<CardHeader>
<strong><i className="icon-info pr-1"></i>User id: {this.props.match.params.id}</strong>
</CardHeader>
<CardBody>
<Table responsive striped hover>
<tbody>
{
userDetails.map(([key, value]) => {
return (
<tr key={key}>
<td>{`${key}:`}</td>
<td><strong>{value}</strong></td>
</tr>
)
})
}
</tbody>
</Table>
</CardBody>
</Card>
</Col>
</Row>
</div>
)
}
}
export default User;

15
src/views/Users/User.test.js

@ -1,15 +0,0 @@
import React from 'react';
import {MemoryRouter} from 'react-router-dom';
import { mount } from 'enzyme'
import User from './User';
it('renders without crashing', () => {
const wrapper = mount(
<MemoryRouter>
<User match={{params: {id: "1"}, isExact: true, path: "/users/:id", name: "User details"}}/>
</MemoryRouter>
);
expect(wrapper.containsMatchingElement(<strong>Samppa Nori</strong>)).toEqual(true)
wrapper.unmount()
});

78
src/views/Users/Users.js

@ -1,78 +0,0 @@
import React, { Component } from 'react'
import DataTable from '../../components/DataTableEditDialog'
import { API_LIST_DATA_USERS, API_INSERT_DATA_USERS, API_UPDATE_DATA_USERS, API_DELETE_DATA_USERS } from '../../const/ApiConst'
const columns = [{
dataField: 'id',
alias: "Id",
showInput: false,
type: "number",
state: 0
}, {
dataField: 'fullname',
alias: "Fullname",
showInput: true,
type: "text",
state: ""
}, {
dataField: 'username',
alias: "Username",
showInput: true,
type: "text",
state: ""
}, {
dataField: 'password',
alias: "Password",
showInput: true,
type: "password",
state: ""
}, {
dataField: 'created_time',
alias: "Created Time",
showInput: false,
type: "text",
state: ""
}, {
dataField: 'modified_time',
alias: "Modified Time",
showInput: false,
type: "text",
state: ""
}, {
dataField: 'created_by',
alias: "Created By",
showInput: false,
type: "text",
state: "admin"
}];
class Users extends Component {
constructor(props) {
super(props)
this.state = {
columns: null,
dataTable: []
}
}
componentDidMount() {
}
render() {
let dataTable = this.state.dataTable
return (
<div>
<DataTable
title="User"
columns={columns}
urlParamGet={API_LIST_DATA_USERS}
urlParamInsert={API_INSERT_DATA_USERS}
urlParamUpdate={API_UPDATE_DATA_USERS}
urlParamDelete={API_DELETE_DATA_USERS}
/>
</div>
)
}
}
export default Users;

10
src/views/Users/Users.test.js

@ -1,10 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { MemoryRouter } from 'react-router-dom';
import Users from './Users';
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<MemoryRouter><Users /></MemoryRouter>, div);
ReactDOM.unmountComponentAtNode(div);
});

31
src/views/Users/UsersData.js

@ -1,31 +0,0 @@
const usersData = [
{id: 0, name: 'John Doe', registered: '2018/01/01', role: 'Guest', status: 'Pending'},
{id: 1, name: 'Samppa Nori', registered: '2018/01/01', role: 'Member', status: 'Active'},
{id: 2, name: 'Estavan Lykos', registered: '2018/02/01', role: 'Staff', status: 'Banned'},
{id: 3, name: 'Chetan Mohamed', registered: '2018/02/01', role: 'Admin', status: 'Inactive'},
{id: 4, name: 'Derick Maximinus', registered: '2018/03/01', role: 'Member', status: 'Pending'},
{id: 5, name: 'Friderik Dávid', registered: '2018/01/21', role: 'Staff', status: 'Active'},
{id: 6, name: 'Yiorgos Avraamu', registered: '2018/01/01', role: 'Member', status: 'Active'},
{id: 7, name: 'Avram Tarasios', registered: '2018/02/01', role: 'Staff', status: 'Banned'},
{id: 8, name: 'Quintin Ed', registered: '2018/02/01', role: 'Admin', status: 'Inactive'},
{id: 9, name: 'Enéas Kwadwo', registered: '2018/03/01', role: 'Member', status: 'Pending'},
{id: 10, name: 'Agapetus Tadeáš', registered: '2018/01/21', role: 'Staff', status: 'Active'},
{id: 11, name: 'Carwyn Fachtna', registered: '2018/01/01', role: 'Member', status: 'Active'},
{id: 12, name: 'Nehemiah Tatius', registered: '2018/02/01', role: 'Staff', status: 'Banned'},
{id: 13, name: 'Ebbe Gemariah', registered: '2018/02/01', role: 'Admin', status: 'Inactive'},
{id: 14, name: 'Eustorgios Amulius', registered: '2018/03/01', role: 'Member', status: 'Pending'},
{id: 15, name: 'Leopold Gáspár', registered: '2018/01/21', role: 'Staff', status: 'Active'},
{id: 16, name: 'Pompeius René', registered: '2018/01/01', role: 'Member', status: 'Active'},
{id: 17, name: 'Paĉjo Jadon', registered: '2018/02/01', role: 'Staff', status: 'Banned'},
{id: 18, name: 'Micheal Mercurius', registered: '2018/02/01', role: 'Admin', status: 'Inactive'},
{id: 19, name: 'Ganesha Dubhghall', registered: '2018/03/01', role: 'Member', status: 'Pending'},
{id: 20, name: 'Hiroto Šimun', registered: '2018/01/21', role: 'Staff', status: 'Active'},
{id: 21, name: 'Vishnu Serghei', registered: '2018/01/01', role: 'Member', status: 'Active'},
{id: 22, name: 'Zbyněk Phoibos', registered: '2018/02/01', role: 'Staff', status: 'Banned'},
{id: 23, name: 'Einar Randall', registered: '2018/02/01', role: 'Admin', status: 'Inactive'},
{id: 24, name: 'Félix Troels', registered: '2018/03/21', role: 'Staff', status: 'Active'},
{id: 25, name: 'Aulus Agmundr', registered: '2018/01/01', role: 'Member', status: 'Pending'},
{id: 42, name: 'Ford Prefex', registered: '2001/05/21', role: 'Alien', status: 'Don\'t panic!'}
]
export default usersData

6
src/views/Users/package.json

@ -1,6 +0,0 @@
{
"name": "Users",
"version": "0.0.0",
"private": true,
"main": "./Users.js"
}
Loading…
Cancel
Save