fix some HTML ui warnings;

cleanup
This commit is contained in:
Dobromir Popov
2024-04-07 01:47:09 +03:00
parent 807bb35973
commit 3f7255bf96
3 changed files with 22 additions and 23 deletions

View File

@ -179,11 +179,11 @@ export default function PublisherForm({ item, me }) {
onSubmit={handleSubmit}>
<div className="mb-4">
<label className="label" htmlFor="firstName">Име</label>
<input type="text" name="firstName" value={publisher.firstName} onChange={handleChange} className="textbox" placeholder="First Name" autoFocus />
<input type="text" id="firstName" name="firstName" value={publisher.firstName} onChange={handleChange} className="textbox" placeholder="First Name" autoFocus />
</div>
<div className="mb-4">
<label className="label" htmlFor="lastName">Фамилия</label>
<input type="text" name="lastName" value={publisher.lastName} onChange={handleChange} className="textbox" placeholder="Last Name" autoFocus />
<input type="text" id="lastName" name="lastName" value={publisher.lastName} onChange={handleChange} className="textbox" placeholder="Last Name" autoFocus />
<ProtectedRoute allowedRoles={[UserRole.ADMIN]} deniedMessage=" ">
<div className="border border-blue-500 border-solid p-2">
@ -198,21 +198,21 @@ export default function PublisherForm({ item, me }) {
{/* //desiredShiftsPerMonth */}
<div className="mb-4">
<label className="label" htmlFor="desiredShiftsPerMonth">Желани смeни на месец</label>
<input type="number" name="desiredShiftsPerMonth" value={publisher.desiredShiftsPerMonth} onChange={handleChange} className="textbox" placeholder="desiredShiftsPerMonth" autoFocus />
<input type="number" id="desiredShiftsPerMonth" name="desiredShiftsPerMonth" value={publisher.desiredShiftsPerMonth} onChange={handleChange} className="textbox" placeholder="desiredShiftsPerMonth" autoFocus />
</div>
<div className="mb-4">
<label className="label" htmlFor="email">Имейл</label>
<input type="text" name="email" value={publisher.email} onChange={handleChange} className="textbox" placeholder="Email" autoFocus />
<input type="text" id="email" name="email" value={publisher.email} onChange={handleChange} className="textbox" placeholder="Email" autoFocus />
</div>
<div className="mb-4">
<label className="label" htmlFor="phone">Телефон</label>
<input type="text" name="phone" value={publisher.phone} onChange={handleChange} className="textbox" placeholder="Phone" autoFocus />
<input type="text" id="phone" name="phone" value={publisher.phone} onChange={handleChange} className="textbox" placeholder="Phone" autoFocus />
</div>
<div className="mb-4">
<label className="label" htmlFor="parentPublisher">
<label className="label" htmlFor="familyHeadId">
Семейство (избери главата на семейството)
</label>
<PublisherSearchBox selectedId={publisher.familyHeadId} onChange={handleParentSelection} />
<PublisherSearchBox id="familyHeadId" selectedId={publisher.familyHeadId} onChange={handleParentSelection} />
</div>
<div className="mb-4">
<div className="flex items-center space-x-4">
@ -238,7 +238,7 @@ export default function PublisherForm({ item, me }) {
</div>
<div className="mb-4">
<label className="label" htmlFor="town">Град</label>
<input type="text" name="town" value={publisher.town} onChange={handleChange} className="textbox" placeholder="Град" autoFocus />
<input type="text" id="town" name="town" value={publisher.town} onChange={handleChange} className="textbox" placeholder="Град" autoFocus />
</div>
<div className="mb-4">
<div className="form-check">
@ -254,7 +254,7 @@ export default function PublisherForm({ item, me }) {
<div className="border border-blue-500 border-solid p-2">
<div className="mb-4">
<label className="label" htmlFor="type">Тип</label>
<select name="type" value={publisher.type} onChange={handleChange} className="textbox" placeholder="Type" autoFocus >
<select id="type" name="type" value={publisher.type} onChange={handleChange} className="textbox" placeholder="Type" autoFocus >
<option value="Publisher">Вестител</option>
<option value="Bethelite">Бетелит</option>
<option value="RegularPioneer">Редовен Пионер</option>
@ -265,11 +265,11 @@ export default function PublisherForm({ item, me }) {
</div>
<div className="mb-4">
<label className="label" htmlFor="comments">Коментари</label>
<input type="text" name="comments" value={publisher.comments} onChange={handleChange} className="textbox" placeholder="Коментари" autoFocus />
<input type="text" id="comments" name="comments" value={publisher.comments} onChange={handleChange} className="textbox" placeholder="Коментари" autoFocus />
</div>
<div className="mb-4">
<label className="label" htmlFor="age">Възраст</label>
<input type="number" name="age" value={publisher.age} onChange={handleChange} className="textbox" placeholder="Age" autoFocus />
<input type="number" id="age" name="age" value={publisher.age} onChange={handleChange} className="textbox" placeholder="Age" autoFocus />
</div>
<div className="mb-4">
<div className="form-check">

View File

@ -3,7 +3,7 @@ import axiosInstance from '../../src/axiosSecure';
import common from '../../src/helpers/common';
//import { is } from 'date-fns/locale';
function PublisherSearchBox({ selectedId, onChange, isFocused, filterDate, showSearch = true, showList = false, showAllAuto = false, infoText = " Семеен глава" }) {
function PublisherSearchBox({ id, selectedId, onChange, isFocused, filterDate, showSearch = true, showList = false, showAllAuto = false, infoText = " Семеен глава" }) {
const [selectedItem, setSelectedItem] = useState(null);
const [searchText, setSearchText] = useState('');
@ -95,6 +95,7 @@ function PublisherSearchBox({ selectedId, onChange, isFocused, filterDate, showS
{showSearch ? (
<>
<input ref={inputRef}
{...(id ? { id } : {})}
type="text"
value={searchText}
onChange={(e) => setSearchText(e.target.value)}

View File

@ -18,7 +18,7 @@ import('get-port').then(module => {
process.env.TZ = 'Europe/Sofia';
// Global variable to store the base URL
let baseUrlGlobal;
// let baseUrlGlobal;
console.log("initial process.env.APP_ENV = ", process.env.APP_ENV);
console.log("initial process.env.NODE_ENV = ", process.env.NODE_ENV); //NODE_ENV can be passed as docker param
@ -93,14 +93,14 @@ nextApp
server.use((req, res, next) => {
req.headers['x-forwarded-host'] = req.headers['x-forwarded-host'] || req.headers.host;
// ---------------
if (!baseUrlGlobal) {
const protocol = req.headers['x-forwarded-proto'] || 'http';
const host = req.headers.host;
const baseUrl = `${protocol}://${host}`;
baseUrlGlobal = baseUrl;
fs.writeFileSync(path.join(__dirname, 'baseUrl.txt'), baseUrlGlobal, 'utf8');
console.log("baseUrlGlobal set to: " + baseUrlGlobal);
}
// if (!baseUrlGlobal) {
// const protocol = req.headers['x-forwarded-proto'] || 'http';
// const host = req.headers.host;
// const baseUrl = `${protocol}://${host}`;
// baseUrlGlobal = baseUrl;
// fs.writeFileSync(path.join(__dirname, 'baseUrl.txt'), baseUrlGlobal, 'utf8');
// console.log("baseUrlGlobal set to: " + baseUrlGlobal);
// }
next();
});
server.use("/favicon.ico", express.static("styles/favicon_io/favicon.ico"));
@ -656,8 +656,6 @@ async function Stat() {
}
Stat();
exports.baseUrlGlobal = baseUrlGlobal;
exports.default = nextApp;