GithubHelp home page GithubHelp logo

blmp-client's Introduction

Vagrant scripts for BUDA platform instanciation

The base platform is built using Vagrant and VirtualBox:

  1. Install Vagrant and VirtualBox.
  2. Download or git clone this repository.
  3. cd into the unzipped directory or git clone
  4. install VirtualBox guest additions with vagrant plugin install vagrant-vbguest
  5. run vagrant up to summon a local instance

Or for an AWS EC2 instance:

  1. install the vbguest plugin: vagrant plugin install vagrant-vbguest
  2. and run the command: vagrant up or rename Vagrantfile.aws to Vagrantfile and run vagrant up --provider=aws

This will grind awhile installing all the dependencies of the BUDA platform.

Once the initial install has completed the command: vagrant ssh will connect to the instance where development, customization of the environment and so on can be performed as for any headless server.

Similarly, the jena-fuseki server will be listening on:

http://localhost:13180/fuseki

Lds-pdi application is accessible at :

http://localhost:13280/

(see https://github.com/buda-base/lds-pdi/blob/master/README.md for details about using this rest services)

The command: vagrant halt will shut the instance down. After halting (or suspending the instance) a further: vagrant up will simply boot the instance without further downloads, and vagrant destroy will completely remove the instance.

If running an AWS instance, after provisioning access the instance via ssh -p 15345 and delete Port 22 from /etc/ssh/sshd_config and sudo systemctl restart sshd. This will further secure the instance from attacks on port 22.

blmp-client's People

Contributors

ashveen avatar berger-n avatar eroux avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blmp-client's Issues

fix random 422 when saving

steps to reproduce

  1. create new instance
  2. fill some fields
  3. save
  4. fill some fields [no need]
  5. create another entity go to /new
  6. switch back to instance [no need]
  7. save

clean graph after removing entity from entities?

fix multiple property error after choosing shape from selector for any entity previously closed then loaded again

wondering how to clean graph after removing entity from entities?

should be needed to address Duplicate atom key "(...)". This is a FATAL ERROR in production

open an entity then close it, then reopen it, see warnings in console

(couldn't check in production because of SSL certificate missing https://editserv-dev.bdrc.io/focusGraph/bdr:P1583 but it should crash)

cannot access latest recoil state value from window message listener

  1. get search results for property personEventRole:

image

  1. begin typing keyword in property below:

image

  1. debug log shows that in component function property value for eventWhere has been stored and is available:

image

  1. click a resource in iframe, it is now displayed as property value:

image

  1. meanwhile a few lines below in window message listener property value for eventWhere that has been logged on click then stored is empty:

image

  1. property value for eventWhere is back to its initial empty value:

image

stronger highlighting of current field

@ngawangtrinley 's remark: in the case where there are many small fields one after the other, it's sometimes a bit unclear what field the + and - buttons correspond to, the current field could be highlighted a bit more strongly

fix mixing data between different kinds of shapes

  • fix loading profile after another entity has been loaded
  • fix closing/highlighting in left menu
  • initialize undo/redo
  • fix mixing data from profile and entity after both are loaded then switching from one to the other

fix undo when navigating multiple times from/to profile from/to open entity
fix loading profile from left menu when in session at startup
fix glitches when navigating between profile and other entity using left menu

batch adding volumes

for properties that can be added in batch (let's create bds:allowBatchAdd for that), the button "add image group" should become "add X image group(s)" where X is a form defaulting to 1

add buttons to scan request page

On the scan request page, there should be

  • a positive integer input field "total number of volumes", defaulting to 1, then transmitted to the request &nbvols=X
  • an optional string + lang input field "scan info", then transmitted to the request &scaninfo=X&scaninfo_lang=en

splitting code

The code should be split between:

  • the core of the RDF editor, which we can call rdf:webEditor
  • the BDRC editor which contains multiple things (outline, auth, custom style, etc.)

The core of the editor would be:

  • the entity selection on the left
  • the editor with configurable functions to create the URLs to fetch the entities, shapes, etc.
  • a configurable auth mechanism (this might not be the easiest, I think we'll have to document the expected fields in the user profile object)
  • no BDRC logo or text

EDTF humanizer

as a help for the dates field, it would be good to have a humanizer for EDTF that we can plugin in the same UI space as the Unicode preview for Wylie fields. The humanizer could then be used on PDL to display the date.

There's a PHP library and a Ruby gem to take inspiration from, but no JS library...

We can start with the most important patterns, in that order (it has to be recursive):

  • [x,y,z] => x, y or z
  • {x,y,z} => x, y and z
  • x/y => between x and y
  • x/ => not before x
  • /x => not after x
  • x~ => circa x
  • x? => x?
  • x% => circa x?
  • zXX => (z+1)th c. (ex: 12XX => 13th century

integer GIS coordinates

When I go to https://editor.bdrc.io/edit/bdr:G1563/bds:PlaceShape and try to save, the editor sends GIS coordinates as floats instead of strings. This is probably because they are like that in the original file, but the issue is that now we can't save anything... and strangely this also happens when I select other (very close) coordinates. Is it possible to force the placeLat and placeLong fields to be strings? (I know there is some amount of code for these fields). Perhaps in general we should enforce the datatype from the shape, even if the value doesn't match

language detection in editor fields

For a project involving native Tibetans, it would be much easier for them if the lang tag automatically switches to bo when the field is in Tibetan Unicode

error on duplicate value of node properties

for instance in purl.bdrc.io/graph/W8CZ12.ttl there are two volumes numbered one. This should be impossible in the editor. Note that there can be gaps in the numbering, that's fine, just not the same value twice. Let's indicate this case with the property bds:uniqueValueAmongSiblings set to true on the volumeNumber property

calling more cache cleanup

When an instance (MW) or scan (W) is saved, in addition to the call to clean the cache of ldspdi, we should also clean the cache of iiifpres and iiif with something along the lines of:

curl -XPOST http://iiif.bdrc.io/cache/clear
curl -XPOST http://iiifpres.bdrc.io/clearcache

route to create entity with a specific ID

I tried to create an entity (an instance) with a specific ID but couldn't find any way to do so in the current editor... I think it's almost possible but it doesn't currently work. Let's add a proper mechanism for that.

For now it can be just a route so that going to a certain URL can trigger it. Later when the user tries to open an entity that doesn't exist, they could be asked "do you want to create a new entity with this ID?" and then directed to that route

catching invalid GIS coordinates exception

In the current editor, when inputting some wrong coordinates the editor crashes, the console says:

react-dom.production.min.js:209 Error: Invalid LatLng object: (32.790299, 79.001794, 79.16593551635744)
    at new U (LatLng.js:32:9)
    at H (LatLng.js:123:11)
    at t.initialize (Map.js:153:17)
    at new t (Class.js:22:20)
    at MapContainer.js:10:24
    at ls (react-dom.production.min.js:211:320)
    at xl (react-dom.production.min.js:257:303)
    at t.unstable_runWithPriority (scheduler.production.min.js:19:467)
    at Zi (react-dom.production.min.js:122:325)
    at Tl (react-dom.production.min.js:257:58)
is @ react-dom.production.min.js:209
scheduler.production.min.js:14 Uncaught Error: Invalid LatLng object: (32.790299, 79.001794, 79.16593551635744)
    at new U (LatLng.js:32:9)
    at H (LatLng.js:123:11)
    at t.initialize (Map.js:153:17)
    at new t (Class.js:22:20)
    at MapContainer.js:10:24
    at ls (react-dom.production.min.js:211:320)
    at xl (react-dom.production.min.js:257:303)
    at t.unstable_runWithPriority (scheduler.production.min.js:19:467)
    at Zi (react-dom.production.min.js:122:325)
    at Tl (react-dom.production.min.js:257:58)

random "TypeError: Cannot define property __memoized_map_1, object is not extensible"

it *sometimes* happens when you reload http://localhost:3001/edit/bdr:P1583/bds:PersonShape :

image


this error is introduced by commit: 2413afd (latest in resourceselector branch)

  • commenting this line:
    setEntities(newEntities)

    fixes the issue but then prefLabels aren't available in EntitySelectorContainer here:
    {entities.map((entity: Entity, index) => {
    // TODO: use entityQname to highlight the selected entity
    const link = "/edit/" + entity.subjectQname + (entity.shapeRef ? "/" + entity.shapeRef.qname : "")
    let label
    if (entity.subject) {
    const prefLabels = entity?.subject?.getPropValueByLang(shapes.prefLabel)
    label = lang.ValueByLangToStrPrefLang(prefLabels, uiLang)
    }

  • commenting this:
    @Memoize((propertyUri: string, subjectUri: string) => {
    return subjectUri + propertyUri
    })

    also fixes the issue yet app is not usable because there seems to be an infinite loop showing warning messages about duplicate atom key:
    image

adjustments for literal selects

in the user profile there are two of them, but they look a bit broken (the same label is displayed twice in a row, and the + and - are not aligned:

Capture d’écran de 2022-03-03 17-19-28

wrong history behavior after showing secondary properties in event

steps to reproduce:

  1. load P1
  2. click on first event card
  3. click on Show Empty Secondary Properties
  4. go to New/Load page using left menu
  5. click back on P1 in left menu
  6. undo is enabled and entity has Modified state:

image


logs show history is modified "out of the blue" when displaying P1:

image


using debugger with breakpoint on that debug("history:"...) call shows a 100% recoil/react call stack leading to

propsUpdateEffect: (subjectUri: string, pathString: string) => AtomEffect<Array<Value>> = (
subjectUri: string,
pathString: string
) => ({ setSelf, onSet }: setSelfOnSelf) => {
onSet((newValues: Array<Value> | DefaultValue): void => {
if (!(newValues instanceof DefaultValue)) {
this.onUpdateValues(subjectUri, pathString, newValues)
}
})
}

(click to enlarge screenshot):

image


so I don't know where to go from here... does it ring a bell to you @eroux? or should I try something like putting history in read-only state while data for P1 is being reloaded displayed again? wdyt?

demo mode

It's quite important we have a public (read-only) demo of the editor by the end of the week. I think it could happen in two steps:

step 1

  • on the home page, users have the choice between login and demo
  • the /demo path wouldn't require login and would be a separate home page with a static text plus a link to open a demo entity (why not P1583 for instance), and with just the editor (not the outline editor, etc.)
  • in the demo mode everything runs as usual except:
    • the PUT request is not done when users hit the save button, instead a message says Demo mode: not actually saving
    • there is a hard coded user profile U0DEMO01 with the necessary values, including the RID prefix 0DEMO

step 2

This one is a bit more difficult to accomplish so perhaps we can save it for later, it would involve:

  • copying the current person shapes file in the public/examples/ folder
  • copying the focus graph of P1583 there too, as well as a file with the result of the query of associated labels
  • isolating the functions that get the URLs of the queries for these 3 things into a configuration file, with the default being something that always fetches the demo files
  • documenting how to change these
  • having a blmp-client-demo.bdrc.io that is configured in demo mode

use field as prefLabel

In the cases of person and instance, there are two sets of names:

  • the prefLabel
  • the names of the person / titles of the instance

in the data they are independent, but it's not very convenient if they are independent in the UI, since 99% of the time the prefLabel will be one of the names / titles.

A proposal is:

  • have a button "use as label" in each title / name
  • on onBlur of the input field of a name / title: if there is currently no prefLabel in the language of the name / title, add the name / title as prefLabel automatically (caveat: bo and bo-x-ewts are the same language

This case will be detected with the bds:allowPushToTopLevelSkosPrefLabel true (not the most elegant name but...)

UI for volume map

One last bit before we can release a complete version of the editor is the volume map edition... I think we should have a specalized UI for that... in order to do that in a way that will be easy for the users to get, it would be useful to understand the workflow of the DLMS... @xristy or @karmagongde when a user of the DLMS wants to create a 10 volumes work, what's are the different steps? can you give a few screenshots?

css improvement for facet in facet

The only case we have of that in the data is contentLocation in the note, which currently looks like:

Capture d’écran de 2022-03-01 15-23-18

which should be improved. I think in order to be consistent we should have the same style of button we have for facets at the top level (ex: notes, names, etc.)

Editor guide

hi @karmagongde, @JannTibetan

I've updated the Editor guide with many screenshots and how-tos.
(any comment, correction or request appreciated, of course)

Among what is not there yet is the part about scan requests that we couldn't figure out exactly without Elie at our last meeting.
I'm thinking of a section or two with everything about the Work / Version / Scans workflow.

BTW the document refers to creating & saving a new Topic (because it's one of the simplest kind of entity)
but I had to cheat a bit in the screenshots because there's currently a bug that prevents actually saving it...
just to say we shouldn't send this document to the librarians before it has been fixed (@eroux it's noted in the project)

fix errors in the console when creating a new entity

fix errors in the console when creating a new entity: "Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function. in NewEntityContainer (created by Context.Consumer)"

Trace save failures

When save fails and returns an error, you can now get a copy of what exact request was sent, by clicking the Copy trace button:

image


Paste the content here, add three backquotes on the line before and on the line after (you can use these: ```)
When previewed it should look like this:

curl 'http://editserv-dev.bdrc.io/bdr:MW0NB185/focusgraph' -X PUT -H "authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik16SkJRVEE1UkRaRE5VRkRNVUZHTmpFNU9EQTFNemsxUlRVM05VRkVOMEpHT0VVMk5rTkVNQSJ9.eyJodHRwczovL2F1dGguYmRyYy5pby9wZXJtaXNzaW9ucyI6W10sImh0dHBzOi8vYXV0aC5iZHJjLmlvL2dyb3VwcyI6WyJhZG1pbiIsInN0YWZmIl0sImh0dHBzOi8...aWwuY29tIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsImlzcyI6Imh0dHBzOi8vYmRyYy1pby5hdXRoMC5jb20vIiwic3ViIjoiZ29vZ2xlLW9hdXRoMnwxMDM3NzY2MTgxODk1NjU2NDg2MjgiLCJhdWQiOiJxMVlzV2pmbVAzN3I4VHNwVU9JcUxGNWw5UGh3OVFRWSIsImlhdCI6MTY1MjI4MzYyOCwiZXhwIjoxNjU0NzAyODI4LCJub25jZSI6IlRFTXhiR1ZNV0hKRVFUQjFPRVorYURKa1pqY3pVMk5QVVhKWVlrMXlURFZ5TmxKU1owOU5jR05xZEE9PSJ9.gZV_kBQ5I760r-JsY8Qcfh_VgVyDxaHI9SxGgYZuTs5KYglo-S0HeYnc6MpRq1fF1O2bXzBLQATVRL631ZhP2Y6xzc_QSuF9dE3Y-SUe6ORnexhNifeDlzs72eTk0vOCnuGbJMvZVpjxNk-8-uyQbRrfDUaPzz6Usi3MjtyYdvXYMEK7aXa42_VHRovR6qzI99TuedB8xqo4ruOc2Lnx4_Mq3LArhFxmt-cdM57CoVWOK1C5W-qrp3yVTsTPRdSKsNielbPpUK6UjhlbKyEDWnI7pk3FKupn7kBpb6HdOvB5fxtMAAt3Xkl3jA04qUjHGWSi0-2y10cDZCzRRVvOXQ" -H "content-type: text/turtle" -H "x-change-message: %22test%22%40en" --data-raw $'@prefix : <#>.
@prefix bdr: <http://purl.bdrc.io/resource/>.
@prefix bdo: <http://purl.bdrc.io/ontology/core/>.
@prefix adm: <http://purl.bdrc.io/ontology/admin/>.
@prefix skos: <http://www.w3.org/2004/02/skos/core#>.
@prefix bda: <http://purl.bdrc.io/admindata/>.

bda:MW0NB185
    a adm:AdminData;
    adm:adminAbout bdr:MW0NB185;
    adm:metadataLegal bda:LD_BDRC_CC0;
    adm:status bda:StatusReleased.
bdr:MW0NB185
    a bdo:Instance;
    bdo:copyrightStatus bdr:CopyrightUndetermined;
    bdo:hasSourcePrintery bdr:G2800;
    bdo:material bdr:MaterialPaper;
    bdo:printMethod bdr:PrintMethod_Modern;
    bdo:script bdr:ScriptDbuCan;
    skos:prefLabel "test"@en.
'

handling dates

This is a rather complex issue (more than I anticipated): we want to use a format for the value of bdo:onOrAbout that is EDTF, it has been integrated in ISO8601-2019.

Apart from the uncertainty of datatype to use in RDF (we'll keep xsd:string at the moment), there are a few issues:

  • validating the input, with a proper help message. I think this could be done with edtf.js. In the case where the date is not in a valid format, there should be a pretty long error message that I can write in the sh:message of bds:EventShape-onOrAbout
  • indicate that the field should be in EDTF format, I can't find a proper solution to that apart from a new property bds:specialPattern that will have the value bds:PatternEDTF (we can add bds:PatternISBN at some point too)
  • convert the EDTF date to the bdo:inYear or bdo:notBefore and bdo:notAfter fields automatically (which should be easy with edtf.js), keeping the EDTF value
  • hide the inferred fields
  • when the field is not present but bdo:inYear, bdo:notBefore or bdo:notAfter are present, generate it automatically with this data and hide these fields

text replace editor

there should be at some point a simple UI to replace occurences of a string (in a particular language) by another, in all the titles. The UI should first allow the user to preview all the changes, and then allow the user to confirm them

add button appears twice

if I create a new person entity and start typing in the admin note at the end (it seems to only happen once I start typing), the + sign appears twice:

Capture d’écran de 2021-10-20 16-03-14

scan requests

The last feature we need for the editor to be usable is the scan requests mechanism. In short it will be:

  • when the user is editing an ImageInstance (and only those), they are provided with a button "Save and generate scan request" (or just "generate scan request" if there's nothing to save)
  • when they click, they are provided with a popup with a few elements:
    • "add XXX volumes", where XXX is an integer form that needs be in the [0-999] range (default 0)
    • "generate a scan request"
  • when the user clicks on the scan request, the URL https://editserv.bdrc.io/scanrequest/bdr:WZZZ?addVolumes=YYY where bdr:WZZZ is the id of the image instance, and XXX is the result of the form "add XXX volumes"
  • the result of the request will be a zip file which the user will download, and then:
    • if volumes have been added, the client must reload the data of the resource (because more volumes have been added) and go back to editing the resource
    • if no volumes have been added, the popup closes

minor css / tooltip improvements

In the following screenshot there are a few issues:

Capture d’écran de 2022-03-01 15-52-44

  • "Source" (the red one) should be closer to the field below than it is to the text above
  • "search name or RID" should be "search name or RID for source" (so that it's clearer)

Finally, I'm not sure about this but I think it's worth looking at: when there's currently no value on a field (ex: "source statement"), instead of having like we have now "source statement" at the top and then an empty line, we could have either:

  • source statement at the top like it is now, and in the field, in gray, the help message (but in that case it's way too long... so let's not do that now)
  • nothing at the top, and "source statement" in the field in gray, then once the user types in the field, "source statement" moves at the top

better handling case when entity modified by multiple users

[first, modify work in another browser tab, then reload it in first one]

if etag in localStorage is not the latest (as when reloading local version in first tab after modified in second tab) loading local version is currently useless because it can't be saved:

  • unless we force etag to the latest after save error?
  • or ask user if he wants to overwrite online version?
  • or ask to lose local entity and reload online entity?

scan request on the home page

this feature would add a little form on the home page, a text input field would allow users to input a W rid (ex: W22084 or bdr:W22084, perhaps checking with a regex), and on the right there would be a button "generate scan request", this would just trigger the creation of the zip file like on the image instance page

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.