20#ifndef ORES_QT_ACCOUNT_DETAIL_DIALOG_HPP
21#define ORES_QT_ACCOUNT_DETAIL_DIALOG_HPP
27#include "ores.iam/domain/account.hpp"
28#include "ores.iam/domain/login_info.hpp"
29#include "ores.qt/ClientManager.hpp"
30#include "ores.qt/AccountRolesWidget.hpp"
31#include "ores.qt/DetailDialogBase.hpp"
32#include "ores.logging/make_logger.hpp"
37class AccountDetailDialog;
59 inline static std::string_view logger_name =
60 "ores.qt.account_detail_dialog";
62 [[nodiscard]]
static auto& lg() {
64 static auto instance = make_logger(logger_name);
73 void setUsername(
const std::string& username);
93 void setLoginInfo(
const std::optional<iam::domain::login_info>& loginInfo);
125 void setReadOnly(
bool readOnly,
int versionNumber = 0);
142 void accountUpdated(
const boost::uuids::uuid& account_id);
143 void accountCreated(
const boost::uuids::uuid& account_id);
144 void accountDeleted(
const boost::uuids::uuid& account_id);
145 void isDirtyChanged(
bool isDirty);
154 void onSaveClicked();
155 void onResetClicked();
156 void onDeleteClicked();
157 void onRevertClicked();
158 void onFieldChanged();
159 void updatePasswordMatchIndicator();
162 void updateSaveResetButtonState();
163 void setCreateMode(
bool createMode);
164 void setFieldsReadOnly(
bool readOnly);
165 bool validatePassword()
const;
168 std::unique_ptr<Ui::AccountDetailDialog> ui_;
173 int historicalVersion_;
174 std::string modifiedByUsername_;
176 QAction* saveAction_;
177 QAction* deleteAction_;
178 QAction* revertAction_;
182 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:35
Represents an account for an entity in the system.
Definition account.hpp:32
Dialog widget for creating and editing user accounts.
Definition AccountDetailDialog.hpp:55
iam::domain::account getAccount() const
Gets the current account state from the form.
Definition AccountDetailDialog.cpp:198
void revertRequested(const iam::domain::account &account)
Emitted when user requests to revert to the displayed historical version.
void markAsStale()
Mark the dialog data as stale.
Definition AccountDetailDialog.cpp:689
void setReadOnly(bool readOnly, int versionNumber=0)
Sets the dialog to read-only mode for viewing historical versions.
Definition AccountDetailDialog.cpp:633
void setAccount(const iam::domain::account &account)
Sets the account to display/edit.
Definition AccountDetailDialog.cpp:151
void save()
Saves the account (create or update).
Definition AccountDetailDialog.cpp:264
void setLoginInfo(const std::optional< iam::domain::login_info > &loginInfo)
Sets the login info to display (read-only).
Definition AccountDetailDialog.cpp:231
void clearDialog()
Clears all form fields and resets dialog state.
Definition AccountDetailDialog.cpp:207
QString accountId() const
Returns the account ID of the account being edited.
Definition AccountDetailDialog.cpp:703
Widget for managing roles assigned to an account.
Definition AccountRolesWidget.hpp:42
Manages the lifecycle of the network client and IO context.
Definition ClientManager.hpp:90
Base class for all detail dialogs.
Definition DetailDialogBase.hpp:54