-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
66 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "nwl-components", | ||
"version": "1.3.9", | ||
"version": "1.3.10", | ||
"files": [ | ||
"dist" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* eslint-disable max-lines */ | ||
import { action } from '@storybook/addon-actions'; | ||
import { ref } from 'vue'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,64 @@ | ||
import { get } from "lodash"; | ||
import { get } from 'lodash'; | ||
|
||
export default class ProjectService { | ||
baseURL = ""; | ||
|
||
constructor(baseURL) { | ||
constructor (baseURL) { | ||
this.baseURL = baseURL; | ||
} | ||
|
||
transformProjectFiles(project) { | ||
if (get(project, "files.list") != null) { | ||
// eslint-disable-next-line class-methods-use-this | ||
transformProjectFiles (project) { | ||
if (get(project, 'files.list') !== null) { | ||
return { | ||
...project, | ||
files: { | ||
...project.files, | ||
list: project.files.list.map((file) => { | ||
if (typeof file === "string") { | ||
const splitAt = file.lastIndexOf("/"); | ||
if (typeof file === 'string') { | ||
const splitAt = file.lastIndexOf('/'); | ||
|
||
return { | ||
source: file, | ||
name: splitAt > 0 ? file.substring(splitAt + 1) : "", | ||
name: splitAt > 0 ? file.substring(splitAt + 1) : '' | ||
}; | ||
} | ||
|
||
return file; | ||
}), | ||
}, | ||
}) | ||
} | ||
}; | ||
} | ||
|
||
return project; | ||
} | ||
|
||
async fetch(id) { | ||
async fetch (id) { | ||
return this.transformProjectFiles( | ||
await (await fetch(`${this.baseURL}/project/json/${id}`)).json() | ||
); | ||
} | ||
|
||
async save(data) { | ||
async save (data) { | ||
const res = await fetch(`${this.baseURL}/project/json/${data.shortname}`, { | ||
method: "POST", | ||
method: 'POST', | ||
headers: { | ||
Accept: "application/json", | ||
"Content-Type": "application/json", | ||
Accept: 'application/json', | ||
'Content-Type': 'application/json' | ||
}, | ||
body: JSON.stringify({ | ||
data, | ||
}), | ||
data | ||
}) | ||
}); | ||
return await res.json(); | ||
|
||
return res.json(); | ||
} | ||
|
||
async delete(id) { | ||
async delete (id) { | ||
const res = await fetch(`${this.baseURL}/project/json/${id}`, { | ||
method: "DELETE", | ||
headers: { "Content-Type": "application/json" }, | ||
method: 'DELETE', | ||
headers: { 'Content-Type': 'application/json' } | ||
}); | ||
return await res.json(); | ||
|
||
return res.json(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters