Commit 7b7c09e2 authored by Elias Luhr's avatar Elias Luhr

allow hide archived visually

parent c8a9d768
......@@ -37,11 +37,15 @@ trait PrepareItems
*/
protected $itemList = [];
protected function prepareItemList(): void
protected function prepareItemList($skipArchived = false): void
{
$secureVaultItems = \Yii::$app->secureVault->listItems($this->schemaUuid, $this->userUuid);
foreach ($secureVaultItems as $secureVaultItem) {
if ($skipArchived && isset($secureVaultItem['isArchived']) && $secureVaultItem['isArchived']) {
continue;
}
$this->itemList[$secureVaultItem['uuid']] = json_encode($secureVaultItem['dataJson']);
}
}
}
\ No newline at end of file
}
......@@ -63,6 +63,11 @@ class SecureVaultList extends Widget
*/
public $archiveActionId = 'secure-vault-archive';
/**
* @var bool
*/
public $hideArchived = false;
/**
* @var array
*/
......@@ -72,7 +77,7 @@ class SecureVaultList extends Widget
{
parent::init();
$this->prepareItemList();
$this->prepareItemList($this->hideArchived);
}
public function run()
......
......@@ -100,4 +100,4 @@ class SecureVaultSchemaInput extends InputWidget
}
}
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment