Skip to content

Commit

Permalink
Handle target in OpenInApp response
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Jul 24, 2023
1 parent 7c8eb90 commit a121198
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/unreleased/openappintab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Handle target in OpenInApp response

Implements the OpenInApp.target property

https://github.com/cs3org/reva/pull/4077
2 changes: 1 addition & 1 deletion internal/http/services/appprovider/appprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ func (s *svc) handleOpen(w http.ResponseWriter, r *http.Request) {
}

log := appctx.GetLogger(ctx)
log.Info().Str("url", openRes.AppUrl.AppUrl).Interface("resource", fileRef).Msg("returning app URL for file")
log.Info().Interface("resource", fileRef).Str("url", openRes.AppUrl.AppUrl).Str("method", openRes.AppUrl.Method).Interface("target", openRes.AppUrl.Target).Msg("returning app URL for file")

Check failure on line 424 in internal/http/services/appprovider/appprovider.go

View workflow job for this annotation

GitHub Actions / lint

openRes.AppUrl.Target undefined (type *"github.com/cs3org/go-cs3apis/cs3/app/provider/v1beta1".OpenInAppURL has no field or method Target) (typecheck)

Check failure on line 424 in internal/http/services/appprovider/appprovider.go

View workflow job for this annotation

GitHub Actions / go

openRes.AppUrl.Target undefined (type *"github.com/cs3org/go-cs3apis/cs3/app/provider/v1beta1".OpenInAppURL has no field or method Target)

Check failure on line 424 in internal/http/services/appprovider/appprovider.go

View workflow job for this annotation

GitHub Actions / integration

openRes.AppUrl.Target undefined (type *"github.com/cs3org/go-cs3apis/cs3/app/provider/v1beta1".OpenInAppURL has no field or method Target)

w.Header().Set("Content-Type", "application/json")
if _, err = w.Write(js); err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/app/provider/demo/demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func (p *demoProvider) GetAppURL(ctx context.Context, resource *provider.Resourc
return &appprovider.OpenInAppURL{
AppUrl: url,
Method: http.MethodGet,
Target: appprovider.Target_TARGET_IFRAME, // alternatively, appprovider.Target_TARGET_BLANK

Check failure on line 48 in pkg/app/provider/demo/demo.go

View workflow job for this annotation

GitHub Actions / lint

Target_TARGET_IFRAME not declared by package providerv1beta1 (typecheck)

Check failure on line 48 in pkg/app/provider/demo/demo.go

View workflow job for this annotation

GitHub Actions / go

unknown field 'Target' in struct literal of type "github.com/cs3org/go-cs3apis/cs3/app/provider/v1beta1".OpenInAppURL

Check failure on line 48 in pkg/app/provider/demo/demo.go

View workflow job for this annotation

GitHub Actions / go

undefined: providerv1beta1.Target_TARGET_IFRAME

Check failure on line 48 in pkg/app/provider/demo/demo.go

View workflow job for this annotation

GitHub Actions / integration

unknown field 'Target' in struct literal of type "github.com/cs3org/go-cs3apis/cs3/app/provider/v1beta1".OpenInAppURL

Check failure on line 48 in pkg/app/provider/demo/demo.go

View workflow job for this annotation

GitHub Actions / integration

undefined: providerv1beta1.Target_TARGET_IFRAME
}, nil
}

Expand Down
1 change: 1 addition & 0 deletions pkg/app/provider/wopi/wopi.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ func (p *wopiProvider) GetAppURL(ctx context.Context, resource *provider.Resourc
AppUrl: appFullURL,
Method: method,
FormParameters: formParams,
Target: appprovider.Target_TARGET_IFRAME,

Check failure on line 339 in pkg/app/provider/wopi/wopi.go

View workflow job for this annotation

GitHub Actions / lint

Target_TARGET_IFRAME not declared by package providerv1beta1 (typecheck)

Check failure on line 339 in pkg/app/provider/wopi/wopi.go

View workflow job for this annotation

GitHub Actions / go

unknown field 'Target' in struct literal of type "github.com/cs3org/go-cs3apis/cs3/app/provider/v1beta1".OpenInAppURL

Check failure on line 339 in pkg/app/provider/wopi/wopi.go

View workflow job for this annotation

GitHub Actions / go

undefined: providerv1beta1.Target_TARGET_IFRAME

Check failure on line 339 in pkg/app/provider/wopi/wopi.go

View workflow job for this annotation

GitHub Actions / integration

unknown field 'Target' in struct literal of type "github.com/cs3org/go-cs3apis/cs3/app/provider/v1beta1".OpenInAppURL

Check failure on line 339 in pkg/app/provider/wopi/wopi.go

View workflow job for this annotation

GitHub Actions / integration

undefined: providerv1beta1.Target_TARGET_IFRAME
}, nil
}

Expand Down

0 comments on commit a121198

Please sign in to comment.