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

adobe / reactor-extension-core-edge / 4918850459

pending completion
4918850459

Pull #6

github

GitHub
Merge e7eaa91aa into 4fc93ce42
Pull Request #6: Make Path data element view be easier to use.

218 of 375 branches covered (58.13%)

Branch coverage included in aggregate %.

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

392 of 558 relevant lines covered (70.25%)

28.56 hits per line

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

42.0
/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 = await loadExtensions();
3✔
20
  extensions = extensions.data;
3✔
21

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

55
  return {
3✔
56
    action: getActionSourceName(action),
57
    extension,
58
    path
59
  };
60
};
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