GithubHelp home page GithubHelp logo

eisvana / eisvana-census Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 2.04 MB

Census management website for Eisvana

Home Page: http://census.eisvana.com/

License: GNU General Public License v3.0

HTML 2.37% Vue 50.23% SCSS 0.75% TypeScript 46.65%
eisvana nomanssky census

eisvana-census's Issues

Form: Updating Page: Rework infobox image

The infobox image is required for new bases, but isn't for existing bases.

We cannot input files into the file input like we can with other input types.

This means that if you don't upload a new file, it will be flagged as invalid.

-> There should be some form of visualisation of what you uploaded -> Take inspiration from https://www.nmswikiboilerplate.com/civ

The image property in the state should be replaced with a FileItem (or similar). This allows us to have a file or just a URL. The URL can also be used for the image element to show the uploaded image.

Table: Update Buttons on the cards

Instead of "Update", use "Update Base" and "New Base".

  • "New Base" should autofill the player data
  • "Update Base" should only give the textblocks and the checkboxes for Arena, farm, etc.

Open questions and potential blockers:

  • How can we convert a MW API response to the proper input fields?
  • What can we use to get a full page from MW? Parse?

# is an illegal character in cargo queries

When querying for bases of a specific player, replace all # with _. This is a wildcard in SQL that matches a single character.

The query would of course need to be adjusted to use LIKE.

Form: Display images from queried page

https://nomanssky.fandom.com/api.php?action=parse&format=json&origin=*&summary=%5B%5BMedia%3AEisvanaFlag.png%5D%5D&prop=

summary is [[Media:EisvanaFlag.png]].

This returns:

{
    "parse": {
        "title": "API",
        "pageid": 0,
        "parsedsummary": {
            "*": "<a href=\"https://static.wikia.nocookie.net/nomanssky_gamepedia/images/8/83/EisvanaFlag.png/revision/latest?cb=20231105120302\" class=\"internal\" title=\"EisvanaFlag.png\">Media:EisvanaFlag.png</a>"
        }
    }
}

The parsedsummary can be parsed with a DOMParser, and then the URLs extracted and put into the src attributes of img elements.

Table:Experiment: animate card margin

Try animating the card margin when expanding the actions.
When actions are collapsed, leave the margin as-is.
When actions are expanded, set margin to 5rem or smth like that.
Use :has() for that.

Something like

.census-table article {
transition: margin-block-end var(--pico-transition); 

&:has(details[open]) {
  margin-block-end: 5rem;
}
}

How to validate data completeness

Since we mostly have required fields, and only few optional fields, we can simply grab all the fields, then filter for those that are empty, and then check whether any of these do not match an array of optional fields.

Add a way for people to select another base as their primary base

Query all bases of a user from the wiki that were built in Eisvana
Display that list
Give user the option to choose one
Let them give a reason (in case they deleted the old one)

Don't show the button if there is only one base available.

The button could be on the census table page. The request should only fired when they actively click on the button, otherwise we end up spamming the API.

Census Table like on the wiki

Ideally the table should fit on one page.

Current issues:

  • wikitext cannot be parsed -> MW API?
fetch(`https://nomanssky.fandom.com/api.php?action=parse&format=json&origin=*&summary=Some%20%5B%5Blink%5D%5D`).then(r => r.json()).then(j => document.body.innerHTML = j.parse.parsedsummary['*'])

https://nomanssky.fandom.com/wiki/Special:ApiSandbox#action=parse&format=json&origin=*&summary=Some%20%5B%5Blink%5D%5D&prop=

Doesn't seem to be able to parse external links

  • scaling -> smaller font size? Leaving out columns?

Index page

Add an index page with links to the other 3 sub-pages.
The links and a small description should be in cards that are aligned horizontally with a flexbox.

Form: Routing

How should user routing work?

Google has a page-reload. That enables going to the previous form by clicking the "back" button. This is good UX.

Maybe https://developer.mozilla.org/en-US/docs/Web/API/Window/hashchange_event would be something to consider.

Other links:
https://stackoverflow.com/questions/1397329/how-to-remove-the-hash-from-window-location-url-with-javascript-without-page-r
https://developer.mozilla.org/en-US/docs/Web/API/History/pushState

Also add a check that the user actually completed the first form. If the first form is not completed, the second one must not load.

The hash for the second one should be automatically removed if the first form hasn't been completed.

Refractor wiki page builder

Instead of relying on a whole file with inserted variables, take an array of section objects.

Each section object has a heading and a body.

  • Heading represents h2
  • Body is all text below that, including sub-headings
  • First section should omit the heading

Form

  • Should mirror the google form.

Should also be able to accept data from localstorage or sessionstorage (needs testing whether sessionstorage persists a page reload/route change)

Data is stored with username as key in storage. Key is given in URL query parameter. If no key is given in URL -> no preload.
Table should stringify the json data when the link is clicked. If that is not possible, store the data on pageload.

Could also request fresh data based on query param -> slower

  • Submission text (and ideally colour) should make it clear whether this is a new or an updated submission.
  • Take multiple images, compress them to < 10MB.
    • Make sure infobox image is not repeated in gallery.
  • send txt file to Bridge with formatted wikitext
  • images as zip? -> Better not, just send them as-is. No need for more complexity which is rarely needed.

Refactor RenewButton

The RenewButton component should be made dumb.

Requirements:

  • Takes a userobject -> contains base name and user name
  • Should not contain any internal state whether someone was renewed or not -> renew whenever it is clicked

Renewal

Basically already done. Make sure the code gets properly reused for the renew button on the table page.

Table: spaces in social parm isn't handled properly

i. e. [https://x.com/Lilac_Chicky Lilac Chicky] in the wikitext gets parsed back as just Lilac instead of Lilac Chicky. It should split on the space, then shift the first item and concat the rest again with spaces

Improve user response UX

  • Add some green to the success screens
  • When having changed the active base, display that as requested, like it is with renewals

Form: Update Base

Editable fields:

  • Everything buildable
    • Name
    • Image
    • Type
    • Arena
    • Exocraft
    • Landingpad, etc.
    • Layout
    • Features
    • Additional info
  • User specific fields
    • Username -> synced with Builder
    • If Builder is null, show Builderlink
    • Discord name
    • Friend Code
    • Social Media links, etc.

Unchangeable fields:

  • Everything related to location
    • Glyphs, Coords
    • Geo Coords
    • Planet, System, Region, Galaxy
    • Civilized
    • Mode
    • Platform

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.