Skip to content

Commit 4249cf9

Browse files
Allow changing session archive mode
1 parent eadb745 commit 4249cf9

2 files changed

Lines changed: 56 additions & 1 deletion

File tree

src/components/form.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
width: auto;
4040
}
4141

42-
.input-text.pending, .input-checkbox.pending>span, .input-select.pending {
42+
.input-text.pending, .input-checkbox.pending>span, .input-select.pending, .input-radio-wrapper.pending {
4343
outline: 1px solid #f47750;
4444
}
4545

src/pages/sessions/session.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ const MODAL_SMALL_STYLE = {
3939
};
4040

4141
const SessionInfo = ({ session, openModal, vprops, locked }) => {
42+
const hasArchive =
43+
session.archive === null ||
44+
session.archive === false ||
45+
session.archive === true;
46+
const archiveProps = hasArchive && vprops("archive");
4247
return (
4348
<div>
4449
<InputGrid>
@@ -82,6 +87,56 @@ const SessionInfo = ({ session, openModal, vprops, locked }) => {
8287
</>
8388
)}
8489
</Field>
90+
{hasArchive && (
91+
<Field label="Archival">
92+
<div
93+
className={classNames({
94+
"input-radio-wrapper": true,
95+
pending: archiveProps.pending,
96+
})}
97+
>
98+
<label>
99+
<input
100+
type="radio"
101+
checked={session.archive === null}
102+
disabled={!archiveProps.enabled}
103+
onChange={(e) => {
104+
if (e.target.checked) {
105+
archiveProps.update(null);
106+
}
107+
}}
108+
/>
109+
Default
110+
</label>
111+
<label>
112+
<input
113+
type="radio"
114+
checked={session.archive === false}
115+
disabled={!archiveProps.enabled}
116+
onChange={(e) => {
117+
if (e.target.checked) {
118+
archiveProps.update(false);
119+
}
120+
}}
121+
/>
122+
Disabled
123+
</label>
124+
<label>
125+
<input
126+
type="radio"
127+
checked={session.archive === true}
128+
disabled={!archiveProps.enabled}
129+
onChange={(e) => {
130+
if (e.target.checked) {
131+
archiveProps.update(true);
132+
}
133+
}}
134+
/>
135+
Enabled
136+
</label>
137+
</div>
138+
</Field>
139+
)}
85140
<Field label="Users">
86141
<ReadOnly value={session.userCount} />
87142
/

0 commit comments

Comments
 (0)