Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
293c531
hash_values / primary keys can look like uris, so encode hash value a…
Jul 5, 2023
0e2735b
expand encode/decode logic from just hash value to table and schema
Jul 7, 2023
4ab232a
rename url to prevent shadowing lint error.
Jul 7, 2023
5133c19
revert decodedHash binding to just 'hash'
Jul 7, 2023
9a4e11a
wip: linting styles
Oct 30, 2023
3e5860a
store unsaved updates to editor files in local storage by compute_sta…
Oct 31, 2023
d004d56
add revert file button to editor menu
Oct 31, 2023
cb922fa
adjust revert-file css
Oct 31, 2023
9b737bd
WIP: selectNewFile should return cached content to instance if it's a…
Oct 31, 2023
ac3662a
remove console.log
Nov 1, 2023
ee38f01
merge conflict after cherry-picking change to master
Nov 1, 2023
18776bb
lint
Nov 1, 2023
594f341
needs testing: file revert functionality tentatively working.
Nov 1, 2023
688a499
Merge branch 'stage' into STUDIO-93
foundling Nov 1, 2023
762fe57
Merge pull request #351 from HarperDB/STUDIO-93
foundling Nov 1, 2023
adbcf44
add ButtonWithLoader component, use in delete file window. todo: repl…
Nov 2, 2023
bfbb07e
Merge branch 'STUDIO-93' of github.com:HarperDB/hdbms into STUDIO-93
Nov 2, 2023
4592f30
add disabled prop to button with loader, use in more windows.
Nov 2, 2023
15dd3d7
fix callbacks invoked by ButtonWithLoader
Nov 2, 2023
d9b4c7c
lint.
Nov 2, 2023
19e0249
Merge branch 'stage' into STUDIO-93
foundling Nov 2, 2023
10f3bcd
Merge pull request #352 from HarperDB/STUDIO-93
foundling Nov 2, 2023
b44a3e4
lint.
Nov 2, 2023
915cd4f
Merge branch 'STUDIO-93' of github.com:HarperDB/hdbms into STUDIO-93
Nov 2, 2023
5467e1c
lint.
Nov 2, 2023
5699aaf
await addProject callback to see loader in confirm button
Nov 2, 2023
98b78f3
Merge pull request #353 from HarperDB/STUDIO-93
foundling Nov 2, 2023
d72e5bc
Merge branch 'stage' into STUDIO-59
foundling Nov 7, 2023
d820f53
Merge pull request #303 from HarperDB/STUDIO-59
foundling Nov 7, 2023
37a8952
v4.3.3.
Nov 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "harperdb-studio",
"version": "4.3.2",
"version": "4.3.3",
"description": "A UI for HarperDB",
"deploymentUrl": "studio.harperdb.io",
"private": true,
Expand Down
61 changes: 37 additions & 24 deletions src/assets/styles/components/_web-ide.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
}
}

color: white;
color: $color-white;

.editor.current-file-path {
border-bottom: 1px solid transparent;
}

.default-window-option {
span {
color: white;
color: $color-white;
}

}
Expand Down Expand Up @@ -50,7 +50,7 @@
}

.file-browser button > span {
color: white !important;
color: $color-white !important;
}

.file-browser .file.file-selected > span {
Expand All @@ -74,23 +74,25 @@


.default-window-option span {
color: white !important;
color: $color-white !important;
}

.editor-window .default-window .default-window-container {
background: $color-pureblack !important;
color: white;
color: $color-white;
}

.no-projects {
color: white;
color: $color-white;

.docs-link {
color: #ee81ee !important;
}
}

color: white;
color: $color-white;

color: rgb(105, 105, 105);

color: rgb(105, 105, 105);

Expand Down Expand Up @@ -128,11 +130,11 @@
}

.editor-window .cancel-button:hover {
color: white;
color: $color-white;
}

.package-install-window {
background: white;
background: $color-white;
}

.editor.current-file-path {
Expand Down Expand Up @@ -162,21 +164,14 @@
background: rgb(26, 26, 26);
}

/*
.root {
display: grid;
grid-template-columns: 150px minmax(0px, auto);
height: 100%;
}
*/
// background: transparent !important;
}

.file-menu,
.editor-menu {
border-bottom: 1px solid darkgray !important;
}

.revert-file[disabled],
.save-code[disabled] {
color: #c2c2c2 !important;
}
Expand Down Expand Up @@ -228,7 +223,7 @@
color: rgb(105, 105, 105);

.package-install-window {
background: white;
background: $color-white;
}

.editor.current-file-path {
Expand Down Expand Up @@ -265,7 +260,7 @@
}

.editor-window button:hover {
color: white;
color: $color-white;
//rgb(105,105,105);
}

Expand Down Expand Up @@ -293,6 +288,22 @@
}

.web-ide {
.button-with-loader {
min-width: 105px;

&.loading {
color: transparent;
}

.button-with-loader-icon {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}

}
.cancel-button {
margin-left: 10px;
}
Expand Down Expand Up @@ -352,7 +363,7 @@
.add-file-icon {
background: transparent;
border: none;
color: white;
color: $color-white;
margin: 0;
outline: none !important;
padding: 0;
Expand All @@ -371,7 +382,7 @@
padding: 20px;

.file-menu {
color: white;
color: $color-white;

display: flex;
flex-direction: row;
Expand Down Expand Up @@ -502,7 +513,7 @@
.editor-menu {
align-items: baseline;
border-bottom: 1px solid #2e2e2e;
color: white;
color: $color-white;
display: flex;
flex-direction: row;
justify-content: left;
Expand Down Expand Up @@ -536,6 +547,7 @@
}
}

.revert-file,
.save-code {
background: transparent;
border: none;
Expand All @@ -546,6 +558,7 @@
padding: 0;
}

.revert-file[disabled],
.save-code[disabled] {
color: #5e5e5e;
cursor: default;
Expand Down Expand Up @@ -828,11 +841,11 @@
width: 40px;

i {
color: white;
color: $color-white;


&.not-searching {
color: white; //rgba(0,255,0, 0.1);
color: $color-white; //rgba(0,255,0, 0.1);
}


Expand Down
80 changes: 44 additions & 36 deletions src/components/instance/browse/BrowseDatatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,42 +115,50 @@ function BrowseDatatable({ tableState, setTableState, activeTable }) {

return (
<>
<DataTableHeader
totalRecords={totalRecords}
loading={loading}
loadingFilter={loadingFilter}
autoRefresh={tableState.autoRefresh}
refresh={() => setLastUpdate(Date.now())}
toggleAutoRefresh={() => setTableState({ ...tableState, autoRefresh: !tableState.autoRefresh })}
toggleFilter={() => setTableState({ ...tableState, showFilter: !tableState.showFilter })}
/>
<Card className="my-3">
<CardBody className="react-table-holder">
<DataTable
manual
columns={tableState.dataTableColumns || []}
data={tableState.tableData || []}
currentPage={tableState.page}
pageSize={tableState.pageSize}
totalPages={totalPages || 0}
showFilter={tableState.showFilter}
sorted={tableState.sorted.length ? tableState.sorted : [{ id: tableState.hashAttribute, desc: false }]}
loading={loading && !tableState.autoRefresh}
onFilteredChange={(value) => {
setTableState({ ...tableState, page: 0, filtered: value })
}}
onSortedChange={(value) => setTableState({ ...tableState, page: 0, sorted: value })}
onPageChange={(value) => setTableState({ ...tableState, page: value })}
onPageSizeChange={(value) => setTableState({ ...tableState, page: 0, pageSize: value })}
onRowClick={(rowData) => {
const hashValue = rowData[tableState.hashAttribute];
navigate(`/o/${customer_id}/i/${compute_stack_id}/browse/${schema}/${table}/edit/${rowData[tableState.hashAttribute]}`, {
state: { hashValue }
})
}}
/>
</CardBody>
</Card>
<DataTableHeader
totalRecords={totalRecords}
loading={loading}
loadingFilter={loadingFilter}
autoRefresh={tableState.autoRefresh}
refresh={() => setLastUpdate(Date.now())}
toggleAutoRefresh={() => setTableState({ ...tableState, autoRefresh: !tableState.autoRefresh })}
toggleFilter={() => setTableState({ ...tableState, showFilter: !tableState.showFilter })}
/>
<Card className="my-3">
<CardBody className="react-table-holder">
<DataTable
manual
columns={tableState.dataTableColumns || []}
data={tableState.tableData || []}
currentPage={tableState.page}
pageSize={tableState.pageSize}
totalPages={totalPages || 0}
showFilter={tableState.showFilter}
sorted={tableState.sorted.length ? tableState.sorted : [{ id: tableState.hashAttribute, desc: false }]}
loading={loading && !tableState.autoRefresh}
onFilteredChange={(value) => {
setTableState({ ...tableState, page: 0, filtered: value })
}}
onSortedChange={(value) => setTableState({ ...tableState, page: 0, sorted: value })}
onPageChange={(value) => setTableState({ ...tableState, page: value })}
onPageSizeChange={(value) => setTableState({ ...tableState, page: 0, pageSize: value })}
onRowClick={(rowData) => {

// encode schema, table and hashValue because they can contain uri components
const hashValue = rowData[tableState.hashAttribute];
const encodedSchema = encodeURIComponent(schema);
const encodedTable = encodeURIComponent(table);
const encodedHash = encodeURIComponent(hashValue);

const recordViewUrl = `/o/${customer_id}/i/${compute_stack_id}/browse/${encodedSchema}/${encodedTable}/edit/${encodedHash}`;
const navigateOptions = { state: { hashValue } };

navigate(recordViewUrl, navigateOptions);

}}
/>
</CardBody>
</Card>
</>
);
}
Expand Down
16 changes: 15 additions & 1 deletion src/components/instance/browse/JSONEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,21 @@ import addError from '../../../functions/api/lms/addError';
import ErrorFallback from '../../shared/ErrorFallback';

function JSONEditor({ newEntityAttributes, hashAttribute }) {
const { customer_id, schema, table, hash, action, compute_stack_id } = useParams();

const {
customer_id,
schema: encodedSchema,
table: encodedTable,
hash: encodedHash,
action,
compute_stack_id
} = useParams();

// hash, table and schema can have uri components
const schema = decodeURIComponent(encodedSchema);
const table = decodeURIComponent(encodedTable);
const hash = decodeURIComponent(encodedHash);

const alert = useAlert();
const { state: locationState } = useLocation();
const navigate = useNavigate();
Expand Down
Loading