Skip to content

Commit

Permalink
fix: Fix missing parameters in activity messages
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Dec 18, 2023
1 parent ce7d393 commit 2a2939f
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 1 deletion.
36 changes: 36 additions & 0 deletions src/components/richArgumentsTypes/UnknownArgument.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!--
- @copyright 2023 Joas Schilling <coding@schilljs.com>
-
- @author Joas Schilling <coding@schilljs.com>
-
- @license AGPL-3.0-or-later
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<template>
<strong>{{ name }}</strong>
</template>

<script>
export default {
name: 'UnknownArgument',
props: {
name: {
type: String,
required: true,
},
},
}
</script>
40 changes: 40 additions & 0 deletions src/components/richArgumentsTypes/UnknownLinkArgument.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!--
- @copyright 2023 Joas Schilling <coding@schilljs.com>
-
- @author Joas Schilling <coding@schilljs.com>
-
- @license AGPL-3.0-or-later
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<template>
<a :href="link">{{ name }}</a>
</template>

<script>
export default {
name: 'UnknownLinkArgument',
props: {
name: {
type: String,
required: true,
},
link: {
type: String,
required: true,
},
},
}
</script>
13 changes: 12 additions & 1 deletion src/utils/richObjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import CalendarRichArgument from '../components/richArgumentsTypes/CalendarRichA
import CalendarEventRichArgument from '../components/richArgumentsTypes/CalendarEventRichArgument.vue'
import OpenGraphRichArgument from '../components/richArgumentsTypes/OpenGraphRichArgument.vue'
import AddressBookRichArgument from '../components/richArgumentsTypes/AddressBookRichArgument.vue'
import UnknownArgument from '../components/richArgumentsTypes/UnknownArgument.vue'
import UnknownLinkArgument from '../components/richArgumentsTypes/UnknownLinkArgument.vue'

/**
* Map an collection of rich text objects to rich arguments for the RichText component
Expand Down Expand Up @@ -105,6 +107,15 @@ export function mapRichObjectToRichArgument(richObject: IRichObject) {
props: richObject,
}
default:
return richObject
if (richObject.link) {
return {
component: UnknownLinkArgument,
props: richObject,
}
}
return {
component: UnknownArgument,
props: richObject,
}
}
}

0 comments on commit 2a2939f

Please sign in to comment.