Skip to content

Commit

Permalink
[V3-965] Satellite account. Fixed Vue lint errors (#890)
Browse files Browse the repository at this point in the history
* [V3-965] Satellite account. Fixed Vue lint errors
  • Loading branch information
Barterio committed Dec 18, 2018
1 parent 23fa3ac commit 8a79d18
Show file tree
Hide file tree
Showing 74 changed files with 1,591 additions and 1,694 deletions.
1 change: 1 addition & 0 deletions web/satellite/package.json
Expand Up @@ -51,6 +51,7 @@
"vue-loader": "^15.4.2",
"vue-style-loader": "^4.1.2",
"vue-template-compiler": "^2.5.17",
"vue-tslint": "^0.3.2",
"vue-tslint-loader": "^3.5.6",
"webpack": "^4.21.0",
"webpack-cli": "^3.1.2",
Expand Down
77 changes: 40 additions & 37 deletions web/satellite/src/App.vue
Expand Up @@ -2,54 +2,57 @@
// See LICENSE for copying information.

<template>
<div id="app">
<router-view/>
<!-- Area for displaying notification -->
<NotificationArea />
</div>
<div id="app">
<router-view/>
<!-- Area for displaying notification -->
<NotificationArea/>
</div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import NotificationArea from '@/components/notifications/NotificationArea.vue';
@Component({
components: {
NotificationArea
}
components: {
NotificationArea
}
})
export default class App extends Vue {}
export default class App extends Vue {
}
</script>

<style lang="scss">
@font-face {
font-family: "montserrat_regular";
src: url("../static/fonts/montserrat_regular.ttf");
}
@font-face {
font-family: "montserrat_medium";
src: url("../static/fonts/montserrat_medium.ttf");
}
@font-face {
font-family: "montserrat_bold";
src: url("../static/fonts/montserrat_bold.ttf");
}
a{
cursor: pointer;
}
input,
textarea {
font-family: inherit;
font-weight: 600;
border: 1px solid rgba(56, 75, 101, 0.4);
}
input:hover,
textarea:hover {
border-color: #737791 !important;
}
@font-face {
font-family: "montserrat_regular";
src: url("../static/fonts/montserrat_regular.ttf");
}
@font-face {
font-family: "montserrat_medium";
src: url("../static/fonts/montserrat_medium.ttf");
}
@font-face {
font-family: "montserrat_bold";
src: url("../static/fonts/montserrat_bold.ttf");
}
a {
cursor: pointer;
}
input,
textarea {
font-family: inherit;
font-weight: 600;
border: 1px solid rgba(56, 75, 101, 0.4);
}
input:hover,
textarea:hover {
border-color: #737791 !important;
}
</style>
34 changes: 17 additions & 17 deletions web/satellite/src/api/projectMembers.ts
Expand Up @@ -2,13 +2,13 @@
// See LICENSE for copying information.

import apollo from '@/utils/apolloManager';
import gql from "graphql-tag";
import gql from 'graphql-tag';

// Performs graqhQL request.
// Throws an exception if error occurs
export async function addProjectMember(userID: string, projectID: string): Promise<any> {
let response = null;
try{
let response: any = null;
try {
response = await apollo.mutate(
{
mutation: gql(`
Expand All @@ -19,23 +19,23 @@ export async function addProjectMember(userID: string, projectID: string): Promi
) {id}
}`
),
fetchPolicy: "no-cache",
fetchPolicy: 'no-cache',
}
);
}catch (e) {
} catch (e) {
// TODO: replace with popup in future
console.error(e);
console.error(e);
}

return response;
return response;
}

// Performs graqhQL request.
// Throws an exception if error occurs
export async function deleteProjectMember(userID: string, projectID: string): Promise<any> {
let response = null;
try {
response = await apollo.mutate(
let response: any = null;
try {
response = await apollo.mutate(
{
mutation: gql(`
mutation {
Expand All @@ -45,23 +45,23 @@ export async function deleteProjectMember(userID: string, projectID: string): Pr
) {id}
}`
),
fetchPolicy: "no-cache",
fetchPolicy: 'no-cache',
}
);
} catch (e) {
// TODO: replace with popup in future
console.error(e);
}

return response;
return response;
}

// Performs graqhQL request.
// Throws an exception if error occurs
export async function fetchProjectMembers(projectID: string): Promise<any> {
let response = null;
try {
response = await apollo.query(
let response: any = null;
try {
response = await apollo.query(
{
query: gql(`
query {
Expand All @@ -83,13 +83,13 @@ export async function fetchProjectMembers(projectID: string): Promise<any> {
}
}`
),
fetchPolicy: "no-cache",
fetchPolicy: 'no-cache',
}
);
} catch (e) {
// TODO: replace with popup in future
console.error(e);
}

return response;
return response;
}
113 changes: 56 additions & 57 deletions web/satellite/src/api/projects.ts
Expand Up @@ -2,16 +2,14 @@
// See LICENSE for copying information.

import apollo from '@/utils/apolloManager';
import gql from "graphql-tag";
import gql from 'graphql-tag';

// Performs graqhQL request.
// Throws an exception if error occurs
export async function createProject(project: Project): Promise<any> {
console.log("in api", project);

let response = await apollo.mutate(
{
mutation: gql(`
let response = await apollo.mutate(
{
mutation: gql(`
mutation {
createProject(
input: {
Expand All @@ -22,26 +20,26 @@ export async function createProject(project: Project): Promise<any> {
}
) {id}
}`
),
fetchPolicy: "no-cache",
}
);
),
fetchPolicy: 'no-cache',
}
);

if(!response){
// TODO: replace with popup in future
console.log("cannot create project");
if (!response) {
// TODO: replace with popup in future
console.error('cannot create project');

return null;
}
return null;
}

return response;
return response;
}

// Performs graqhQL request for fetching all projects of current user.
export async function fetchProjects(): Promise<any> {
let response = await apollo.query(
{
query: gql(`
let response = await apollo.query(
{
query: gql(`
query {
myProjects{
name
Expand All @@ -53,67 +51,68 @@ export async function fetchProjects(): Promise<any> {
isTermsAccepted
}
}`
),
fetchPolicy: "no-cache",
}
);
),
fetchPolicy: 'no-cache',
}
);

if(!response){
// TODO: replace with popup in future
console.log("cannot fetch projects");
if (!response) {
// TODO: replace with popup in future
console.error('cannot fetch projects');

return null;
}
return null;
}

return response;
return response;
}

// Performs graqhQL request for updating selected project description
export async function updateProject(projectID: string, description: string): Promise<any> {
let response = await apollo.mutate(
{
mutation: gql(`
let response = await apollo.mutate(
{
mutation: gql(`
mutation {
updateProjectDescription(
id: "${projectID}",
description: "${description}"
)
}`
),
fetchPolicy: "no-cache",
}
);
),
fetchPolicy: 'no-cache',
}
);

if(!response){
// TODO: replace with popup in future
console.log("cannot update project");
if (!response) {
// TODO: replace with popup in future
console.error('cannot update project');

return null;
}
return null;
}

return response;
return response;
}

// Performs graqhQL request for deleting selected project
export async function deleteProject(projectID: string): Promise<any> {
let response = await apollo.mutate(
{
mutation: gql(`
let response = await apollo.mutate(
{
mutation: gql(`
mutation {
deleteProject(
id: "${projectID}"
)
}`
),
fetchPolicy: "no-cache",
}
);

if(!response){
// TODO: replace with popup in future
console.log("cannot delete project");
return null;
}

return response;
),
fetchPolicy: 'no-cache',
}
);

if (!response) {
// TODO: replace with popup in future
console.error('cannot delete project');

return null;
}

return response;
}

0 comments on commit 8a79d18

Please sign in to comment.