20#ifndef ORES_QT_ACCOUNT_DETAIL_DIALOG_HPP
21#define ORES_QT_ACCOUNT_DETAIL_DIALOG_HPP
27#include "ores.iam.api/domain/account.hpp"
28#include "ores.iam.api/domain/login_info.hpp"
29#include "ores.qt/ClientManager.hpp"
30#include "ores.qt/AccountRolesWidget.hpp"
31#include "ores.qt/AccountPartiesWidget.hpp"
32#include "ores.qt/DetailDialogBase.hpp"
33#include "ores.logging/make_logger.hpp"
38class AccountDetailDialog;
60 inline static std::string_view logger_name =
61 "ores.qt.account_detail_dialog";
63 [[nodiscard]]
static auto& lg() {
65 static auto instance = make_logger(logger_name);
74 void setUsername(
const std::string& username);
94 void setLoginInfo(
const std::optional<iam::domain::login_info>& loginInfo);
126 void setReadOnly(
bool readOnly,
int versionNumber = 0);
143 void accountUpdated(
const boost::uuids::uuid& account_id);
144 void accountCreated(
const boost::uuids::uuid& account_id);
145 void accountDeleted(
const boost::uuids::uuid& account_id);
146 void isDirtyChanged(
bool isDirty);
161 void onSaveClicked();
162 void onResetClicked();
163 void onDeleteClicked();
164 void onRevertClicked();
165 void onFieldChanged();
168 void updateSaveResetButtonState();
169 void setCreateMode(
bool createMode);
170 void setFieldsReadOnly(
bool readOnly);
171 bool validatePassword()
const;
174 std::unique_ptr<Ui::AccountDetailDialog> ui_;
179 int historicalVersion_;
180 std::string modifiedByUsername_;
182 QAction* revertAction_;
186 std::optional<iam::domain::login_info> currentLoginInfo_;
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
Represents an account for an entity in the system.
Definition account.hpp:34
Dialog widget for creating and editing user accounts.
Definition AccountDetailDialog.hpp:56
iam::domain::account getAccount() const
Gets the current account state from the form.
Definition AccountDetailDialog.cpp:255
void revertRequested(const iam::domain::account &account)
Emitted when user requests to revert to the displayed historical version.
ProvenanceWidget * provenanceWidget() const override
Returns the promoted ProvenanceWidget (named "provenanceWidget" in .ui).
Definition AccountDetailDialog.cpp:190
bool hasUnsavedChanges() const override
Definition AccountDetailDialog.hpp:158
QTabWidget * tabWidget() const override
Returns the dialog's QTabWidget (named "tabWidget" in .ui).
Definition AccountDetailDialog.cpp:188
void markAsStale()
Mark the dialog data as stale.
Definition AccountDetailDialog.cpp:870
void setReadOnly(bool readOnly, int versionNumber=0)
Sets the dialog to read-only mode for viewing historical versions.
Definition AccountDetailDialog.cpp:813
void setAccount(const iam::domain::account &account)
Sets the account to display/edit.
Definition AccountDetailDialog.cpp:192
void save()
Saves the account (create or update).
Definition AccountDetailDialog.cpp:319
void setLoginInfo(const std::optional< iam::domain::login_info > &loginInfo)
Sets the login info to display (read-only).
Definition AccountDetailDialog.cpp:286
void clearDialog()
Clears all form fields and resets dialog state.
Definition AccountDetailDialog.cpp:264
QString accountId() const
Returns the account ID of the account being edited.
Definition AccountDetailDialog.cpp:884
QWidget * provenanceTab() const override
Returns the Provenance tab widget (named "provenanceTab" in .ui).
Definition AccountDetailDialog.cpp:189
Widget for managing parties assigned to an account.
Definition AccountPartiesWidget.hpp:48
Widget for managing roles assigned to an account.
Definition AccountRolesWidget.hpp:41
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:109
Base class for all detail dialogs.
Definition DetailDialogBase.hpp:74
Widget displaying the 6 standard record provenance fields.
Definition ProvenanceWidget.hpp:39