Onboarding filter
Issue-ID: SDC-1187
Change-Id: I74ce464c8ee4060c381b094d26d1ded270cdf40d
Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
diff --git a/openecomp-ui/src/nfvo-utils/objectPropsToUrlString.js b/openecomp-ui/src/nfvo-utils/objectPropsToUrlString.js
new file mode 100644
index 0000000..6c18bb6
--- /dev/null
+++ b/openecomp-ui/src/nfvo-utils/objectPropsToUrlString.js
@@ -0,0 +1,23 @@
+export default function objectPropsToUrlString(data) {
+ let str = '';
+ Object.keys(data).map(key => {
+ if (typeof data[key] === 'object') {
+ let obj = data[key];
+ let arr = [];
+
+ Object.keys(obj).map(prop => {
+ if (obj[prop]) {
+ arr.push(encodeURIComponent(prop));
+ }
+ });
+ if (arr.length) {
+ str += `&${encodeURIComponent(key)}=${arr.join(',')}`;
+ }
+ } else if (data[key]) {
+ str += `&${encodeURIComponent(key)}=${encodeURIComponent(
+ data[key]
+ )}`;
+ }
+ });
+ return str;
+}