-
Notifications
You must be signed in to change notification settings - Fork 44
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
refactor(web): use queries and TypeScript in storage components #1585
Conversation
Trello: https://trello.com/c/nV7mjrf9/ This is the first step towards adapting the storage code to use queries. As this part of the code is rather complex, we decided to move as many components as possible to TypeScript to have a kind of security net. ## What is included * Add a set of types from from our OpenAPI docs (see #1564) in `api/storage/types`. * Add a set of storage UI types in `types/storage`. We should unify the types, but let's do it later. * Define a new `api/storage` module moving big chunks of the `StorageClient` code. * Define a set of queries under `queries/storage`. * Adapt the `ProposalPage` component to use queries. It retrieves a lot of information that injects to nested components. * Convert `ProposalPage` and `InstallationDeviceField` to TypeScript. ## What is missing * As you may see, the front end is not building. That problems (and other subtle bugs) will be fixed as we adapt the rest of storage components to TypeScript. So a bunch of additional pull requests will follow. * Additionally, we are removing all those skeletons from the UI. We will use a unified mechanism.
* It is not needed as the parser correctly identifies those functions.
Let's merge `master` into the `storage-typescript` branch to avoid potential conflicts.
Follow-up of #1577. It adapts `BootSelection` and `SpacePolicySelection` to use queries.
* This component is not used anymore.
…2) (#1583) Continuation of #1577. It covers the conversion of the following components/modules: * `BootConfigField` * `device-utils` * `SpaceActionsTable` * `DeviceSelectorTable` * `EncryptionSettingsDialog` * `ProposalActionDialog` * `ProposalActionSummary` * `StoragePage` * `ProposalResultSection` * `ProposalTransactionalInfo` * `SpaceActionsTable`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a few questions and notes plus a console.log
leftover there.
I'll approve, feel free to merge it without needing another review if you don't introduce big changes.
Thank you for addressing this one!
@@ -71,6 +78,7 @@ export default function ProposalActionsDialog({ actions = [] }) { | |||
subvolActions.length, | |||
); | |||
|
|||
console.log(actions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debugging left over, I guess
/** | ||
* Hook that returns the product parameters (e.g., mount points). | ||
*/ | ||
const useProductParams = (options?: QueryHookOptions): ProductParams => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting... should it be here or in the software queries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO it belongs here. They are storage-related params that depend on the product.
* | ||
* @todo This conversion will not be needed after adapting Section to directly work with issues. | ||
* | ||
* @param {import("~/client/mixins").Issue} issue | ||
* @param {import("~/types/issues").Issue} issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if would be better to import types at the top of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this is a JavaScript file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right! I overlooked that tiny detail :P
Trello: https://trello.com/c/MsGbqiwA/ This is a follow-up of #1585 which adapts the iSCSI-related code to use queries instead of the regular Agama client. Additionally, it converts a good share of the code to TypeScript and adds some iSCSI tests, that were not included in the first version.
Prepare for releasing Agama 10· * #1263 * #1330 * #1407 * #1408 * #1410 * #1411 * #1412 * #1416 * #1417 * #1419 * #1420 * #1421 * #1422 * #1423 * #1424 * #1425 * #1428 * #1429 * #1430 * #1431 * #1432 * #1433 * #1436 * #1437 * #1438 * #1439 * #1440 * #1441 * #1443 * #1444 * #1445 * #1449 * #1450 * #1451 * #1452 * #1453 * #1454 * #1455 * #1456 * #1457 * #1459 * #1460 * #1462 * #1464 * #1465 * #1466 * #1467 * #1468 * #1469 * #1470 * #1471 * #1472 * #1473 * #1475 * #1476 * #1477 * #1478 * #1479 * #1480 * #1481 * #1482 * #1483 * #1484 * #1485 * #1486 * #1487 * #1488 * #1489 * #1491 * #1492 * #1493 * #1494 * #1496 * #1497 * #1498 * #1499 * #1500 * #1501 * #1502 * #1503 * #1504 * #1505 * #1506 * #1507 * #1508 * #1510 * #1511 * #1512 * #1513 * #1514 * #1515 * #1516 * #1517 * #1518 * #1519 * #1520 * #1522 * #1523 * #1524 * #1525 * #1526 * #1527 * #1528 * #1529 * #1530 * #1531 * #1532 * #1533 * #1534 * #1535 * #1536 * #1537 * #1540 * #1541 * #1543 * #1544 * #1545 * #1546 * #1547 * #1548 * #1549 * #1550 * #1552 * #1553 * #1554 * #1555 * #1556 * #1557 * #1558 * #1559 * #1560 * #1562 * #1563 * #1565 * #1566 * #1567 * #1568 * #1569 * #1570 * #1571 * #1572 * #1573 * #1574 * #1575 * #1576 * #1577 * #1578 * #1579 * #1580 * #1581 * #1583 * #1584 * #1585 * #1586 * #1587 * #1588 * #1589 * #1590 * #1591 * #1592 * #1593 * #1596 * #1597 * #1598 * #1600 * #1602 * #1605 * #1606 * #1607 * #1608 * #1610 * #1611 * #1612 * #1613 * #1614 * #1619 * #1620 * #1621
Merge the following pull requests into
master
: