Skip to content
This repository was archived by the owner on Jul 11, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
4229ced
Startup test
ElizaFlores11 Apr 7, 2020
de7987b
First change in all flies to test what happend when all of us want to…
DorsD Apr 7, 2020
c9111f4
Login page view - html, css and JS, but still all are separed from ea…
DorsD Apr 11, 2020
e81b889
Google implementation
ElizaFlores11 Apr 11, 2020
3f799bf
Implementation Facebook
ElizaFlores11 Apr 12, 2020
f4f8dd8
Login view, router, close sesion
DorsD Apr 12, 2020
f903619
Join everubody's code but there are some issues
DorsD Apr 16, 2020
f37fbe5
pull request for master
DorsD Apr 16, 2020
84417b2
Merge pull request #3 from DorsD/snFabiola
GabyAlvarez Apr 16, 2020
99b3d9e
changes in signin.js - don't duplicate user, save user with same uid
DorsD Apr 16, 2020
fcfda8d
Provider Update
ElizaFlores11 Apr 17, 2020
be96013
Merge branch 'snFabiola' into RedSocial
DorsD Apr 17, 2020
af34b29
Merge pull request #1 from ElizaFlores11/RedSocial
DorsD Apr 17, 2020
6105b75
adding validation to form fields
Apr 17, 2020
fdfb88f
validation
Apr 17, 2020
097d972
Merge pull request #4 from DorsD/snFabiola
GabyAlvarez Apr 17, 2020
8885416
merge branches
Apr 17, 2020
0b121fb
user and post constructors
DorsD Apr 18, 2020
a61a1aa
reading user name from firestore and use it in profil view
DorsD Apr 20, 2020
1592c5e
post image preview with filereader, post text, image and privacy vali…
DorsD Apr 22, 2020
c0d543a
saving a post in firestore and storage
DorsD Apr 23, 2020
334ff91
add functions to edit user profile
Apr 24, 2020
e0da872
adding styles to content
Apr 28, 2020
8b15c2a
Merge pull request #5 from GabyAlvarez/dev_contentuser_gaby
GabyAlvarez Apr 28, 2020
9ee3854
create, edit and remove post before merge with Eli's branch
DorsD Apr 29, 2020
8a1b358
first merge with Eli adn Gabi's branch | some bugs in content file an…
DorsD Apr 30, 2020
7f9aab3
Merge branch 'master' into snFabiola
GabyAlvarez Apr 30, 2020
32e61fa
Merge pull request #6 from DorsD/snFabiola
GabyAlvarez Apr 30, 2020
0673b9c
add example of test
Apr 30, 2020
32611e6
change styles to edit profile
Apr 30, 2020
87ea693
change in modal style to solve some content style issues
DorsD Apr 30, 2020
84d02a7
change in modal style to solve some content style issues
DorsD Apr 30, 2020
4464708
styles added for profile edit view
May 1, 2020
db83107
adding predefined profile picture
May 2, 2020
3eeeb32
style issues solved
DorsD May 2, 2020
d4d2403
Merge pull request #7 from DorsD/snFabiola
GabyAlvarez May 2, 2020
69f261a
change photo profile
May 2, 2020
c5a2d01
Conflicts have been resolved and merger continues
May 2, 2020
f9e1ed1
testing defects removed
May 2, 2020
97d613e
git commit -m
May 4, 2020
a1c412e
Update Readme.md
GabyAlvarez May 4, 2020
42e7c3d
Update Readme.md
GabyAlvarez May 6, 2020
5da73d9
Update Readme.md
GabyAlvarez May 6, 2020
181b6b2
Update Readme.md
GabyAlvarez May 6, 2020
29a44e8
Update Readme.md
GabyAlvarez May 6, 2020
f0ea7f5
adding images for readme
May 6, 2020
94473a4
Merge branch 'master' into dev_contentuser_gaby
May 6, 2020
9d7591f
Merge branch 'master' of https://github.com/GabyAlvarez/CDMX009-Socia…
May 6, 2020
6616778
Update Readme.md
GabyAlvarez May 6, 2020
b9d082a
Update Readme.md
GabyAlvarez May 6, 2020
8862d95
Update Readme.md
GabyAlvarez May 6, 2020
eb44973
Update Readme.md
GabyAlvarez May 6, 2020
3720ffa
Update Readme.md
GabyAlvarez May 6, 2020
096a3af
comments were removed
May 7, 2020
66a1f92
Merge branch 'master' of https://github.com/GabyAlvarez/CDMX009-Socia…
May 7, 2020
118bf3f
Update Readme.md
GabyAlvarez Aug 20, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions .eslintrc

This file was deleted.

31 changes: 31 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
env: {
browser: true,
es6: true,
'jest/globals': true,
},
extends: [
'airbnb-base',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
firebase: 'readonly',
},
plugins: ['jest'],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
rules: {
'linebreak-style': 0,
'prefer-destructuring': 0,
'import/extensions': 0,
'import/prefer-default-export': 0,
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
},
};
245 changes: 28 additions & 217 deletions Readme.md

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions firebase-debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[debug] [2020-04-09T23:35:22.180Z] ----------------------------------------------------------------------
[debug] [2020-04-09T23:35:22.197Z] Command: C:\Program Files\nodejs\node.exe C:\Users\eliza\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js init
[debug] [2020-04-09T23:35:22.200Z] CLI Version: 8.0.2
[debug] [2020-04-09T23:35:22.201Z] Platform: win32
[debug] [2020-04-09T23:35:22.201Z] Node Version: v12.14.1
[debug] [2020-04-09T23:35:22.208Z] Time: Thu Apr 09 2020 18:35:22 GMT-0500 (GMT-05:00)
[debug] [2020-04-09T23:35:22.209Z] ----------------------------------------------------------------------
[debug] [2020-04-09T23:35:22.210Z]
[debug] [2020-04-09T23:35:22.262Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2020-04-09T23:35:22.453Z] Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.
at GoogleAuth.getApplicationDefaultAsync (C:\Users\eliza\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\google-auth-library\build\src\auth\googleauth.js:160:19)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async GoogleAuth.getClient (C:\Users\eliza\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\google-auth-library\build\src\auth\googleauth.js:502:17)
at async GoogleAuth.getAccessToken (C:\Users\eliza\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\google-auth-library\build\src\auth\googleauth.js:524:24)
[error]
[error] Error: An unexpected error has occurred.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
],
"license": "MIT",
"scripts": {
"htmlhint": "htmlhint dist/*.html ",
"htmlhint": "htmlhint dist/*.html test/*.html",
"eslint": "eslint --ext .js src/ test/",
"stylelint": "stylelint --aei src/**/*.css",
"pretest": "npm run htmlhint && npm run eslint && npm run stylelint",
"pretest": "npm run htmlhint",
"test": "jest --coverage",
"start": "serve src/"
},
Expand Down
8 changes: 8 additions & 0 deletions src/cerrarSesion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const closeSesion = () => {
firebase.auth().signOut()
.then(() => {
console.log('Cerrando sesión');
}).catch(function(error){
console.log(error);
})
}
114 changes: 114 additions & 0 deletions src/content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import { router } from './index.js';
import { closeSesion } from './cerrarSesion.js';
import { readerMyTrips } from './myTrips.js';
import { postGeneral } from './postGeneral.js';
import { renderEditProfeli } from './editProfeli.js';
import {renderPost} from "./createPost.js";
import {newPost} from "./createPost.js";
Comment on lines +1 to +7

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bien las importaciones



//import { profil} from './createPost.js';
let db= firebase.firestore();
let userRef = db.collection('users');
let main = document.querySelector('#main');

export const renderContent = () => {
let uiduser = firebase.auth().currentUser.uid;
if (uiduser != null) {
userRef.where('uid', '==', uiduser).get()
.then(snapshot => {
if (snapshot.empty) {
console.log('No matching documents.');
return;
}
snapshot.forEach(doc => {
let imguser = doc.data().photo;
let photouser;
if(imguser == ''){
photouser = 'images/defaultUser.png';
Comment on lines +24 to +28

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Es mejor devolver en una función aparte un array con los usuares y en otra funcion dibujarlos. Para separar responsabilidades

}else{
photouser = imguser;
}
let profilView = `

<header>
<div class="positiononeheader">
<img class="logo" src="images/logo.png" alt="TripLife">
</div>
<div class="positiontwoheader">
<div class="menu-togle" id="menu">
<div class="hamburger"></div>
</div>

<nav class="site-nav" id="site-nav">
<ul>
<li> <a href="#" id="index"> Inicio </a></li>
<li> <a href="#" id="editProfile"> Perfil </a></li>
<li> <a href="#" id="logout"> Cerrar Sesión </a></li>
</ul>
</nav>
</div>
</header>
<section class="content-section">
<div id="editP" class="info-user">
<div class="position-photo">
<img class="photo" src="${photouser}" />
</div>
<div class="position-profeli">
<p class="name">${doc.data().name} ${doc.data().lastName}</p>
<p class="description">${doc.data().description}</p>
</div>
</div>
<div class="board-btns">
<input type="button" id="MyTrips" class="buttonL" value="My Trips">
<input type="button" id="TripBoad" class="buttonR" value="Trip Board">
</div>
<div class="board-container">
<div class="post-generator">
<img class="thought-photo" src="${photouser}" />
<input type="button" id="thought" class='thought-input' value="¿Dónde te encuentras hoy?"/>
</div>
<div id="list-post"></div>
</div>
</section>`;
main.innerHTML = profilView;
postGeneral();
let logout = document.querySelector("#logout");
logout.addEventListener("click", closeSesion);
let pindex = document.querySelector("#index");
pindex.addEventListener("click", ()=>{
router('content');
});
let editProfile = document.querySelector("#editProfile");
editProfile.addEventListener("click", () =>{
renderEditProfeli();
});
let MyTrips = document.querySelector("#MyTrips");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Estas dos lineas pueden ser una

MyTrips.addEventListener("click", () =>{
readerMyTrips();
});
let tripBoard = document.querySelector("#TripBoad");
tripBoard.addEventListener("click", () =>{
postGeneral();
});
let thought = document.querySelector("#thought");
thought.addEventListener("click", () =>{
//profil();
console.log("Create post");
let userName = `${doc.data().name}`;
renderPost(userName, uiduser);
newPost(userName, uiduser, doc.data().photo);

});
let menu = document.querySelector("#menu");
menu.addEventListener("click", () =>{
let siteNav = document.querySelector("#site-nav");
siteNav.classList.toggle("site-nav-open");
});
});
})
.catch(err => {
console.log('Error getting documents', err);
});
}
}
Loading