Giter VIP home page Giter VIP logo

column-builder's People

Contributors

davenquinn avatar idzikowski-casey avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

column-builder's Issues

General code review comments

I am starting to work on getting this installed + running myself. A few points:

  • Your database dump script is complicated. Don't ask if users want to make schema changes when creating a new database. There should be one mostly correct version of the data
  • There needs to be an env.example file

There will be many more bug reports, I am sure, but this should be a good start. You should start developing new features as Pull Requests, to take advantage of the code review and acceptance processes here.

Fixing basic code smells

There are a few issues with the source code that I am worried about right now:

At https://github.com/UW-Macrostrat/column-infrastructure/blob/b23142e2fdf32cef771ef52966bb2df9307d6833/frontend/dacite/pages/strat-name/edit.ts#L19, you return from the function before running a React hook. This will create errors. You need to run all hooks before returning.

On many pages, the persistChanges function has a fair bit of error handling boilerplate and often some path manipulations. Is there a way that this could be simplified and abstracted?

UnitSectionTable - editor is too dismissive

For the table views on the Column and Section page, the editors are too easy to dismiss and may lead to users accidentally erasing unsaved data. Although complete prevention is impossible we should make some changes to mitigate it as much as possible. For the in-table editor, disabling other user interactions may be enough. For other things, like reordering of units, it would be better to have a fail-safe for preventing loss on page navigation, like a modal that takes over the screen and points out unsaved data.

ui-enhancements

  • Notification when trying to open two editors on column-section
  • Strat-name multidialog- large search interface
  • keyboard accessibility
  • Interval select: show more info, hierarchy?

Reactivating development of this application

Now that @amyfromandi has joined us, we are preparing to reactivate development of this application to enable editing of stratigraphic columns.

This application prototyped several approaches that are now becoming standard in Macrostrat v2:

  • Microservice architecture
  • PostgREST for API route development
  • Multi-page, server-rendered react application for web services (here, Next.js, the current web codebase uses Vike)

It is also a bit fragmented:

I propose that we split the codebase to

  1. Put table/view definitions in the macrostrat repository
  2. Put other API code and topology-management service in separate containers as appropriate
  3. Move the frontend React code to the web codebase, and migrate it from Next.js to Vike to match our current approach

This will allow us keep the app closely tied to the rest of Macrostrat's user-facing code and take advantage of our CI/CD, etc.

This iteration of the app is a fairly straightforward re-implementation of the original Dacite column editing tools (PHP). However, there are other approaches to editing columns. We've created some other prototype apps that might be worth borrowing from eventually (note, these are currently not running anywhere):

  • stratigram: prototype image-oriented app for capture of measured sections (could be another view here)
  • naukluft-app: column editor focused on the specific case of a field project in Namibia
    One step would just be to run these apps for testing and get a sense of what aspects might be worth harvesting.

Naming

I think we should rename this to be slightly more restrictive โ€” how about "column-entry" or "column-builder"?

Stop Punting on Errors

Stop punting on errors from API calls, it can lead to confusing interface states where it's unclear what is going on. It would be good to have some preliminary error boundary in the BasePage.

Issues building "upgraded" version of burwell database locally

I have the following output when I try to build a Macrostrat database using the database/bin/dump-burwell script. Basically, a lot of tables get created but a few are not found, notably macrostrat.projects. This causes an error cascade of sorts and leads to an application that can't be initialized:

DELETE 68
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
DELETE 9
ALTER TABLE
UPDATE 23769
DELETE 0
ALTER TABLE
ALTER TABLE
ALTER TABLE
UPDATE 1
UPDATE 1
DELETE 2
ALTER TABLE
DELETE 33
ALTER TABLE
DELETE 1
ALTER TABLE
ALTER TABLE
DELETE 2
ERROR:  relation "macrostrat.sections" does not exist
LINE 3: where section_id not in (select id from macrostrat.sections)...
                                                ^
ERROR:  relation "macrostrat.sections" does not exist
ERROR:  relation "macrostrat.sections" does not exist
ERROR:  relation "macrostrat.strat_tree" does not exist
LINE 1: DELETE FROM macrostrat.strat_tree
                    ^
ERROR:  relation "macrostrat.strat_tree" does not exist
LINE 1: UPDATE macrostrat.strat_tree
               ^
ERROR:  relation "macrostrat.strat_tree" does not exist
ERROR:  relation "macrostrat.projects" does not exist
ERROR:  relation "macrostrat.projects" does not exist
ERROR:  relation "macrostrat.projects" does not exist
ERROR:  column "project_id" of relation "col_groups" does not exist
LINE 2: SET project_id = c.project_id
            ^
Gathering arguments
Running database/bin/../db-alterations/02-remove-unused.sql on database
ALTER TABLE
Gathering arguments
Running database/bin/../db-alterations/03-primary-key-seq.sql on database
CREATE FUNCTION
CREATE PROCEDURE
INFO:  Resetting Sequence for: macrostrat.col_areas (id) to 5355
INFO:  Resetting Sequence for: macrostrat.col_groups (id) to 354
INFO:  Resetting Sequence for: macrostrat.col_refs (id) to 9725
INFO:  Resetting Sequence for: macrostrat.cols (id) to 5732
INFO:  Resetting Sequence for: macrostrat.econs (id) to 24
INFO:  Resetting Sequence for: macrostrat.environs (id) to 94
INFO:  Resetting Sequence for: macrostrat.grainsize (grain_id) to 32
INFO:  Resetting Sequence for: macrostrat.lith_atts (id) to 186
INFO:  Resetting Sequence for: macrostrat.liths (id) to 214
INFO:  Resetting Sequence for: macrostrat.lookup_units (unit_id) to 93480
INFO:  Resetting Sequence for: macrostrat.measuremeta (id) to 1
INFO:  Resetting Sequence for: macrostrat.places (place_id) to 88
INFO:  Resetting Sequence for: macrostrat.refs (id) to 222
INFO:  Resetting Sequence for: macrostrat.strat_names_meta (concept_id) to 43927
INFO:  Resetting Sequence for: macrostrat.strat_names (id) to 108126
INFO:  Resetting Sequence for: macrostrat.timescales (id) to 33
INFO:  Resetting Sequence for: macrostrat.unit_econs (id) to 3158
INFO:  Resetting Sequence for: macrostrat.unit_environs (id) to 127121
INFO:  Resetting Sequence for: macrostrat.unit_lith_atts (id) to 104172
INFO:  Resetting Sequence for: macrostrat.unit_liths (id) to 176068
INFO:  Resetting Sequence for: macrostrat.unit_measures (id) to 105049
INFO:  Resetting Sequence for: macrostrat.unit_strat_names (id) to 32155
INFO:  Resetting Sequence for: macrostrat.units (id) to 93483
INFO:  Resetting Sequence for: macrostrat.units_sections (id) to 91989
INFO:  Resetting Sequence for: macrostrat.intervals (id) to 1688
CALL
Gathering arguments
Running database/bin/../db-alterations/04-misscel.sql on database
ALTER TABLE
UPDATE 27955
Gathering arguments
Running database/bin/../fixtures/01-views.sql on database
CREATE SCHEMA
ERROR:  relation "macrostrat.projects" does not exist
LINE 2: SELECT * FROM macrostrat.projects;
                      ^
CREATE VIEW
CREATE VIEW
CREATE VIEW
CREATE VIEW
CREATE VIEW
CREATE VIEW
ERROR:  relation "macrostrat.strat_tree" does not exist
LINE 2: SELECT * FROM macrostrat.strat_tree;
                      ^
CREATE VIEW
CREATE VIEW
CREATE VIEW
CREATE VIEW
CREATE VIEW
ERROR:  relation "macrostrat.sections" does not exist
LINE 2: SELECT * FROM macrostrat.sections;
                      ^
CREATE VIEW
CREATE VIEW
ERROR:  column cg.project_id does not exist
LINE 5: cg.project_id,
        ^
HINT:  Perhaps you meant to reference the column "c.project_id".
CREATE VIEW
CREATE VIEW
CREATE VIEW
CREATE VIEW
ERROR:  column u.notes does not exist
LINE 16: u.notes,
         ^
CREATE VIEW
ERROR:  column c.notes does not exist
LINE 6: c.notes,
        ^

row editor state too complicated

The state managing which row is editing and the actions for copying units up and down has become too complicated as I layered on different editing modes. Now that we're back to a simpler model, the state management should also be simpler.

The useRowEditor is unnecessarily complicated and should be wrapped into the reducer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.