Skip to content

Commit

Permalink
Fix build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
D3VL-Jack committed Jul 15, 2023
1 parent 62bb84c commit 54f9753
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 23 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"react-app",
"react-app/jest"
],
"rules": {
"react-hooks/exhaustive-deps": "off"
},
"env": {
"webextensions": true
},
Expand Down
2 changes: 0 additions & 2 deletions src/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class Store {


class ChromeExtensionStore extends Store {
constructor() { super() }

async load() {
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -96,7 +95,6 @@ class ChromeExtensionStore extends Store {


class WebStore extends Store {
constructor() { super() }

async load() {
return new Promise((resolve) => {
Expand Down
9 changes: 4 additions & 5 deletions src/components/CurrentTimers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ function CurrentTimers() {

const [workItems, setWorkItems] = React.useState([]);
const [timerValues, setTimerValues] = React.useState({});
const timers = {};

// const timers = {};
const loadWorkItems = async () => {
const currentUser = await window.yt.getCurrentUser();

Expand All @@ -20,7 +19,7 @@ function CurrentTimers() {
let startedAt = new Date(parseInt(`1${workItem.yttData.active}0000`));
if (startedAt > new Date()) startedAt = new Date();

timers[workItem.id] = startedAt
// timers[workItem.id] = startedAt
tmpTimerValues[workItem.id] = getReadableTimeSince(startedAt);

return {
Expand Down Expand Up @@ -74,11 +73,11 @@ function CurrentTimers() {
<hr className="my-4 border-gray-200 dark:border-gray-700" />

<div className="flex items-center">
<a href={window.yt.userUrl + '/projects/' + workItem.issue.project.id} target="_blank" className="flex flex-col mr-5">
<a href={window.yt.userUrl + '/projects/' + workItem.issue.project.id} target="_blank" rel="noreferrer" className="flex flex-col mr-5">
<span className="text-sm font-medium text-gray-400">Project</span>
<span className="text-sm text-gray-600 dark:text-white">{workItem.issue.project.name}</span>
</a>
<a href={window.yt.userUrl + '/issue/' + workItem.issue.idReadable} target="_blank" className="flex flex-col mr-5">
<a href={window.yt.userUrl + '/issue/' + workItem.issue.idReadable} target="_blank" rel="noreferrer" className="flex flex-col mr-5">
<span className="text-sm font-medium text-gray-400">Issue</span>
<span className="text-sm text-gray-600 dark:text-white">{workItem.issue.idReadable}</span>
</a>
Expand Down
4 changes: 2 additions & 2 deletions src/components/PreviousTimers.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ function PreviousTimers() {
<div className="flex items-center justify-between align-middle">

<div className="flex items-center">
<a href={window.yt.userUrl + '/projects/' + workItem.issue.project.id} target="_blank" className="flex flex-col mr-5">
<a href={window.yt.userUrl + '/projects/' + workItem.issue.project.id} target="_blank" rel="noreferrer" className="flex flex-col mr-5">
<span className="text-sm font-medium text-gray-400">Project</span>
<span className="text-sm text-gray-600 dark:text-white">{workItem.issue.project.name}</span>
</a>
<a href={window.yt.userUrl + '/issue/' + workItem.issue.idReadable} target="_blank" className="flex flex-col mr-5">
<a href={window.yt.userUrl + '/issue/' + workItem.issue.idReadable} target="_blank" rel="noreferrer" className="flex flex-col mr-5">
<span className="text-sm font-medium text-gray-400">Issue</span>
<span className="text-sm text-gray-600 dark:text-white">{workItem.issue.idReadable}</span>
</a>
Expand Down
10 changes: 5 additions & 5 deletions src/components/TopBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,26 @@ function TopBar() {
<Link onClick={setMenuOpen.bind(null, !menuOpen)} to="/" className="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">Home</Link>
</li>
<li>
<a onClick={setMenuOpen.bind(null, !menuOpen)} href={window.yt.userUrl + `/timesheets?author=me`} target="_blank" className="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">My Timesheet</a>
<a onClick={setMenuOpen.bind(null, !menuOpen)} href={window.yt.userUrl + `/timesheets?author=me`} target="_blank" rel="noreferrer" className="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">My Timesheet</a>
</li>
<li>
<a onClick={setMenuOpen.bind(null, !menuOpen)} href={window.yt.userUrl} target="_blank" className="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">Open YouTrack</a>
<a onClick={setMenuOpen.bind(null, !menuOpen)} href={window.yt.userUrl} target="_blank" rel="noreferrer" className="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">Open YouTrack</a>
</li>
<li>
<Link onClick={setMenuOpen.bind(null, !menuOpen)} to="/configure" className="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">Settings</Link>
</li>
</ul>

<div className="py-1">
<a onClick={() => {
<button onClick={() => {
setMenuOpen.bind(null, !menuOpen);
window.storage.clear();
window.location = window.location.origin + '/index.html'
}} href="#" className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white">Sign out</a>
}} className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white">Sign out</button>
</div>

<div className="py-1">
<a href="https://d3vl.com/" target="_blank" className="font-bod block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white">
<a href="https://d3vl.com/" target="_blank" rel="noreferrer" className="font-bod block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white">
Visit <span style={{ color: '#ff3e3e' }}>D3VL</span>
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import TopBar from './components/TopBar';
</Routes>

<div className="py-1 h-8">
<a href="https://d3vl.com/" target="_blank" className="block px-4 py-2 text-sm text-gray-300 dark:text-gray-200 text-center fixed bottom-0 w-full bg-gray-600 dark:bg-gray-800">
<a href="https://d3vl.com/" target="_blank" rel="noreferrer" className="block px-4 py-2 text-sm text-gray-300 dark:text-gray-200 text-center fixed bottom-0 w-full bg-gray-600 dark:bg-gray-800">
<span className="font-bold" style={{ color: '#ff3e3e' }}>D3VL</span> - Software That Rocks
</a>
</div>
Expand Down
8 changes: 3 additions & 5 deletions src/pages/AddNew/create-timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useParams, useNavigate } from "react-router-dom";

function CreateTimer() {

const { project, issue } = useParams();
const { issue } = useParams();
const navigate = useNavigate();

const [warning, setWarning] = React.useState(null);
Expand Down Expand Up @@ -54,8 +54,6 @@ function CreateTimer() {
}



const [createEnabled, setCreateEnabled] = React.useState(false);
const summaryField = React.useRef(null);

const getStartTime = () => {
Expand Down Expand Up @@ -100,7 +98,7 @@ function CreateTimer() {
const summary = summaryField.current.value;

try {
const newTimer = await window.yt.createTimer(issue, YTTStr, summary);
await window.yt.createTimer(issue, YTTStr, summary);
navigate(`/`);
} catch (e) {
console.log(e);
Expand Down Expand Up @@ -162,7 +160,7 @@ function CreateTimer() {

<div className="mb-6">
<label className="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Notes / Reason</label>
<input ref={summaryField} onChange={(e) => { setCreateEnabled(e.target.value.length > 3) }} type="text" className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" />
<input ref={summaryField} type="text" className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" />
</div>

<button onClick={doCreateTimer} className="p-4 w-full bg-green-600 text-white font-bold py-2 px-4 rounded hover:bg-green-700"> Create </button>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/AddNew/select-project.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function SelectProject() {
{projects.map(project => (
<Link to={"/add-new/" + project.shortName} key={project.id}>
<div className="hover:bg-gray-300 dark:hover:bg-gray-600 w-100 flex justify-between items-center border-gray-200 dark:border-gray-700 cursor-pointer rounded">
<div scope="row" className="flex items-center px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white">
<div className="flex items-center px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white">

<img className="w-12 h-12 rounded" src={window.yt.baseUrl + project.iconUrl} alt="Project Logo" />

Expand Down
2 changes: 0 additions & 2 deletions src/pages/Configure/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import YouTrackAPI from '../../YouTrackAPI';

function Configure() {

const [saveEnabled, setSaveEnabled] = React.useState(false);

const baseUrlRef = React.useRef(null);
const tokenRef = React.useRef(null);
const userUrlRef = React.useRef(null);
Expand Down

0 comments on commit 54f9753

Please sign in to comment.