• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

adobe / reactor-extension-core-edge / 4919408640

pending completion
4919408640

push

github

GitHub
Merge pull request #6 from adobe/path_changes

218 of 375 branches covered (58.13%)

Branch coverage included in aggregate %.

124 of 124 new or added lines in 8 files covered. (100.0%)

395 of 561 relevant lines covered (70.41%)

28.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

44.23
/src/view/dataElements/path/form/getInitValues.js
1
/*
2
Copyright 2020 Adobe. All rights reserved.
3
This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
you may not use this file except in compliance with the License. You may obtain a copy
5
of the License at http://www.apache.org/licenses/LICENSE-2.0
6

7
Unless required by applicable law or agreed to in writing, software distributed under
8
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
OF ANY KIND, either express or implied. See the License for the specific language
10
governing permissions and limitations under the License.
11
*/
12

13
import actionSources from '../helpers/actionSources';
14
import loadExtensions from '../api/loadExtensions';
15

16
const { getActionSourceName } = actionSources;
1✔
17

18
export default async ({ settings }) => {
19
  let extensions = [];
3✔
20

21
  try {
3✔
22
    extensions = await loadExtensions();
3✔
23
    extensions = extensions.data;
3✔
24
  } catch (e) {
25
    // Don't do anything.
26
  }
27

28
  let path = settings?.path || '';
3!
29
  let action = '';
3✔
30
  let extension = '';
3✔
31
  if (path.startsWith('arc.event.xdm')) {
3!
32
    action = 'xdm';
×
33
    path = path.replace(/^arc\.event\.xdm\.?/, '');
×
34
  } else if (path.startsWith('arc.ruleStash')) {
3!
35
    action = 'stash';
×
36
    path = path.replace(/^arc\.ruleStash\./, '');
×
37
    path = path.split('.');
×
38
    const extensionName = path.shift();
×
39
    const currentExtension = extensions.filter(
×
40
      (x) => x.attributes.name === extensionName
×
41
    )[0];
42
    extension = currentExtension?.attributes.display_name || '';
×
43
    if (extension) {
×
44
      path = path.join('.');
×
45
    } else {
46
      path = '';
×
47
    }
48
  } else if (path.startsWith('arc.event.data')) {
3!
49
    action = 'data';
×
50
    path = path.replace(/^arc\.event\.data\.?/, '');
×
51
  } else if (path === 'arc.request') {
3!
52
    action = 'request';
×
53
    path = '';
×
54
  } else if (path.startsWith('arc.event')) {
3!
55
    action = 'event';
×
56
    path = path.replace(/^arc\.event\.?/, '');
×
57
  } else if (path) {
3!
58
    action = 'custom';
3✔
59
  }
60

61
  return {
3✔
62
    action: getActionSourceName(action),
63
    extension,
64
    path
65
  };
66
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc