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

Feat(listv2 as default) #74

Merged
merged 13 commits into from
Jan 22, 2025
1 change: 0 additions & 1 deletion .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ APPLICATION_ID_URI: 'api://mnestix-test-web-api/'
LOCK_TIMESERIES_PERIOD_FEATURE_FLAG: true
COMPARISON_FEATURE_FLAG: true
AAS_LIST_FEATURE_FLAG: true
AAS_LIST_V2_FEATURE_FLAG: false
TRANSFER_FEATURE_FLAG: false
AAS_REPO_API_URL: 'http://localhost:5064/repo'
SUBMODEL_REPO_API_URL: 'http://localhost:5064/repo'
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ implementation of standardized digital twins. It opens the way for use cases suc
You can find a demo [here](https://mnestix-prod.azurewebsites.net/).
Some screenshots can be found in the [screenshots folder](screenshots).

### **If you need support feel free to contact us through our website [here](https://xitaso.com/kompetenzen/mnestix/#support).**
### **If you need support feel free to contact us through our
website [here](https://xitaso.com/kompetenzen/mnestix/#support).**

## Quickstart

Expand Down Expand Up @@ -145,7 +146,8 @@ NEXTAUTH_SECRET: '<<YOUR_SECRET>>'
**Mnestix Browser on port 3000 - http://localhost:3000**
<br><br>

- **docker-compose/compose.frontend.yml** - runs Mnestix Browser with a Basyx environment (AAS-Environment with MongoDB, Discovery Service, AAS/Submodel Registry) but without the Mnestix-API.<br>
- **docker-compose/compose.frontend.yml** - runs Mnestix Browser with a Basyx environment (AAS-Environment with MongoDB,
Discovery Service, AAS/Submodel Registry) but without the Mnestix-API.<br>
**Mnestix Browser on port 3000 - http://localhost:3000**

- **docker-compose/compose.dev.yml** - override file to run Mnestix Browser in a development environment. A development
Expand Down Expand Up @@ -283,8 +285,7 @@ Mnestix provides the following configuration options. You can adapt the values i
| `AAS_REPO_API_URL` | | Default AAS Repository to display when AAS Id is not in AAS Registry | required |
| `SUBMODEL_REPO_API_URL` | | Default Submodel Repository to display when Submodel Id is not in Submodel Registry | required |
| `MNESTIX_BACKEND_API_URL` | | Mnestix Backend with a lot of business comfort features like the Repository-Proxy or the Template builder | optional |
| `AAS_LIST_FEATURE_FLAG` | false | Enables or disables the AasList in the frontend. This only works in combination with `Features__AllowRetrievingAllShellsAndSubmodels` being set to `true` (Needs the Mnestix Backend to work) | optional |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will adapt this in the wiki - did those changes already last week and forgot

| `AAS_LIST_V2_FEATURE_FLAG` | false | The functionality controlled by this flag is under active development and may change without notice. Please see [details](#aas-list-v2-feature-details) | optional |
| `AAS_LIST_FEATURE_FLAG` | true | Enables or disables the AasList in the frontend. This only works in combination with `Features__AllowRetrievingAllShellsAndSubmodels` being set to `true` | optional |
| `TRANSFER_FEATURE_FLAG` | false | Enables or disables the Transfer Feature in the frontend. If enabled, it is possible to import a viewed AAS to a configured repository. This feature is currently being developed. | optional |
| `AUTHENTICATION_FEATURE_FLAG` | false | Enable or disable the authentication in the frontend. (Needs the Mnestix Backend to work) | optional |
| `COMPARISON_FEATURE_FLAG` | false | Enables or disables the comparison feature. | optional |
Expand Down Expand Up @@ -419,7 +420,9 @@ MNESTIX_BACKEND_API_URL: '{{MNESTIX_BACKEND_API_URL}}'
This is the easiest configuration, for when you only want to visualize and browse through AAS.
If you choose to run the Mnestix Browser without the Mnestix API, the Feature Flags `AUTHENTICATION_FEATURE_FLAG`
and `AAS_LIST_FEATURE_FLAG` will be overwritten to `false` as these Features use the functionality of the API.
The other environment variables should be configured [as described](#frontend-configuration). If you want to run Mnestix Browser with an Basyx environment you can simply use the compose.frontend file which is described [here](#Docker-Compose-files).
The other environment variables should be configured [as described](#frontend-configuration). If you want to run Mnestix
Browser with an Basyx environment you can simply use the compose.frontend file which is
described [here](#Docker-Compose-files).

#### How to configure the BaSyx AAS Repository

Expand Down Expand Up @@ -733,4 +736,5 @@ For this purpose, issues which are particularly suitable for a first contributio
If this is your first time contributing to an eclipse project, we recommend having a look at this
guide: [Contributing to a Eclipse project](https://www.eclipse.org/contribute/).
We would be more than happy to have you on board. If there is anything you want to know, feel free to contact
us [mnestix@xitaso.com](mailto:mnestix@xitaso.com) or through our website [here](https://xitaso.com/kompetenzen/mnestix/#support).
us [mnestix@xitaso.com](mailto:mnestix@xitaso.com) or through our
website [here](https://xitaso.com/kompetenzen/mnestix/#support).
1 change: 0 additions & 1 deletion compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ services:
MNESTIX_BACKEND_API_URL: 'http://mnestix-api:5064'
MNESTIX_BACKEND_API_KEY: ${MNESTIX_BACKEND_API_KEY:-verySecureApiKey}
AAS_LIST_FEATURE_FLAG: "true"
AAS_LIST_V2_FEATURE_FLAG: "false"
TRANSFER_FEATURE_FLAG: "false"
COMPARISON_FEATURE_FLAG: "true"
AUTHENTICATION_FEATURE_FLAG: "false"
Expand Down
2 changes: 1 addition & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ export default defineConfig({
SUBMODEL_REPO_API_URL: 'http://localhost:5064/repo',
MNESTIX_BACKEND_API_URL: 'http://localhost:5064',
AAS_DISCOVERY_API_URL: 'http://localhost:5064/discovery',
MNESTIX_API_KEY: process.env.MNESTIX_BACKEND_API_KEY,
MNESTIX_API_KEY: 'verySecureApiKey',
},
});
2 changes: 1 addition & 1 deletion cypress/e2e/dnsRedirectTest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Test the DNS Redirect', function () {
cy.postTestAas();
});
it('Visits the "/asset/URLEncodedAssetID" page and gets redirected to the corresponding viewer page', function () {
cy.intercept({ method: 'POST', url: `/en/viewer/*` }).as('redirectedViewer');
cy.intercept({ method: 'POST', url: '/en/viewer/*' }).as('redirectedViewer');
let encodedUrl = encodeURIComponent(testAssetId);

cy.visit('/asset?assetId=' + encodedUrl);
Expand Down
115 changes: 49 additions & 66 deletions cypress/e2e/listAasPageTest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,77 +9,60 @@ describe('Test all Aas List features (Resolution 1920 x 1080)', function () {
cy.setResolution(resolutions[0]);
cy.visit('/list');
});
it('should redirect to aas list when pressing the aas list button on the homepage', function () {
cy.visit('/');
cy.getByTestId('aasList-Button-Home').click();
cy.url().should('contain', '/list');
});
it('should redirect to the viewer page when clicking on an aas list entry', function () {
cy.getByTestId('list-to-detailview-button').first().click();
cy.wait(100);
cy.url().should('contain', '/viewer/');
});
it('should show the selected aas in the comparison list and enable the button', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="selected-https://mnestix.io/aas/listTest1').should('exist');
cy.getByTestId('compare-button').should('not.be.disabled');
});
it('should remove the aas from the comparison list when deselected and disable the button', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="selected-https://mnestix.io/aas/listTest1').should('not.exist');
cy.getByTestId('compare-button').should('be.disabled');
});
it('should disable checkboxes and show a warning when the user tries to select more than 3 aas', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest3"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest4"]')
.findByTestId('list-checkbox')
.parent()
.click();
cy.get('.MuiAlert-root').should('exist');
});
it('should redirect to the comparison page when one aas is selected and button is pressed', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.getByTestId('compare-button').click();
cy.wait(100);
cy.url().should('contain', '/compare');
});
it('should filter the aas list when a product class is selected', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox');

cy.getByTestId('product-class-select').click();
cy.getByTestId('product-class-select-Actuator').click();

it('should load the first list page of the default repository and display the data', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]')
.findByTestId('product-class-chip')
.contains('Actuator');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]').should('not.exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest3"]').should('not.exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest4"]').should('not.exist');
});
it('should update the filtered aas list when another product class is selected', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox');

cy.getByTestId('product-class-select').click();
cy.getByTestId('product-class-select-Control-system').click();
.findByTestId('list-aasId')
.contains('https://mnestix.io/aas/listTest1');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]')
.findByTestId('list-assetId')
.contains('https://mnestix.io/listTest1');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]')
.findByTestId('list-manufacturer-name')
.contains('listTest1 Manufacturer Name');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]')
.findByTestId('list-product-designation')
.contains('listTest1 Product Designation');

cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').should('not.exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]').should('exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest3"]').should('not.exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest4"]').should('not.exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]')
.findByTestId('list-aasId')
.contains('https://mnestix.io/aas/listTest2');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]')
.findByTestId('list-assetId')
.contains('https://mnestix.io/listTest2');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]')
.findByTestId('list-manufacturer-name')
.contains('listTest2 Manufacturer Name');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]')
.findByTestId('list-product-designation')
.contains('listTest2 Product Designation');
});
it('should show the full aas list when the product class is reset', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox');

cy.getByTestId('product-class-select').click();
cy.getByTestId('product-class-select-all').click();

cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').should('exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]').should('exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest3"]').should('exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest4"]').should('exist');
describe('comparison list', function () {
it('should show the selected aas in the comparison list, and comparison button redirects to comparison', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="selected-https://mnestix.io/aas/listTest1').should('exist');
cy.getByTestId('compare-button').should('not.be.disabled');
cy.getByTestId('compare-button').click();
cy.wait(100);
cy.url().should('contain', '/compare');
});
it('should remove the aas from the comparison list when deselected and disable the button', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="selected-https://mnestix.io/aas/listTest1').should('not.exist');
cy.getByTestId('compare-button').should('be.disabled');
});
it('should disable checkboxes and show a warning when the user tries to select more than 3 aas', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest3"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest4"]')
.findByTestId('list-checkbox')
.parent()
.click();
cy.get('.MuiAlert-root').should('exist');
});
});

after(function () {
Expand Down
166 changes: 81 additions & 85 deletions cypress/fixtures/cypress_e2e/AasListMockData/cyListAasMockData.json
Original file line number Diff line number Diff line change
@@ -1,90 +1,86 @@
[
{
"modelType": "AssetAdministrationShell",
"assetInformation": {
"assetKind": "Instance",
"globalAssetId": "https://mnestix.io/listTest1",
"specificAssetIds": [
{
"name": "assetIdShort",
"value": "testElement_1"
}
]
},
"id": "https://mnestix.io/aas/listTest1",
"idShort": "aas_cypressTest1",

"submodels": [
{
"keys": [
{
"type": "Submodel",
"value": "https://mnestix.io/sm/aHR0cHM6Ly9hYXMyLnVuaS1oLmRlL2Fhcy9sbmkwNzI6_TD"
}
],
"type": "ModelReference"
}
]
{
"modelType": "AssetAdministrationShell",
"assetInformation": {
"assetKind": "Instance",
"globalAssetId": "https://mnestix.io/listTest1",
"specificAssetIds": [
{
"name": "assetIdShort",
"value": "testElement_1"
}
]
},
{
"modelType": "AssetAdministrationShell",
"assetInformation": {
"assetKind": "Instance",
"globalAssetId": "https://mnestix.io/listTest2",
"specificAssetIds": [
{
"name": "assetIdShort",
"value": "testElement_2"
}
]
},
"id": "https://mnestix.io/aas/listTest2",
"idShort": "aas_cypressTest2",

"submodels": [
{
"keys": [
{
"type": "Submodel",
"value": "https://mnestix.io/sm/aHR0cHM6Ly9hYXMyLnVuaS1oLmRlL2Fhcy9sbmkwNzI4_TD"
}
],
"type": "ModelReference"
}
]
"id": "https://mnestix.io/aas/listTest1",
"idShort": "aas_cypressTest1",
"submodels": [
{
"keys": [
{
"type": "Submodel",
"value": "https://i40.xitaso.com/sm/nameplateListTest1"
}
],
"type": "ModelReference"
}
]
},
{
"modelType": "AssetAdministrationShell",
"assetInformation": {
"assetKind": "Instance",
"globalAssetId": "https://mnestix.io/listTest2",
"specificAssetIds": [
{
"name": "assetIdShort",
"value": "testElement_2"
}
]
},
{
"modelType": "AssetAdministrationShell",
"assetInformation": {
"assetKind": "Instance",
"globalAssetId": "https://mnestix.io/listTest3",
"specificAssetIds": [
{
"name": "assetIdShort",
"value": "testElement_3"
}
]
},
"id": "https://mnestix.io/aas/listTest3",
"idShort": "aas_cypressTest3",

"submodels": []
"id": "https://mnestix.io/aas/listTest2",
"idShort": "aas_cypressTest2",
"submodels": [
{
"keys": [
{
"type": "Submodel",
"value": "https://i40.xitaso.com/sm/nameplateListTest2"
}
],
"type": "ModelReference"
}
]
},
{
"modelType": "AssetAdministrationShell",
"assetInformation": {
"assetKind": "Instance",
"globalAssetId": "https://mnestix.io/listTest3",
"specificAssetIds": [
{
"name": "assetIdShort",
"value": "testElement_3"
}
]
},
{
"modelType": "AssetAdministrationShell",
"assetInformation": {
"assetKind": "Instance",
"globalAssetId": "https://mnestix.io/listTest4",
"specificAssetIds": [
{
"name": "assetIdShort",
"value": "testElement_4"
}
]
},
"id": "https://mnestix.io/aas/listTest4",
"idShort": "aas_cypressTest4",

"submodels": []
}
"id": "https://mnestix.io/aas/listTest3",
"idShort": "aas_cypressTest3",
"submodels": []
},
{
"modelType": "AssetAdministrationShell",
"assetInformation": {
"assetKind": "Instance",
"globalAssetId": "https://mnestix.io/listTest4",
"specificAssetIds": [
{
"name": "assetIdShort",
"value": "testElement_4"
}
]
},
"id": "https://mnestix.io/aas/listTest4",
"idShort": "aas_cypressTest4",
"submodels": []
}
]
Loading
Loading