Skip to content

Commit b16dfac

Browse files
committed
one more change to make ids also available as a base prop
1 parent 4ad327c commit b16dfac

File tree

1 file changed

+19
-32
lines changed

1 file changed

+19
-32
lines changed

components/youtube_analytics_api/actions/common/reports-query.mjs

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,19 @@ export default {
66
props: {
77
app,
88
startDate: {
9-
propDefinition: [
10-
app,
11-
"startDate",
12-
],
9+
propDefinition: [app, "startDate"],
1310
},
1411
endDate: {
15-
propDefinition: [
16-
app,
17-
"endDate",
18-
],
12+
propDefinition: [app, "endDate"],
1913
},
2014
dimensions: {
21-
propDefinition: [
22-
app,
23-
"dimensions",
24-
],
15+
propDefinition: [app, "dimensions"],
2516
},
2617
sort: {
27-
propDefinition: [
28-
app,
29-
"sort",
30-
],
18+
propDefinition: [app, "sort"],
3119
},
3220
maxResults: {
33-
propDefinition: [
34-
app,
35-
"maxResults",
36-
],
21+
propDefinition: [app, "maxResults"],
3722
},
3823
idType: {
3924
type: "string",
@@ -44,6 +29,14 @@ export default {
4429
default: constants.ID_TYPE.CHANNEL.value,
4530
reloadProps: true,
4631
},
32+
ids: {
33+
type: "string",
34+
label: "Channel ID OR Content Owner Name",
35+
description:
36+
"The use of this property depends on the value of the `idType` prop. If `idType` is set to `MINE`, then this property is unused. If `idType` is set to `channelId`, then this property is used to specify the Channel ID for this action. If `idType` is set to `contentOwner`, then this property is used to specify the Content Owner Name for this action.",
37+
optional: true,
38+
hidden: true,
39+
},
4740
},
4841
methods: {
4942
getIdsProps() {
@@ -56,27 +49,27 @@ export default {
5649
label: "Content Owner Name",
5750
description:
5851
"The content owner name for the user. Eg. `MyContentOwnerName`.",
52+
optional: false,
53+
hidden: false,
5954
},
6055
};
6156
}
62-
6357
if (idType === constants.ID_TYPE.CHANNEL_ID.value) {
6458
return {
6559
ids: {
6660
type: "string",
6761
label: "Channel ID",
6862
description:
6963
"The channel ID for the user. Eg. `UC_x5XG1OV2P6uZZ5FSM9Ttw`. You can find the ID using the [YouTube Data API](https://developers.google.com/youtube/v3/docs/channels/list).",
64+
optional: false,
65+
hidden: false,
7066
},
7167
};
7268
}
73-
7469
return {};
7570
},
7671
getIdsParam() {
77-
const {
78-
idType, ids,
79-
} = this;
72+
const { idType, ids } = this;
8073
if (idType === constants.ID_TYPE.CHANNEL.value) {
8174
return "channel==MINE";
8275
}
@@ -97,13 +90,7 @@ export default {
9790

9891
return utils.arrayToCommaSeparatedList(
9992
Object.entries(filtersObj).reduce(
100-
(acc, [
101-
key,
102-
val,
103-
]) => [
104-
...acc,
105-
`${key}==${val}`,
106-
],
93+
(acc, [key, val]) => [...acc, `${key}==${val}`],
10794
[],
10895
),
10996
";",

0 commit comments

Comments
 (0)