Passed
Push — trunk ( ab8fcd...c0f14a )
by Christian
14:27 queued 22s
created

src/Administration/Resources/app/administration/src/app/asyncComponent/media/sw-media-replace/index.js   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 24
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 13
mnd 0
bc 0
fnc 3
dl 0
loc 24
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
rs 10
1
/**
2
 * @public
3
 * @status ready
4
 * @description The <u>sw-media-replace</u> component extends the <u>sw-media-upload</u> component. It is
5
 * used in cases of replacing items rather than uploading them.
6
 * @package content
7
 * @example-type code-only
8
 * @component-example
9
 * <sw-media-replace
10
 *      :item-to-replace="mediaItem"
11
 *      variant="regular"
12
 * ></sw-media-replace>
13
 */
14
// eslint-disable-next-line sw-deprecation-rules/private-feature-declarations
15
export default {
16
    props: {
17
        itemToReplace: {
18
            type: Object,
19
            required: true,
20
        },
21
    },
22
23
    data() {
24
        return {
25
            multiSelect: false,
26
        };
27
    },
28
29
    methods: {
30
        getMediaEntityForUpload() {
31
            return this.itemToReplace;
32
        },
33
34
        cleanUpFailure(mediaEntity, message) {
35
            this.createNotificationError({ message });
36
        },
37
    },
38
};
39