fix a few bugs and design a few new tasks - still can't process updates correctly yet

This commit is contained in:
Michael Becker 2024-01-09 02:31:47 -05:00
parent 70ce315f51
commit 0ed89261fd
19 changed files with 257 additions and 50 deletions

View File

@ -65,6 +65,17 @@
- IDA_OpenInNewWindow: '{4a211f11-c5c3-4b58-a7f4-ed62538c5a3d}'
- IDA_LongRunning: '{c03aa999-83bc-49db-a27e-70fee477b9fb}'
- IDA_SuppressRIHints: '{43328aec-6a5d-4955-8d04-a96dcf98ab02}'
- IDA_ShowSpreadsheetButtonOnSelection: '{0ace468d-6d5d-4efd-b59d-2e587ea9f6cf}'
- IDA_PasswordRules: '{60c3f4c8-4f94-4c2a-8709-848644b61284}'
- IDA_EmailAddress: '{61113621-77aa-456d-839b-1c53b32f3d84}'
- IDA_NotificationEmailAddress: '{eb84ca5c-b238-4ca4-adcd-6a5076800bb9}'
- IDA_GenerateRandomPassword: '{a6b3a5be-313c-4588-92f8-09da0b195f1d}'
- IDA_NewPassword: '{a52a27c4-8568-4301-8714-b2f01fb38a15}'
- IDA_VerifyNewPassword: '{852e2102-33a0-49e2-bcfd-c126f543248c}'
- IDA_RequireChangePasswordAtNextSignIn: '{a2480234-87b7-4958-a4b9-3781865c636b}'
- IDA_ResetChallengeQuestions: '{4d7554cc-2061-4516-be42-8ccb1b4a0e29}'
- IDA_AccountDisabled: '{0b8f2ca3-f558-4a69-a8b0-de548914dc27}'
- IDA_GivenName: '{94a3ab09-3db7-4207-9e66-9526eb738669}'
- IDA_FamilyName: '{b84f602d-6bfc-4898-9d44-4d49af44cbb4}'

View File

@ -8,4 +8,6 @@
- IDI_Task_ShowDefinitionInCodeEditor: '{4f8a0e8e-e139-4cc6-b8cf-a32e67bd192d}'
- IDI_Task_DeleteInstance: '{276c5933-89a9-4a22-8fe3-cd9fda5377a8}'
- IDI_Task_ViewIntegrationIDs: '{8a2a0ef3-a145-4026-9c55-4d0133eff929}'
- IDI_SequenceTask_ViewSystemUser: '{5fd32c2b-7169-4db7-9379-6d8cb479c60e}'
- IDI_SequenceTask_ViewSystemUser: '{5fd32c2b-7169-4db7-9379-6d8cb479c60e}'
- IDI_SequenceTask_EditSystemUser: '{4d4536c9-4afb-4f42-b7a6-e0eaef5c93bf}'
- IDI_SequenceTask_ManageSystemUserCredentials: '{2cab9794-397a-4d59-b61d-9b7f97ed297a}'

View File

@ -1,3 +1,4 @@
- entityDefinitions:
- IDI_WorkSet_ClassForEditClassTask: '{b56ac9b9-efce-4a40-8c04-ffdf90174285}'
- IDI_WorkSet_PreferredDisplayName: '{86149123-6d32-4f48-b128-8f773cdb2b0e}'
- IDI_WorkSet_PreferredDisplayName: '{86149123-6d32-4f48-b128-8f773cdb2b0e}'
- IDI_WorkSet_RelatedInstance: '{d9634929-0bb4-482a-85cc-9c8f1251556f}'

View File

@ -88,6 +88,24 @@
- textAttribute: '&IDA_CSSValue;'
index: 57
- textAttribute: '&IDA_NewPassword;'
name: 'New Password'
index: 84
- textAttribute: '&IDA_VerifyNewPassword;'
name: 'Verify New Password'
index: 91
- textAttribute: '&IDA_EmailAddress;'
name: 'Email Address'
index: 160
- textAttribute: '&IDA_NotificationEmailAddress;'
name: 'Email Address for Notifications'
- textAttribute: '&IDA_PasswordRules;'
name: 'Password Rules'
value: 'Your new password must not be the same as your current password or user name.'
- textAttribute: '&IDA_GivenName;'
name: 'Given Name'
- textAttribute: '&IDA_FamilyName;'

View File

@ -6,6 +6,9 @@
inherits: '&IDC_Attribute;'
name: Boolean Attribute
index: 5
attributes:
- instance: '&IDA_Name;'
customTagName: 'name'
# YAML definition for Instances of Boolean Attribute, 1$5
instances:
- instance: '&IDA_Singular;'
@ -77,4 +80,17 @@
- instance: '&IDA_SuppressRIHints;'
name: Suppress RI Hints
index: 24
- instance: '&IDA_ShowSpreadsheetButtonOnSelection;'
index: 27
- instance: '&IDA_RequireChangePasswordAtNextSignIn;'
name: Require Password Change At Next Sign In
index: 112
- instance: '&IDA_ResetChallengeQuestions;'
name: Reset Challenge Questions
index: 113
- instance: '&IDA_AccountDisabled;'
name: Account Disabled
index: 114
- instance: '&IDA_GenerateRandomPassword;'
name: Generate Random Password
index: 115

View File

@ -27,3 +27,6 @@
destinationClassId: '&IDC_WorkSet;'
siblingRelationshipId: '&IDR_Work_Set__has_valid__Class;'
singular: no
- workSet: '&IDI_WorkSet_RelatedInstance;'
name: 'Related Instance'

View File

@ -21,6 +21,8 @@
customTagNameCreatesInstanceOf: '&IDC_PersonName;'
relatedTasks:
- instance: '&IDI_SequenceTask_ViewSystemUser;'
- instance: '&IDI_SequenceTask_EditSystemUser;'
- instance: '&IDI_SequenceTask_ManageSystemUserCredentials;'
- class: '&IDC_UserLogin;'
name: System Account Signon

View File

@ -14,6 +14,6 @@
- instance: '&IDR_Task__has__Task_Category;'
customTagName: 'taskCategory'
- hardcodedTask: '&IDI_Task_ViewElementContent;'
name: 'View Element Content'
className: 'Mocha\\UI\\Tasks\\ViewElementContent'
# - hardcodedTask: '&IDI_Task_ViewElementContent;'
# name: 'View Element Content'
# className: 'Mocha\\UI\\Tasks\\ViewElementContent'

View File

@ -20,19 +20,29 @@
relationships:
- instance: '&IDR_Task__has_initiating__Element;'
customTagName: initiatingElementId
customTagName: initiatingElement
- instance: '&IDR_Task__has__Task_Category;'
customTagName: taskCategory
- sequenceTask: '&IDI_Task_ViewElementContent;'
name: 'View Element Content'
schedulable: no
longRunning: no
suppressRIHints: no
stepName: View Element Content
showSpreadsheetButtonOnSelection: no
taskCategory: '&IDI_TaskCategory_Element;'
initiatingElement: '{e68bb6c4-29eb-4c77-908a-1b3793c952bc}'
- sequenceTask: '&IDI_Task_ViewElement;'
name: 'View Element'
schedulable: no
longRunning: no
suppressRIHints: no
stepName: View Element
showSpreadsheetButonOnSelection: no
showSpreadsheetButtonOnSelection: no
taskCategory: '&IDI_TaskCategory_Element;'
initiatingElementId: '&IDE_ElementStart;'
initiatingElement: '&IDE_ElementStart;'
- element: '&IDE_ElementStart;'
name: 'Element Start'

View File

@ -17,11 +17,14 @@
label: 'Edit Class'
value:
- taskId: '{9dbdb202-e9f8-49ca-bbc2-0b63df651246}'
- instance: '{946f14a7-559f-4f6f-ae47-cbcad1523ad5}'
- instance: '{8c69fd8c-28fa-4f3c-a283-5d0006c1027d}'
- instance: '{535b1507-68ed-4981-8cd4-e8e843a24916}'
- instance: '{d74123b5-9fde-4c2a-bd28-8cd00ce86734}'
- instance: '{d5653b81-a5e2-4f77-92f8-bcbae09f0d71}'
- instance: '{946f14a7-559f-4f6f-ae47-cbcad1523ad5}'
#!FIXME: implement sorting by the Order attribute (on the BEM / BEM Process)
#! : `uses order Executable returning Attribute` => `Element Content`@get Order (GA)*P[ramb] )
- class: '{cce471d6-5fe7-4202-b678-9fcab20fd864}'
name: 'Element Tests Testing Class 1'
@ -166,18 +169,18 @@
displayOptions:
- instance: '&IDI_DisplayOption_NotEnterable;'
- elementContent: '{d5653b81-a5e2-4f77-92f8-bcbae09f0d71}'
- elementContent: '{946f14a7-559f-4f6f-ae47-cbcad1523ad5}'
order: 'e'
label: 'Users On This SUV'
defaultDataType: '&IDE_UserList;'
builtFromBEMProcess: '&IDBEMP_UserList;'
displayOptions:
- instance: '&IDI_DisplayOption_NotEnterable;'
- elementContent: '{d5653b81-a5e2-4f77-92f8-bcbae09f0d71}'
order: 'f'
label: 'Test Horizontal EC with Grid Layout'
defaultDataType: '{0f95606c-3653-4e40-af4e-34c501b669af}'
builtFromBEMProcess: '{d1326df7-d897-46de-bad1-4d1e6f85b042}'
# displayOptions:
# - instance: '&IDI_DisplayOption_Required;'
- elementContent: '{946f14a7-559f-4f6f-ae47-cbcad1523ad5}'
order: 'f'
label: 'Users On This SUV'
defaultDataType: '&IDE_UserList;'
builtFromBEMProcess: '&IDBEMP_UserList;'
displayOptions:
- instance: '&IDI_DisplayOption_NotEnterable;'

View File

@ -0,0 +1,7 @@
- library: '&IDL_MochaBaseSystem;'
instances:
- sequenceTask: '&IDI_SequenceTask_EditSystemUser;'
name: 'Edit System User'
initiatingElement: '{14e32ff2-1dd7-44d7-ab21-4c96b213a1ca}'
taskCategory: '&IDI_TaskCategory_SystemUser;'

View File

@ -0,0 +1,45 @@
- library: '&IDL_MochaBaseSystem;'
instances:
- sequenceTask: '&IDI_SequenceTask_ManageSystemUserCredentials;'
name: 'Manage System User Credentials'
initiatingElement: '{aae999d6-60c4-4357-b1b6-dd0f3375358a}'
taskCategory: '&IDI_TaskCategory_SystemUser;'
- element: '{aae999d6-60c4-4357-b1b6-dd0f3375358a}'
name: 'manage system account credentials'
elementContents:
- globalIdentifier: '{a1802e75-64f2-4de0-a036-b7069137e3c1}'
defaultDataType: '{9c65b684-ad62-495a-a690-5aa5fc26bebc}'
displayOptions:
- instance: '&IDI_DisplayOption_Singular;'
- instance: '&IDI_DisplayOption_ShowSubelementsVertically;'
- element: '{9c65b684-ad62-495a-a690-5aa5fc26bebc}'
name: 'manage system account credentials edits'
elementContents:
- globalIdentifier: '{a6360087-3a18-4648-9e3a-e62da002191f}'
defaultDataType: '&IDA_PasswordRules;'
displayOptions:
- instance: '&IDI_DisplayOption_NotEnterable;'
- globalIdentifier: '{da407cd2-e390-489d-90f0-f2a6ab336e0c}'
defaultDataType: '&IDC_User;'
displayOptions:
- instance: '&IDI_DisplayOption_NotEnterable;'
- globalIdentifier: '{15969a7d-4313-4d80-97e2-5335fbc16b2b}'
defaultDataType: '&IDA_EmailAddress;'
- globalIdentifier: '{862b454f-c84a-439e-8a2b-6d841aae158a}'
defaultDataType: '&IDA_GenerateRandomPassword;'
- globalIdentifier: '{65b01825-c4f8-4e48-89ee-be42806b109d}'
defaultDataType: '&IDA_NewPassword;'
displayOptions:
- instance: '&IDI_DisplayOption_ObscuredText;'
- globalIdentifier: '{f68d0b17-6bd7-439d-8fd2-2f7afee73b7f}'
defaultDataType: '&IDA_VerifyNewPassword;'
displayOptions:
- instance: '&IDI_DisplayOption_ObscuredText;'
- globalIdentifier: '{15a23713-2ddc-47d2-8758-cd17e04ad4f9}'
defaultDataType: '&IDA_RequireChangePasswordAtNextSignIn;'
- globalIdentifier: '{bc72543d-c3a1-40ce-b10a-c641d13028f4}'
defaultDataType: '&IDA_ResetChallengeQuestions;'
- globalIdentifier: '{033b8c46-567a-499f-a1bf-c0bdd5709374}'
defaultDataType: '&IDA_AccountDisabled;'

View File

@ -4,7 +4,7 @@
index: 312
name: 'Test Method Binding'
initialElement: '{2696449c-a517-48cc-9348-03abca291cf0}'
initiatingElement: '{2696449c-a517-48cc-9348-03abca291cf0}'
- element: '{2696449c-a517-48cc-9348-03abca291cf0}'
elementContents:

View File

@ -2,7 +2,7 @@
instances:
- sequenceTask: '&IDI_SequenceTask_ViewSystemUser;'
name: 'View System User'
initialElement: '{14e32ff2-1dd7-44d7-ab21-4c96b213a1ca}'
initiatingElement: '{14e32ff2-1dd7-44d7-ab21-4c96b213a1ca}'
taskCategory: '&IDI_TaskCategory_SystemUser;'
- element: '{14e32ff2-1dd7-44d7-ab21-4c96b213a1ca}'

View File

@ -164,7 +164,10 @@
$parentClass = $oms->getParentClass($task);
if ($parentClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::SequenceTask)))
{
echo("Sequence Task not done yet!");
$initiatingElement = $oms->getRelatedInstance($task, KnownRelationshipGuids::Task__has_initiating__Element);
$DO_Singular = $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__Singular);
$this->renderElement($initiatingElement, [ $DO_Singular ]);
}
else if ($parentClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::HardcodedTask)))
{
@ -186,7 +189,8 @@
$pc = $oms->getParentClass($value);
if ($pc->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::Element)))
{
$this->renderInitialElement($value);
$DO_Singular = $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__Singular);
$this->renderElement($value, [ $DO_Singular ]);
}
}
else if (is_string($value))
@ -203,6 +207,7 @@
{
echo ("could not find task executor for task type `" . $oms->getInstanceText($parentClass) . "`, " . $parentClass->InstanceKey . " " . $parentClass->GlobalIdentifier);
}
$this->renderEndForm();
$this->renderEndPage();
}
@ -544,7 +549,7 @@
return $str;
}
public function renderElementContent(InstanceReference $elementContent, InstanceReference $relatedInstanceParm = null)
public function renderElementContent(InstanceReference $elementContent)
{
/**
* @var MySQLDatabaseOms
@ -640,7 +645,11 @@
// Executable returning Attribute
else if ($oms->is_a($ecInst, KnownClassGuids::TextAttribute))
{
$this->renderExecutableReturningAttribute($elementContent, $ecInst, $relatedInstance, $relatedInstanceParm);
$this->renderExecutableReturningAttribute($elementContent, $ecInst, $relatedInstance);
}
else if ($oms->is_a($ecInst, KnownClassGuids::BooleanAttribute))
{
$this->renderExecutableReturningAttribute($elementContent, $ecInst, $relatedInstance);
}
// Executable returning Attribute
else if ($oms->is_a($ecInst, KnownClassGuids::ReturnAttributeMethodBinding))
@ -654,13 +663,21 @@
}
else if ($oms->is_a($ecInst, KnownClassGuids::Clasz))
{
$targetInstance = $relatedInstanceParm;
if ($targetInstance === null)
$targetInstance = $ecInst;
if ($this->Context !== null)
{
$targetInstance = $ecInst;
$targetInstance = $this->Context->getWorkData($ecInst);
}
if ($targetInstance !== null)
{
$adw = new InstanceBrowser(array($targetInstance));
$adw->Render();
}
else
{
echo ("<span class=\"uwt-disabled\">(empty)</span>");
}
$adw = new InstanceBrowser(array($targetInstance));
$adw->Render();
}
else
{
@ -674,7 +691,7 @@
}
}
public function renderExecutableReturningAttribute(InstanceReference $elementContent, InstanceReference $ecInst, ?InstanceReference $relatedInstance, ?InstanceReference $relatedInstanceParm)
public function renderExecutableReturningAttribute(InstanceReference $elementContent, InstanceReference $ecInst, ?InstanceReference $relatedInstance)
{
/**
* @var MySQLDatabaseOms
@ -685,10 +702,6 @@
// fill in the value from the target instance
$targetInstance = $relatedInstance;
if ($relatedInstanceParm !== null)
{
$targetInstance = $relatedInstanceParm;
}
if ($targetInstance === null)
{
$targetInstance = $this->TargetInstance;
@ -720,7 +733,14 @@
}
else
{
$this->renderTextAttributeEC($elementContent, $ecInst, $oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ObscuredText)), $value);
if ($oms->is_a($ecInst, KnownClassGuids::TextAttribute))
{
$this->renderTextAttributeEC($elementContent, $ecInst, $oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ObscuredText)), $value);
}
else if ($oms->is_a($ecInst, KnownClassGuids::BooleanAttribute))
{
$this->renderBooleanAttributeEC($elementContent, $ecInst, $oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ObscuredText)), $value);
}
}
}
@ -773,6 +793,49 @@
$p->Render();
}
public function renderBooleanAttributeEC(InstanceReference $ec, InstanceReference $inst, $password = false, $value = null)
{
/**
* @var MySQLDatabaseOms
*/
$oms = mocha_get_oms();
$displayOptions = $oms->getRelatedInstances($ec, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Element_Content_Display_Option));
$ecid = $ec->InstanceKey;
$p = new \Phast\WebControl();
$p->TagName = "input";
$p->ClientID = "ec_" . $ecid;
$p->Attributes[] = new \Phast\WebControlAttribute("name", "ec_" . $ecid);
$p->Attributes[] = new \Phast\WebControlAttribute("data-ecid", $ecid);
$p->Attributes[] = new \Phast\WebControlAttribute("value", $value);
$p->Attributes[] = new \Phast\WebControlAttribute("type", "checkbox");
if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__Required)))
{
$p->ClassList[] = "uwt-required";
}
if ($this->IsPostback && $oms->instanceSetContains($this->FailedValidationElements, $ec))
{
$p->ClassList[] = "uwt-failed-validation";
}
$maxLength = $inst->getAttributeValue(KnownAttributeGuids::MaximumLength);
if ($maxLength !== null)
{
$p->Attributes[] = new \Phast\WebControlAttribute("maxlength", $maxLength);
}
$p->HasContent = false;
$attType = new \Phast\WebControlAttribute("type", "text");
if ($password)
{
$attType->Value = "password";
}
$p->Attributes[] = $attType;
$p->Render();
}
public function renderArray(?array $array, string $separator, string $prefix = "", string $suffix = "")
{
if ($array === null)
@ -874,6 +937,8 @@ MSG_EOF);
{
$this->renderTopNavigationBar();
}
echo("<form method=\"POST\">");
}
public function renderEndPage()
{
@ -935,18 +1000,23 @@ MSG_EOF);
}
echo("</div>");
}
echo("<form method=\"POST\">");
$DO_Singular = $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__Singular);
$this->renderElement($element, [ $DO_Singular ]);
echo("<div class=\"uwt-page-footer\">");
echo ("<input class=\"uwt-button uwt-color-primary\" type=\"submit\" value=\"" . $this->SubmitButtonText . "\" />");
echo("</div>");
$this->renderEndForm();
$this->renderEndPage();
}
private function renderEndForm()
{
echo("<div class=\"uwt-page-footer\">");
// echo ("<a class=\"uwt-button\" href=\"#\" onclick=\"history.back(); return false;\">Cancel</a>");
echo ("<a class=\"uwt-button\" href=\"" . System::ExpandRelativePath("~~/" . System::GetTenantName()) . "\" " . /* onclick=\"history.back(); return false;\" */ ">Cancel</a>");
echo ("<input class=\"uwt-button uwt-color-primary\" type=\"submit\" value=\"" . $this->SubmitButtonText . "\" />");
echo("</div>");
}
public function logRequestSuccess(float $elapsedTime)
{
echo("\n<!--\nSUCCESS!\n\n" .
@ -1218,7 +1288,10 @@ MSG_EOF);
for ($i = 0; $i < $rowCount; $i++)
{
$rowInst = $instances[$i];
$this->Context->setWorkData($oms->normalizeInstanceReference(KnownInstanceGuids::WorkSet__RelatedInstance), $rowInst);
$this->Context->setWorkData($oms->getParentClass($rowInst), $rowInst);
$this->renderBeginTag("tr", [ ], [ "uwt-listview-item" ]);
//$this->renderBeginTag("div", [ ], [ "uwt-listview-item" ]);
foreach ($contents as $content)
@ -1227,7 +1300,9 @@ MSG_EOF);
{
$this->renderBeginTag("td");
//$this->renderBeginTag("div", [], [ "mcx-elementcontent", "uwt-listview-item-column" ]);
$this->renderElementContent($content, $rowInst);
$this->renderElementContent($content);
//$this->renderEndTag("div");
$this->renderEndTag("td");
}

View File

@ -1,14 +1,14 @@
div.CheckBox
div.uwt-checkbox
{
background-color: #FFFFFF;
border: solid 1px #AAAAAA;
&:hover, &.Hover, &.Checked
&:hover, &.Hover, &.uwt-checked
{
border-color: @ThemeColor;
}
&.Checked
&.uwt-checked
{
background-color: @ThemeColor;
color: #FFFFFF;

View File

@ -4,6 +4,7 @@ div.uwt-checkbox
width: 22px;
height: 22px;
vertical-align: middle;
background-color: #fff;
border: 2px solid #ddd;
margin-right: 4px;
}

View File

@ -1,13 +1,25 @@
.uwt-button:not(.uwt-toolbar > .uwt-button)
{
background-color: #9c6516;
border-color: #804b00;
&:not(.uwt-color-primary)
{
background-color: var(--uwt-color-light);
color: var(--uwt-color-dark);
}
border: 1px solid var(--uwt-color-dark);
border-radius: 24px;
color: #ffffff;
&.uwt-color-primary
{
background-color: #9c6516;
border-color: #804b00;
}
&:hover
{
background-color: #dea147;
border-color: #9c6516;
&.uwt-color-primary
{
background-color: #dea147;
border-color: #9c6516;
}
}
}
.uwt-toolbar > .uwt-button

View File

@ -31,6 +31,7 @@
$context = new OmsContext();
$context->setWorkData(KnownInstanceGuids::WorkSet__RelatedInstance, $instance);
$context->setWorkData($oms->getParentClass($instance), $instance);
$taskRenderer = new HTMLRenderer($context);
$taskRenderer->TargetInstance = $instance;