-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UT-206: Adding soft-delete of thumbnails #78
Changes from all commits
c2885d0
7480933
e1639d7
f9803a6
2e97520
c833dac
d504673
1f2d4af
fbd71e1
593697e
3561e5f
2468297
fcb0c33
7a09156
779b3db
0bcd958
e4023d8
6bf1df1
06597e0
5a0a950
f49cc6e
5791d9e
f78ebae
84a7201
0db0cf6
55db8a8
3fdbe6f
f425a33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,3 +56,4 @@ ehthumbs.db | |
# Windows shortcuts # | ||
##################### | ||
*.lnk | ||
/storage/hiddenFiles.json | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react' | ||
import '../../css/Footer.css' | ||
|
||
|
||
|
||
interface FooterProps { | ||
children: React.ReactNode | ||
} | ||
|
||
export function Footer({ children }: FooterProps): JSX.Element { | ||
return ( | ||
<footer className='Footer'> | ||
{ children } | ||
</footer> | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from "react" | ||
import { OperationMode } from "../../../model/reducers/mediaReducer" | ||
import { reduxState } from "../../../model/reducers/store" | ||
import * as IO from '../../../model/SocketIoConstants' | ||
import { socket } from '../../util/SocketClientHandlers' | ||
import { Footer } from "./Footer" | ||
import "../../css/Operation-mode-edit-visibility-footer.css" | ||
|
||
const BUTTON_TEXT = 'Exit Edit Visibility' | ||
const DESCRIPTION_TEXT = 'You are currently editing the visibility of files.'.toUpperCase() | ||
|
||
function resetOperationMode(): void { | ||
socket.emit( | ||
IO.SET_OPERATION_MODE, | ||
reduxState.appNav[0].activeTab, | ||
OperationMode.CONTROL | ||
) | ||
} | ||
|
||
export function OperationModeEditVisibilityFooter(): JSX.Element { | ||
return ( | ||
<Footer> | ||
<div className="operation-mode-edit-visibility-footer"> | ||
<div className="operation-mode-edit-visibility-footer__text"> | ||
{ DESCRIPTION_TEXT } | ||
</div> | ||
<div className="operation-mode-edit-visibility-footer__controls"> | ||
<button onClick={ resetOperationMode }>{ BUTTON_TEXT }</button> | ||
</div> | ||
</div> | ||
</Footer> | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react' | ||
import { useSelector } from 'react-redux' | ||
import { OperationMode } from '../../../model/reducers/mediaReducer' | ||
import { reduxState } from '../../../model/reducers/store' | ||
import { OperationModeEditVisibilityFooter } from './OperationModeEditVisibilityFooter' | ||
|
||
export function OperationModeFooter(): JSX.Element { | ||
const operationMode: OperationMode = useSelector((storeUpdate: any) => | ||
storeUpdate.media[0].output[reduxState.appNav[0].activeTab]?.operationMode) | ||
|
||
switch (operationMode) { | ||
case OperationMode.EDIT_VISIBILITY: { | ||
return <OperationModeEditVisibilityFooter /> | ||
} | ||
case OperationMode.CONTROL: | ||
default: { | ||
return <></> | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,15 @@ import { setGenerics } from '../../model/reducers/settingsAction' | |
import { socket } from '../util/SocketClientHandlers' | ||
import * as IO from '../../model/SocketIoConstants' | ||
import { TOGGLE_SHOW_SETTINGS } from '../../model/reducers/appNavAction' | ||
import { OperationMode } from '../../model/reducers/mediaReducer' | ||
|
||
// Check if URL has specifiet a channel: | ||
const channel = new URLSearchParams(window.location.search).get('channel') | ||
const specificChannel = parseInt(channel) || 0 | ||
|
||
const OFF_COLOR = { backgroundColor: 'rgb(41, 41, 41)' } | ||
const ON_COLOR = { backgroundColor: 'rgb(28, 115, 165)' } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be CSS classes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will be extracted to CSS, along with a few other areas with similar created styling code, during my refactor of the code structure. |
||
|
||
//Set style for Select dropdown component: | ||
const selectorColorStyles = { | ||
control: (styles) => ({ | ||
|
@@ -27,6 +31,23 @@ const selectorColorStyles = { | |
singleValue: (styles) => ({ ...styles, color: 'white' }), | ||
} | ||
|
||
function emitSetOperationMode() { | ||
socket.emit( | ||
IO.SET_OPERATION_MODE, | ||
reduxState.appNav[0].activeTab, | ||
reduxState.media[0].output[reduxState.appNav[0].activeTab] | ||
.operationMode !== OperationMode.EDIT_VISIBILITY | ||
? OperationMode.EDIT_VISIBILITY | ||
: OperationMode.CONTROL | ||
) | ||
} | ||
|
||
function getEditVisibilityStyle(): { backgroundColor: string } { | ||
return reduxState.media[0].output[reduxState.appNav[0].activeTab]?.operationMode === OperationMode.EDIT_VISIBILITY | ||
? ON_COLOR | ||
: OFF_COLOR | ||
} | ||
|
||
export const SettingsPage = () => { | ||
const handleSettingsPage = () => { | ||
reduxStore.dispatch({ | ||
|
@@ -132,16 +153,14 @@ export const SettingsPage = () => { | |
<div className="Settings-channel-form"> | ||
<button | ||
className="save-button" | ||
onClick={() => { | ||
handleSave() | ||
}} | ||
onClick={handleSave} | ||
> | ||
UPDATE CLIPTOOL SETTINGS | ||
</button> | ||
{!specificChannel ? ( | ||
<button | ||
className="save-button" | ||
onClick={() => handleRestart()} | ||
onClick={handleRestart} | ||
> | ||
RESTART CLIPTOOL | ||
</button> | ||
|
@@ -150,10 +169,17 @@ export const SettingsPage = () => { | |
)} | ||
<button | ||
className="save-button" | ||
onClick={() => handleSettingsPage()} | ||
onClick={handleSettingsPage} | ||
> | ||
EXIT | ||
</button> | ||
<button | ||
className="save-button" | ||
onClick={emitSetOperationMode} | ||
style={getEditVisibilityStyle()} | ||
> | ||
EDIT VISIBILITY | ||
</button> | ||
</div> | ||
</div> | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this JSON do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a file generated by Cliptool now, that contains a Record of which files are hidden, with their size and changed values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use localStorage?