Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added TXT export, JSON export, Export by Trait and Export by Material for both formats, Added Material privacy, New view for Materials, New form to fix data inconsistency issue, Fixed duplicate materials issue, Fixed numeric-only inputs issue and Special Pages unusable issue, Fixed Material types displayed using HTML (& not fetched from DB), Fixed JSON export limited to 5 materials issue, Modified and added formatting throughout the code for better readability and updated README for detailed installation instructions and made several other small fixes. #4

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

kkrcodes
Copy link

Added the following features

  1. TXT export
    • Material data can now be exported and saved locally by users in txt format.
    • Material data is neatly formatted and exported as a text file for users to download.
    • Apart from "Export by Trait", the application now supports "Export by Material" which exports material data from various traits to txt.
  2. JSON export
    • Material data can now be exported and saved locally by users in json format.
    • The existing json export was broken and not functional. Modified and cleaned code to make it functional.
    • Apart from "Export by Trait", the application now supports "Export by Material" which exports material data from various traits to json.
  3. Material privacy
  • Now materials can be marked private and they will only be visible to the owner and admin.
  • This is reflected throughout the application (View all materials, Search, Exports).
  1. New view for "Search by material"
  • Removed redundant tables and created a single neat table for displaying material data.
  • The new view displays material description, material type and trait units along with the table.
  1. New form in 'Add Trait' page for solving data inconsistency problem
    • Whenever a new trait was added under 'Add Trait' page, it resulted in an empty table with no values for existing materials. Only subsequently added materials have the input field under 'Add New Material' to store values for the newly added trait. This resulted in data inconsistency.
    • Added a new form in 'Add Trait' page to ask the user to enter values of the new trait for existing materials and store the values in the database.

Fixed the following bugs

  1. Allowing duplicate materials with different cases and underscores. CARBON, carbon, Carbon and Carbon_27, Carbon 27 are all treated as unique values. Added a mechanism to prevent this.
  2. Allowing numeric-only input for Material Names. For example, 1234 was an acceptable material name. Added a regex to validate the input. Since the shortest element name is 'tin', the material names should now have at least 3 letters in the beginning.
  3. Allowing numeric-only input for Trait Names. For example, 5678 was an acceptable trait name. Added a regex validation to prevent this. Trait names must now have at least 3 letters in the beginning.
  4. "Special Pages" rendered unusable. When the extension is deployed on Mediawiki, other special pages are rendered unusable. This was caused by materials_database.php which was loading a class and special page for a non-existent admin.php file. Removed the code that was loading them.
  5. Values for "Material type" (Metal, Non-metal, Fluid, etc) in "Add new material" page was simply displayed in HTML and not fetched from the database. Material types are now fetched from the database.
  6. JSON export was simply traversing for 5 materials and did not account for new materials since it was not fetched from the database. Materials count and required data is now fetched from database before exporting JSON data.

Miscellaneous

  • Trait type and unit are now shown above the trait tables in "View all materials", "Search by trait" and "Admin dashboard".
  • Help text is displayed next to the fields along with units in 'Add Material' page for better readability.
  • Help text is displayed next to the fields along with units in 'Add Trait' page for better readability.
  • All trait values are required and need to be entered for a material now (updated in 'Add Material' page).
  • All material values are required and need to be entered for a trait now (updated in 'Add Trait' page).
  • Changed default trait value column (for new traits) to decimal (20, 8) from varchar(64) to hold 20 integer and 8 fractional places.
  • Fixed formatting to capitalize first letter of material names in all tables and drop down lists.
  • Changed text from "Search trait by name" to "Search by Trait" in 'search_trait.php' for better readability.
  • Changed text from "Search trait to delete" to "Search by Material" for better readability.
  • Added link and icon for export-to-txt page (export_txt.php).
  • Updated materials_database.php to load class and special page for export-to-txt feature.
  • Updated README and added a detailed description on how to install the application.

1. Added a detailed description on how to install the application.

Specialmaterials_database.php:
1. Added a mechanism to prevent adding duplicates under "Add a New Material" page.
2. Added validation to prevent users from adding numeric-only input as Material Names. For example, 1234 was an acceptable material name.
   Used a regex to define the rules for validation. Since the shortest element name is 'tin', the material names should now have at least 3 letters in the beginning.

add_trait.php:
1. Added validation to prevent users from adding numeric-only input as Trait Names. For example, 5678 was an acceptable trait name.
   Used a regex to define the rules for validation. The trait names should now have at least 3 letters in the beginning.

materials_database.php:
1. Fixed the "Special Pages not viewable" issue. When the extension is deployed on Mediawiki, other special pages are rendered unusable.
   This was caused by materials_database.php which was loading a class and special page for a non-existent admin.php file.
    -Added a new feature - export to txt
    -Material data can now be exported and saved locally by users in txt format
    -Exporting can be done for each trait's material data and downloaded as a text file
2. add_trait.php
    -Solved data inconsistency issue by asking user to input material values every time a new trait is added
    -All material values are required and need to be entered for a material now
    -Help text is displayed next to the fields along with units for better readability
    -Changed default trait value column (for new traits) to decimal (20, 8) in - 20 to hold 20 real numbers and 8 decimal places

3. Specialmaterials_database.php
    -Formatted text for material names to display first letter as Caps (ucwords)
    -All trait values are required and need to be entered for a material now
    -Help text is displayed next to the input fields along with units for better readability

4. search_trait.php
    -Changed text from "Search trait by name" to "Search by Trait" for better readability

5. search_material.php
    -Changed text from "Search trait to delete" to "Search by Materail" for better readability
    -Added formatting to capitalize first letters of material names

6. materials_database.php
    -added special page and class to support export export_txt (export to txt) feature

7. navigation.php
    -added link and icon for export-to-ext page
    -Modified comment to be consistent with codebase (and HACKING standard)
    -Fixed json export
    -json export is now functional and material data can be exported and saved locally by users in the json format
    -Fixed formatting in material names under dropdown
    -Fixed exporting to json
    -json export is now functional and users can export material data and save data locally in json format
    -Fixed formatting to display material names better in drop down
@kkrcodes kkrcodes changed the title Fixed Duplicate Materials, Numeric-only inputs and Special Pages unusable issues and updated README Added TXT export, Fixed JSON export, Fixed data inconsistency issue, Fixed duplicate materials issue, Fixed numeric-only inputs issue and Special Pages unusable issue, Modified and added formatting for better readability and updated README for detailed installation instructions Mar 22, 2016
@kkrcodes kkrcodes changed the title Added TXT export, Fixed JSON export, Fixed data inconsistency issue, Fixed duplicate materials issue, Fixed numeric-only inputs issue and Special Pages unusable issue, Modified and added formatting for better readability and updated README for detailed installation instructions Added TXT export, Fixed JSON export, Fixed data inconsistency issue, Fixed duplicate materials issue, Fixed numeric-only inputs issue and Special Pages unusable issue, Modified and added formatting throughout the code for better readability and updated README for detailed installation instructions Mar 22, 2016
1. Material privacy - now materials can be marked private and they will only be visible to the owner and admin.
2. New view for "Search by material" - Removed redundant tables and created a single neat table for displaying material data. The new view displays material data, units, material description and material type along with the table.
3. Exports - JSON and TXT now also support - "Export by Material". Material data can also be exported now. (Earlier only trait data was exportable).

Bugs fixed:
1. Values for "Material type" (Metal, Non-metal, Fluid, etc) in "Add new material" page was simply displayed in HTML and not fetched from the database. Material types are now fetched from the database.
2. JSON export was simply traversing for 5 materials and did not account for new materials since it was not fetched from the database. Materials count and required data is now fetched from database before exporting JSON data.

Misc:
1. Trait type and unit are now shown above the trait tables in "View all materials",  "Search by trait" and "Admin dashboard".
@kkrcodes kkrcodes changed the title Added TXT export, Fixed JSON export, Fixed data inconsistency issue, Fixed duplicate materials issue, Fixed numeric-only inputs issue and Special Pages unusable issue, Modified and added formatting throughout the code for better readability and updated README for detailed installation instructions Added TXT export, JSON export, Export by Trait and Export by Material for both formats, Added Material privacy, New view for Materials, New form to fix data inconsistency issue, Fixed duplicate materials issue, Fixed numeric-only inputs issue and Special Pages unusable issue, Fixed Material types displayed using HTML (& not fetched from DB), Fixed JSON export limited to 5 materials issue, Modified and added formatting throughout the code for better readability and updated README for detailed installation instructions and made several other small fixes. Mar 29, 2016
@kkrcodes
Copy link
Author

Previous "Search by material" View

1

Updated "Search by material" View

1n


Previous "Add Trait" Page

2

Updated "Add Trait" Page

2n


"Export to txt" Page

3

Exported txt file from "Export by trait"

3_a


Exported txt file from "Export by material"

3_b


"Export to json" Page

4

Exported json file from "Export by trait"

4_a

Exported json file from "Export by material"

4_b


"View all materials" Page

5


"Search by trait" Page

6


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant