-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add option to dashboard widget to show all submissions, or just for the current user #203
Comments
@engram-design That would be great! We already needed this, so we built it as a custom widget that extends the built-in widget. Just leaving this here in case someone needs it: use Craft;
use verbb\workflow\elements\Submission;
use verbb\workflow\widgets\Submissions;
class OwnSubmissions extends Submissions
{
public static function displayName(): string
{
return Craft::t('custom_workflows', 'My submissions');
}
public function getBodyHtml(): ?string
{
$user = Craft::$app->user?->getIdentity();
if (!$user) {
return '';
}
$submissions = Submission::find()
->status($this->status)
->limit($this->limit)
->editorId($user->id)
->all();
return Craft::$app->getView()->renderTemplate('workflow/_widget/body', [
'submissions' => $submissions,
]);
}
} Might make sense to have it as a separate widget (as opposed to an option in the existing widget) so we can provide some users access to only this limited widget. |
Thanks for that! Yep, might be it's own separate widget, or just adding some settings to chose what to show. Appreciate it 👍 |
Currently, all submissions are shown in the dashboard widget, including ones users might not have access to, which isn't a good look. Add the option to show all, or just the ones that the current user is the editor/reviewer/publisher on.
The text was updated successfully, but these errors were encountered: