cozy-client 60.38.0 → 60.39.0

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.
@@ -3127,7 +3127,7 @@ var CozyClient = /*#__PURE__*/function () {
3127
3127
  CozyClient.hooks = CozyClient.hooks || {};
3128
3128
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
3129
3129
 
3130
- CozyClient.version = "60.38.0";
3130
+ CozyClient.version = "60.39.0";
3131
3131
 
3132
3132
  _microee.default.mixin(CozyClient);
3133
3133
 
@@ -89,7 +89,7 @@ var isInstalled = function isInstalled() {
89
89
  exports.isInstalled = isInstalled;
90
90
 
91
91
  var getUrl = function getUrl(app) {
92
- if (app.standalone === true && app.client_url_flag) {
92
+ if (app.standalone === true && app.client_url_flag && (0, _cozyFlags.default)('apps.enable-standalone-apps')) {
93
93
  var clientUrl = (0, _cozyFlags.default)(app.client_url_flag);
94
94
  if ((0, _helpers.isHttpUrl)(clientUrl)) return clientUrl;
95
95
  }
@@ -127,6 +127,8 @@ describe('applications model', () => {
127
127
  describe('getUrl', () => {
128
128
  const related = 'http://calendar.cozy.tools:8080/'
129
129
 
130
+ const mockFlags = flags => flag.mockImplementation(name => flags[name])
131
+
130
132
  beforeEach(() => {
131
133
  flag.mockReset()
132
134
  })
@@ -136,7 +138,10 @@ describe('applications model', () => {
136
138
  })
137
139
 
138
140
  it('returns the flag value of a standalone app when it is a valid URL', () => {
139
- flag.mockReturnValue('https://calendar.example.com/')
141
+ mockFlags({
142
+ 'apps.enable-standalone-apps': true,
143
+ 'calendar.embedded-app-url': 'https://calendar.example.com/'
144
+ })
140
145
  const app = {
141
146
  standalone: true,
142
147
  client_url_flag: 'calendar.embedded-app-url',
@@ -149,7 +154,10 @@ describe('applications model', () => {
149
154
  it.each([null, true, 'not a url', 'javascript:alert(1)'])(
150
155
  'returns links.related when the flag value is %p',
151
156
  value => {
152
- flag.mockReturnValue(value)
157
+ mockFlags({
158
+ 'apps.enable-standalone-apps': true,
159
+ 'calendar.embedded-app-url': value
160
+ })
153
161
  const app = {
154
162
  standalone: true,
155
163
  client_url_flag: 'calendar.embedded-app-url',
@@ -162,7 +170,10 @@ describe('applications model', () => {
162
170
  it.each([undefined, false])(
163
171
  'returns links.related when standalone is %p',
164
172
  standalone => {
165
- flag.mockReturnValue('https://mail.example.com/')
173
+ mockFlags({
174
+ 'apps.enable-standalone-apps': true,
175
+ 'mail.embedded-app-url': 'https://mail.example.com/'
176
+ })
166
177
  const app = {
167
178
  standalone,
168
179
  client_url_flag: 'mail.embedded-app-url',
@@ -171,6 +182,18 @@ describe('applications model', () => {
171
182
  expect(applications.getUrl(app)).toBe(related)
172
183
  }
173
184
  )
185
+
186
+ it('returns links.related while standalone apps are not enabled', () => {
187
+ mockFlags({
188
+ 'calendar.embedded-app-url': 'https://calendar.example.com/'
189
+ })
190
+ const app = {
191
+ standalone: true,
192
+ client_url_flag: 'calendar.embedded-app-url',
193
+ links: { related }
194
+ }
195
+ expect(applications.getUrl(app)).toBe(related)
196
+ })
174
197
  })
175
198
 
176
199
  describe('get store installation url', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "60.38.0",
3
+ "version": "60.39.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.node.js",
6
6
  "browser": "dist/index.js",
@@ -74,5 +74,5 @@
74
74
  "react-native-ios11-devicecheck": "^0.0.3"
75
75
  },
76
76
  "sideEffects": false,
77
- "gitHead": "7531ce634e310b15dbbe32958a71600a57e8ecad"
77
+ "gitHead": "356c7ac84ab60db2f6f3c3f40002af82eba898c1"
78
78
  }