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

Implement list view for FTA trees and Systems #247

Closed
4 tasks done
blcham opened this issue Apr 11, 2024 · 30 comments · Fixed by #303
Closed
4 tasks done

Implement list view for FTA trees and Systems #247

blcham opened this issue Apr 11, 2024 · 30 comments · Fixed by #303
Assignees

Comments

@blcham
Copy link
Contributor

blcham commented Apr 11, 2024

image

A/C:

  • Systems screen have list view
  • FTA trees screen have list view and it is default option
  • it is possible to switch between list and titles view
  • it is described which columns of the table were not implemented due to missing data
@Kasmadei
Copy link
Collaborator

Kasmadei commented Apr 22, 2024

I am close to finish table. But i need to ask for some changes on backend side.
Current look with mock data is:

Image

Image

To get info about tree FE calls endpoint:
http://localhost:1235/fta-fmea/services/fta-fmea-server/systems/summaries
and
http://localhost:1235/fta-fmea/services/fta-fmea-server/faultTrees/summaries

Current response for "/systems" is:

{
    "@context": {
        "types": "@type",
        "components": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-part-component",
        "functions": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-function",
        "name": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/name",
        "uri": "@id",
        "failureModes": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-failure-mode"
    },
    "@graph": [
        {
            "uri": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/system/instance-196155154",
            "types": [
                "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/system",
                "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/item"
            ],
            "name": "acm1",
            "failureModes": [],
            "functions": [],
            "components": []
        }
    ]
} 

And for "/faultTrees" response is almost similar:

{
    "@context": {
        "types": "@type",
        "name": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/name",
        "uri": "@id"
    },
    "@graph": [
        {
            "uri": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/fault-tree/instance1443295929",
            "types": [
                "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/fault-tree"
            ],
            "name": "FC 1.1. Tlak v kabině fault event"
        },
        {
            "uri": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/fault-tree/instance22467827479333998578",
            "types": [
                "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/fault-tree"
            ],
            "name": "FC_1.3. Tlak v kabině fault event"
        }
    ]
}

@kostobog Can I ask to add the missing properties for both endpoints?
@blcham And another question, will the table for systems have exactly the same structure?

@blcham
Copy link
Contributor Author

blcham commented Apr 22, 2024

@blcham And another question, will the table for systems have exactly the same structure?

No, you can assume that there is "name" of the System, but that's all for now. The most important part to show now are FTA trees.

@blcham
Copy link
Contributor Author

blcham commented Apr 23, 2024

@kostobog please implement easier part of the table and create ticket to do the rest afterwards.

@blcham
Copy link
Contributor Author

blcham commented Apr 23, 2024

@Kasmadei I realized, that i forgot to update the image (i mentioned it on the meeting but did not update the screenshot):
image

@Kasmadei
Copy link
Collaborator

@blcham Is it correct, that there should be a dropdown with filter for all aircraft types ? So after i select some aircraft type, i'll see in table only aircrafts with selected type.

Image

@blcham
Copy link
Contributor Author

blcham commented Apr 26, 2024

Yes but it is not part of this ticket -- read in the screenshot "No need to do filtering yet". We do not need to do filtering nor adding fields that would realize filters there yet.

@Kasmadei
Copy link
Collaborator

@blcham I was thinking that you wanted to add some other changes in the table

@blcham
Copy link
Contributor Author

blcham commented Apr 29, 2024

Please do "docker-compose pull". There are new data to be shown in the list from this PR:
kbss-cvut/fta-fmea#84

image

Here is the list of newly added stuff:

  • system type
  • sub-system type
  • creation time
  • creator
  • last modified
  • last editor

@kostobog
Copy link
Collaborator

kostobog commented Apr 29, 2024

@Kasmadei @blcham
PR kbss-cvut/fta-fmea#85 adds failure rate related properties:

  • calculated failure rate,
  • FHA based failure rate and
  • required failure rate

@blcham
Copy link
Contributor Author

blcham commented Apr 30, 2024

@Kasmadei @blcham PR kbss-cvut/fta-fmea#85 adds failure rate related properties:

@Kasmadei make additional PR to include those fields there

@blcham
Copy link
Contributor Author

blcham commented Apr 30, 2024

Moreover, when I tried to run locally i got table from FTA page showing at System page:
image

Look into Figma about columns and comment it if we need to adjust it here or there.

@Kasmadei
Copy link
Collaborator

Kasmadei commented May 1, 2024

@kostobog Hi. I've received the following response from the endpoint:
GET http://localhost:1235/services/fta-fmea-server/faultTrees/summaries
It seems that there aren't enough new properties. Could you please check? ?

{
    "@context": {
        "types": "@type",
        "components": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-part-component",
        "system": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-artifact-of",
        "functions": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-function",
        "name": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/name",
        "subsystem": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/is-performed-by",
        "requiredFailureRate": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/required-failure-rate",
        "uri": "@id",
        "failureModes": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/has-failure-mode"
    },
    "@graph": [
        {
            "uri": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/fault-tree/instance1443295929",
            "types": [
                "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/named-entity",
                "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/managed-entity",
                "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/fault-tree"
            ],
            "requiredFailureRate": 4.0E-4,
            "name": "FC 1.1. Tlak v kabině fault event",
            "system": {
                "uri": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/system/instance510539860",
                "types": [
                    "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/system",
                    "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/item",
                    "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/named-entity",
                    "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/managed-entity"
                ],
                "name": "acm1",
                "failureModes": [],
                "functions": [],
                "components": []
            },
            "subsystem": {
                "uri": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/sns-component/instance-1061356481",
                "types": [
                    "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/item",
                    "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/named-entity",
                    "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/managed-entity"
                ],
                "name": "Pressurization control",
                "failureModes": [],
                "functions": [],
                "components": []
            }
        },
        {
            "uri": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/fault-tree/instance22467827479333998578",
            "types": [
                "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/named-entity",
                "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/managed-entity",
                "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/fault-tree"
            ],
            "requiredFailureRate": 0.003,
            "name": "FC_1.3. Tlak v kabině fault event",
            "system": {
                "uri": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/system/instance510539860",
                "types": [
                    "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/system",
                    "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/item",
                    "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/named-entity",
                    "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/managed-entity"
                ],
                "name": "acm1",
                "failureModes": [],
                "functions": [],
                "components": []
            },
            "subsystem": {
                "uri": "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/sns-component/instance-1061356481",
                "types": [
                    "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/item",
                    "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/named-entity",
                    "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/managed-entity"
                ],
                "name": "Pressurization control",
                "failureModes": [],
                "functions": [],
                "components": []
            }
        }
    ]
}

@kostobog
Copy link
Collaborator

kostobog commented May 3, 2024

@Kasmadei
Some of the properties are missing in the example. Specifically:

  • created, creator, last edited, last editor and calculated failure rate.

I am no sure why there is no FHA based failure rate. I will check today and let you know.

@Kasmadei
Copy link
Collaborator

Kasmadei commented May 6, 2024

@kostobog Hi, any updates ?

@blcham
Copy link
Contributor Author

blcham commented May 6, 2024

@Kasmadei please check data from backend most likely it is updated according to last @kostobog comment.

@blcham
Copy link
Contributor Author

blcham commented May 6, 2024

@Kasmadei please past here a picture which fields work.

@Kasmadei
Copy link
Collaborator

Kasmadei commented May 6, 2024

@blcham @kostobog looks like i don't have any trees from response, can you check it please?

GET
http://localhost:1235/services/fta-fmea-server/faultTrees/summaries
Response: {"@context":{},"@graph":[]}

I did a docker update with previously provided instruction:

  • make sure that fork akaene/fta-fmea-ui is synced with kbss-cvut/ftea-fmea-ui
  • cd fta-fmea-ui (assuming it is from akaene fork)
  • git pull
  • cd deploy/internal-auth
  • docker-compose pull
  • docker-compose down
  • docker-compose up

@blcham
Copy link
Contributor Author

blcham commented May 6, 2024

@Kasmadei following the steps above it worked for me. Did you get some error?

image

@Kasmadei
Copy link
Collaborator

Kasmadei commented May 7, 2024

@blcham Yes, and /systems works correct, i see the same as you, but for /faultTrees endpoint response is empty :/ In an hour i'll check it again

Edit: Tried from start and i see the same. Endpoint http://localhost:1235/services/fta-fmea-server/faultTrees/summaries has empty response.

@kostobog
Copy link
Collaborator

kostobog commented May 8, 2024

@blcham I tested running fta-fmea-ui/depoly/internal-auth and checked services/db-server. It seams that the import script does not work properly. I can see only one trig file is imported from the shared/db-server/import/fta-fmea/ava.

@Kasmadei
I updated the fields returned in the fault tree summary, for more details see #274 (#275 fixing error in the new example data) and kbss-cvut/fta-fmea#90 .

Now you should be able to get all fields necessary for the table except for status:

  • created
  • creator - should have uri and username
  • modified
  • lastEditor - should have uri and username
  • system (Aircraft type ) - there should be uri and name of the aircraft
  • subsystem (ATA) - there should be uri and name of the subsystem, the name is composed of the ATA code and the ATA name
  • calculatedFailureRate
  • requiredFailureRate
  • fhaBasedFailureRate

Here is a snippet of one of the summary of one of the fault trees:

calculatedFailureRate : 0.10005625498722481
created : "2024-04-01T10:45:00Z"
creator : {uri: "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/user/test-user-1",…}
	types : ["http://xmlns.com/foaf/0.1/Person"]
	uri:"http://onto.fel.cvut.cz/ontologies/fta-fmea-application/user/test-user-1"
	username:"test-user-1"
fhaBasedFailureRate : 0.01
lastEditor : {uri: "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/user/test-user-2",…}
	types : ["http://xmlns.com/foaf/0.1/Person"]
	uri : "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/user/test-user-2"
	username : "test-user-2"
name : "FC 1.1. Tlak v kabině fault event"
requiredFailureRate : 0.0004
subsystem : {uri: "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/sns-component/instance-1061356481",…}
	components : []
	failureModes : []
	functions : []
	name : "21-30-00 - Pressurization control"
	types : ["http://onto.fel.cvut.cz/ontologies/fta-fmea-application/item",…]
	uri : "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/sns-component/instance-1061356481"
system : {uri: "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/system/instance510539860",…}
	components : []
	failureModes : []
	functions : []
	name : "acm1"
	types : ["http://onto.fel.cvut.cz/ontologies/fta-fmea-application/system",…]
	uri : "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/system/instance510539860"
types : ["http://onto.fel.cvut.cz/ontologies/fta-fmea-application/named-entity",…]
uri : "http://onto.fel.cvut.cz/ontologies/fta-fmea-application/fault-tree/instance1443295929"

@kostobog
Copy link
Collaborator

kostobog commented May 9, 2024

@Kasmadei Until this issue #276 is resolved you can deploy the example data to db-server manually. To do so first run internal-auth as usual. Visit localhost:1235/services/db-server and follow the steps:

  1. select fta-fmea repository from the menu
  2. import data - in import page select the server files. To import a file click the import button. This will open the import dialog. In the dialog click import button. Import the following files:
  • for fta-fmea/ava/ava-fta-example-associated-with-fha-fault-event--anonymized.trig,
  • fta-fmea/ava/sns-partonomy-example--anonymized.trig and
  • fta-fmea/ava/user-example.trig.
  1. in the Explore menu, on the left under Import, click Graphs overview. If import was successful you should see the following graphs:

capture_240509_150301

@Kasmadei
Copy link
Collaborator

Kasmadei commented May 9, 2024

@kostobog Hi, tried your solution and for some reason i don't see fta-fmea/ava/user-example.trig file :(
Docker containers and akaene/fta-fmea-ui was synchronized with kbss.
Can i do/check something ?

Image

@blcham
Copy link
Contributor Author

blcham commented May 10, 2024

@Kasmadei

I think you forgot to do docker-compose build db-server, but anyway you do not need to import data manually anymore because the issue #276 was already solved.

Do the following steps:

  • make sure that fork akaene/fta-fmea-ui is synced with kbss-cvut/ftea-fmea-ui
  • cd fta-fmea-ui (assuming it is from akaene fork)
  • git pull
  • cd deploy/internal-auth
  • docker-compose pull
  • docker-compose build (added now)
  • docker-compose down
  • docker-compose up

@Kasmadei
Copy link
Collaborator

@blcham No, i did not forget about docker-compose build db-server, and it did not help. I'll try today again :)

@Kasmadei
Copy link
Collaborator

@blcham @kostobog BE updated without any issue, but response from endpoint is still empty:

Response: {"@context":{},"@graph":[]}

curl 'http://localhost:1235/services/fta-fmea-server/faultTrees/summaries'
-H 'Accept: application/json, text/plain, /'
-H 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8'
-H 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJkZXYiLCJyb2xlcyI6WyJST0xFX1VTRVIiXSwiaWF0IjoxNzE1MzU4NDYxLCJleHAiOjE3MTUzODcyNjF9.AzSTs4Z-66xYNw3JLTOAGz827gqAAiOZXSeEEwgxUvS4RhfS_BJ6Zlyj0uzHbjPlaJ4yLjxb4Udj7jb5IUJGDw'
-H 'Connection: keep-alive'
-H 'Origin: http://localhost:5173'
-H 'Referer: http://localhost:5173/'
-H 'Sec-Fetch-Dest: empty'
-H 'Sec-Fetch-Mode: cors'
-H 'Sec-Fetch-Site: same-site'
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36'
-H 'sec-ch-ua: "Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99"'
-H 'sec-ch-ua-mobile: ?0'
-H 'sec-ch-ua-platform: "macOS"'

@Kasmadei
Copy link
Collaborator

@blcham @kostobog FYI, it works good, i can keep going :)

@Kasmadei
Copy link
Collaborator

@blcham @kostobog New props added: #279
After i see more data and it length, feels like i'll need to do some minor visual changes in the table. In my screen (13') it can look a bit better.
I think only status props left.

@blcham
Copy link
Contributor Author

blcham commented May 12, 2024

The status will be implemented in the following issue: #280

The implementation needs to be checked, and if it is okay, we can close it.

@blcham
Copy link
Contributor Author

blcham commented May 12, 2024

@Kasmadei I see the following issues:

image

image

@Kasmadei
Copy link
Collaborator

After discussion we decided to add a new column for "created". I'll check how it will look with new column first.

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 a pull request may close this issue.

3 participants