@datagouv/components-next 1.4.1-dev.1384.gab4fb984 → 1.4.1-dev.1385.gdbe95e78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components-next.js +8931 -8906
- package/package.json +1 -1
- package/src/components/ActivityList/ActivityActor.vue +33 -1
- package/src/types/activity.ts +22 -4
package/package.json
CHANGED
|
@@ -5,6 +5,28 @@
|
|
|
5
5
|
:size
|
|
6
6
|
:with-link
|
|
7
7
|
/>
|
|
8
|
+
<!-- What follows the owner is plain text rather than part of a flex box, so that a
|
|
9
|
+
long key or application name wraps with the sentence it belongs to. -->
|
|
10
|
+
<span v-else-if="actor.class === 'ApiToken'">
|
|
11
|
+
<AvatarWithName
|
|
12
|
+
:user="actor.owner"
|
|
13
|
+
:size
|
|
14
|
+
:with-link
|
|
15
|
+
class="mr-1 align-middle"
|
|
16
|
+
/>
|
|
17
|
+
<span class="text-gray-medium">
|
|
18
|
+
{{ actor.name ? t('via la clé d\'API « {name} »', { name: actor.name }) : t('via une clé d\'API') }}
|
|
19
|
+
</span>
|
|
20
|
+
</span>
|
|
21
|
+
<span v-else-if="actor.class === 'OAuth2Token'">
|
|
22
|
+
<AvatarWithName
|
|
23
|
+
:user="actor.owner"
|
|
24
|
+
:size
|
|
25
|
+
:with-link
|
|
26
|
+
class="mr-1 align-middle"
|
|
27
|
+
/>
|
|
28
|
+
<span class="text-gray-medium">{{ t('via {name}', { name: actor.client.name }) }}</span>
|
|
29
|
+
</span>
|
|
8
30
|
<span
|
|
9
31
|
v-else
|
|
10
32
|
class="inline-flex items-center space-x-1"
|
|
@@ -18,12 +40,20 @@
|
|
|
18
40
|
aria-hidden="true"
|
|
19
41
|
/>
|
|
20
42
|
</span>
|
|
21
|
-
<span
|
|
43
|
+
<span
|
|
44
|
+
v-if="actor.name"
|
|
45
|
+
class="truncate font-bold"
|
|
46
|
+
>{{ actor.name }}</span>
|
|
47
|
+
<span
|
|
48
|
+
v-else
|
|
49
|
+
class="rounded bg-gray-some px-1.5 py-0.5 text-[11px] leading-5 text-gray-medium"
|
|
50
|
+
>{{ t('Moissonnage supprimé') }}</span>
|
|
22
51
|
</span>
|
|
23
52
|
</template>
|
|
24
53
|
|
|
25
54
|
<script setup lang="ts">
|
|
26
55
|
import { RiRobot2Line } from '@remixicon/vue'
|
|
56
|
+
import { useTranslation } from '../../composables/useTranslation'
|
|
27
57
|
import type { ActivityActor } from '../../types/activity'
|
|
28
58
|
import AvatarWithName from '../AvatarWithName.vue'
|
|
29
59
|
|
|
@@ -35,4 +65,6 @@ withDefaults(defineProps<{
|
|
|
35
65
|
size: 12,
|
|
36
66
|
withLink: true,
|
|
37
67
|
})
|
|
68
|
+
|
|
69
|
+
const { t } = useTranslation()
|
|
38
70
|
</script>
|
package/src/types/activity.ts
CHANGED
|
@@ -9,13 +9,31 @@ export type ActivityKey = 'dataset:created' | 'dataset:updated' | 'dataset:delet
|
|
|
9
9
|
| 'user:followed' | 'topic:created' | 'topic:updated'
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* Who an action is attributed to. Not necessarily a person: harvesting
|
|
13
|
-
*
|
|
12
|
+
* Who an action is attributed to. Not necessarily a person: harvesting acts on its own
|
|
13
|
+
* behalf, an API token or an application's OAuth2 token on behalf of its owner. `class`
|
|
14
|
+
* is the discriminator every API reference carries.
|
|
14
15
|
*/
|
|
15
16
|
export type ActivityActor
|
|
16
17
|
= | UserReference
|
|
17
|
-
| {
|
|
18
|
-
|
|
18
|
+
| {
|
|
19
|
+
class: 'HarvestSource'
|
|
20
|
+
id: string
|
|
21
|
+
/** Null once the source has been purged. */
|
|
22
|
+
name: string | null
|
|
23
|
+
}
|
|
24
|
+
| {
|
|
25
|
+
class: 'ApiToken'
|
|
26
|
+
id: string
|
|
27
|
+
owner: UserReference
|
|
28
|
+
/** Only sent to the token owner and to sysadmins; a token may also have no name. */
|
|
29
|
+
name: string | null
|
|
30
|
+
}
|
|
31
|
+
| {
|
|
32
|
+
class: 'OAuth2Token'
|
|
33
|
+
id: string
|
|
34
|
+
owner: UserReference
|
|
35
|
+
client: { class: 'OAuth2Client', id: string, name: string }
|
|
36
|
+
}
|
|
19
37
|
|
|
20
38
|
export type ActivityExtras = {
|
|
21
39
|
/** Set on the `dataset:resource:*` keys. */
|