Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Folders #81

Merged
merged 66 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
a62a989
Merge pull request #66 from PoCInnovation/dev
adrienfort Jun 21, 2022
1d0e61a
fix: Monitoring section removed in milestone template
RezaRahemtola Jun 23, 2022
433704f
[MERGE] Monitoring section removed in milestone template
RezaRahemtola Jun 23, 2022
d87237d
Merge pull request #80 from PoCInnovation/dev
RezaRahemtola Jul 6, 2022
33a9a3e
feat: Context menu handling on file right click
RezaRahemtola Jul 12, 2022
dff474a
feat: Path property added in IPCFile
RezaRahemtola Jul 12, 2022
671ab7a
feat: isFile prop, path state and lint fixes
RezaRahemtola Jul 13, 2022
84bf13b
fix: Useless try/catch removed
RezaRahemtola Jul 14, 2022
f1128a6
feat: Folder creation started
RezaRahemtola Jul 14, 2022
41ca486
feat: Folder card display isolated from files
RezaRahemtola Jul 14, 2022
be337c4
feat: Folder path navigation
RezaRahemtola Jul 14, 2022
72d38ab
feat: Smooth path navigation with back button
RezaRahemtola Jul 14, 2022
ea200e6
feat: move file button (early stage)
MizuriGit Jul 14, 2022
b66f0c7
feat: Separate arrays for files and folders
RezaRahemtola Jul 14, 2022
ed0c718
fix: Refactoring and eslint warnings
RezaRahemtola Jul 14, 2022
1be46ae
fix: Permanent file move
RezaRahemtola Jul 14, 2022
80990b1
feat: refactor button new element file, program, folder
Alex-Prevot Jul 16, 2022
bbd6bd3
fix: Variable names
RezaRahemtola Jul 16, 2022
797da38
refactor: display file on MyFiles
Alex-Prevot Jul 17, 2022
ec547c6
refactor: dashboard on my Files add text and a legend
Alex-Prevot Jul 17, 2022
a1f446e
feat: Move file checks
RezaRahemtola Jul 18, 2022
ec7f63e
feat: Package updates and new favicon
RezaRahemtola Jul 18, 2022
31d2603
feat: add redeploy button to redeploy programs manually deployed + Ch…
ZerLock Jul 18, 2022
3dd5122
Merge with branh folder
Alex-Prevot Jul 18, 2022
bd620df
refactor: ui folder, icon and return to menu
Alex-Prevot Jul 18, 2022
1fdd1d1
fix: helper text around login and signup buttons
Samoten777 Jul 19, 2022
f1d54b0
feat: reversed dashboard elements positions
Samoten777 Jul 19, 2022
da5e4bb
Merge branch 'feat/folders' into ui-refactoring
Alex-Prevot Jul 20, 2022
a0dc00e
Merge with branch feat/redeploy-program
Alex-Prevot Jul 20, 2022
8629b25
fix: element on program card
Alex-Prevot Jul 20, 2022
cdc31e7
feat: added date on last upload on aleph
Alex-Prevot Jul 20, 2022
c4b059f
feat: Add deleteProgram function to delete program + Linter
ZerLock Jul 20, 2022
32beb9f
fix: Lint and console.log
RezaRahemtola Jul 21, 2022
ca2261a
feat: Cypress baseUrl config used instead of raw value
RezaRahemtola Jul 21, 2022
c669a7e
fix: Useless vars and clean code
RezaRahemtola Jul 21, 2022
a9e380b
feat: added date and start size
Alex-Prevot Jul 21, 2022
1d66404
fix: Size not saved in local files
RezaRahemtola Jul 21, 2022
6ba8b7b
feat: added size on file
Alex-Prevot Jul 21, 2022
50b492d
Merge branch 'ui-refactoring' of github.com:PoCInnovation/InterPlanet…
Alex-Prevot Jul 21, 2022
c931964
fix: yarn lock
RezaRahemtola Jul 21, 2022
935a254
fix: Warnings and errors removed
RezaRahemtola Jul 21, 2022
6dc8630
fix: Error displayed on non-files upload
RezaRahemtola Jul 21, 2022
d3a9b25
feat: added button rename and update on file
Alex-Prevot Jul 22, 2022
2155924
Merge branch 'ui-refactoring' of github.com:PoCInnovation/InterPlanet…
Alex-Prevot Jul 22, 2022
0a302a9
Merge
Alex-Prevot Jul 22, 2022
8d57699
feat: Delete file
RezaRahemtola Jul 22, 2022
30c7e38
fix: Refactoring and useless states removed
RezaRahemtola Jul 22, 2022
b535d48
fix: Useless props and tests with new UI
RezaRahemtola Jul 23, 2022
8524cae
fix: Test names
RezaRahemtola Jul 23, 2022
57f9a6d
fix: Wrong test buttons length
RezaRahemtola Jul 23, 2022
bf17af9
feat: added date for program
Alex-Prevot Jul 25, 2022
23c4641
Merge branch 'ui-refactoring' of github.com:PoCInnovation/InterPlanet…
Alex-Prevot Jul 25, 2022
9560b0f
refactor: card program
Alex-Prevot Jul 25, 2022
61707ba
refactor: card folder with move to and delete folder
Alex-Prevot Jul 28, 2022
d1cc4fb
feat: Delete folder
RezaRahemtola Jul 31, 2022
7270913
fix: Front refactoring
RezaRahemtola Aug 2, 2022
71c3b03
fix: Further refactoring for folders and last files
RezaRahemtola Aug 3, 2022
2377bbc
feat: Folder move and new move modal
RezaRahemtola Aug 3, 2022
4015e77
merge: Redeploy programs
RezaRahemtola Aug 6, 2022
8d6095a
feat: aleph program message
ZerLock Aug 6, 2022
a901604
feat: secret env var
RezaRahemtola Aug 7, 2022
47669da
feat: deploying programs from github works + retrieve program in prog…
ZerLock Aug 8, 2022
2e4bde6
refactor: button new element with deploy from github and card programs
Alex-Prevot Aug 8, 2022
566ca6c
Merge branch 'feat/redeploy_programs' into feat/folders
RezaRahemtola Aug 9, 2022
ed8eaf2
Merge branch 'feat/redeploy_programs' into feat/folders
RezaRahemtola Aug 9, 2022
4888663
fix: Styling, useless package and tests
RezaRahemtola Aug 9, 2022
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
8 changes: 7 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ README.md
# Node
node_modules/
tests/
cypress/
cypress.config.ts

# IPC
repositories/

# Build
dist/
build/
.next/

# Infra
*Dockerfile*
Expand Down
8 changes: 7 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
NEXT_PUBLIC_ALEPH_CHANNEL=TEST
NEXT_PUBLIC_ALEPH_CHANNEL=TEST

NEXT_PUBLIC_GITCLONE_DIR=repositories
NEXT_PUBLIC_GITHUB_CLIENT_ID="your OAuth client id"
NEXT_PUBLIC_GITHUB_CLIENT_SECRET="your OAuth client secret"
NEXTAUTH_URL=http://localhost:8080
NEXTAUTH_SECRET="secret"
2 changes: 1 addition & 1 deletion .github/workflows/end-to-end-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Run cypress
uses: cypress-io/github-action@v4
with:
start: docker run -p 8080:80 ipc:latest
start: docker run -p 8080:8080 ipc:latest
wait-on: "http://localhost:8080"

- name: Get screenshots
Expand Down
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ cypress/downloads

# next.js
/.next/
/build/

# production
/build
out/

# misc
.DS_Store
Expand All @@ -38,5 +35,5 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*


repositories
.metamask
42 changes: 18 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,35 @@
###
# Builder image
###
FROM node:16.5-alpine AS builder
FROM node:16-alpine

WORKDIR /app

# Install dependencies
COPY package.json .
COPY yarn.lock .

# Install dependencies
RUN yarn install
RUN yarn --frozen-lockfile;

# Copy source (see .dockerignore)
COPY . .

# Add env variable
# Add env variables
ENV NEXT_PUBLIC_ALEPH_CHANNEL=TEST
ENV NEXTAUTH_URL="http://localhost:8080"
ENV NEXTAUTH_SECRET = $(openssl rand -base64 32)
ENV NEXT_PUBLIC_GITCLONE_DIR="repositories"
ENV NEXT_PUBLIC_GITHUB_CLIENT_ID="your OAuth client id"
ENV NEXT_PUBLIC_GITHUB_CLIENT_SECRET="your OAuth client secret"

# Build source
RUN yarn run build
RUN yarn build

###
# Production image
###
FROM nginx:1.21.6-alpine as app

WORKDIR /app
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
RUN mv next.config.js .next/standalone/
RUN mv public .next/standalone/
RUN mv .next/static .next/standalone/.next/

# Copy code
COPY --from=builder /app/build /usr/share/nginx/html
WORKDIR /app/.next/standalone

# Copy nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 8080

# Expose PORT
EXPOSE 80
ENV PORT 8080

# Prefix commands and start production
ENTRYPOINT ["nginx", "-g", "daemon off;"]
CMD ["node", "server.js"]
25 changes: 8 additions & 17 deletions cypress/e2e/features/files.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,34 @@ describe('Create account for File tests', () => {

describe('Upload a file modal in Dashboard', () => {
const fixtureFile = 'upload_test_file.txt';
const emptyFixtureFile = 'upload_empty_file.txt';

beforeEach(() => {
cy.visit('/login');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click();
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-upload-button').click();
cy.get('.ipc-new-elem-button').click();
cy.get('#ipc-upload-button').click({ force: true });
});

it('Good number of buttons after upload', () => {
cy.get('#ipc-dashboard-upload-file').attachFile(fixtureFile);
cy.get('#ipc-dashboard-upload-file-modal-button').click();
cy.wait(2000);
cy.get('button').should('have.length', 12);
cy.get('button').should('have.length', 13);
});

it('Good number of buttons after closing modal', () => {
cy.get('#ipc-modal-close-button').click();
cy.get('button').should('have.length', 12);
});
});

describe('Upload an empty file in Dashboard', () => {
const fixtureFile = 'upload_empty_file.txt';

beforeEach(() => {
cy.visit('/login');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click();
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-upload-button').click();
cy.get('button').should('have.length', 18);
});

it('Good number of buttons after failed upload', () => {
cy.get('#ipc-dashboard-upload-file').attachFile(fixtureFile, { allowEmpty: true });
cy.get('#ipc-dashboard-upload-file').attachFile(emptyFixtureFile, { allowEmpty: true });
cy.get('#ipc-dashboard-upload-file-modal-button').click();
cy.wait(2000);
cy.get('button').should('have.length', 12);
cy.get('button').should('have.length', 20);
});
});

Expand All @@ -61,6 +51,7 @@ describe('Download a file in Dashboard', () => {
cy.visit('/login');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click();
cy.get('.ipc-file-popover-button').click();
cy.get('#ipc-dashboard-download-button').click();
});

Expand Down
11 changes: 6 additions & 5 deletions cypress/e2e/features/programs.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,27 @@ describe('Create account for Dashboard tests', () => {
});
});

describe('Upload a program modal for Dashboard', () => {
describe('Deploy a program modal for Dashboard', () => {
const fixtureFile = 'upload_test_program.zip';

beforeEach(() => {
cy.visit('/login');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click();
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-deploy-button').click().wait(2500);
cy.get('.ipc-new-elem-button').click();
cy.get('#ipc-deploy-button').click({ force: true }).wait(2500);
});

it('Good number of buttons after upload', () => {
it('Good number of buttons after deployment', () => {
cy.get('#ipc-dashboard-deploy-program').attachFile(fixtureFile);
cy.get('#ipc-dashboard-deploy-program-modal-button').click();
cy.wait(2000);
cy.get('button').should('have.length', 10);
cy.get('button').should('have.length', 12);
});

it('Good number of buttons after closing modal', () => {
cy.get('#ipc-modal-close-button').click();
cy.get('button').should('have.length', 10);
cy.get('button').should('have.length', 11);
});
});
47 changes: 42 additions & 5 deletions cypress/e2e/front/dashboard.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ describe('Good front for Dashboard', () => {

it('Good name for upload button', () => {
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('.ipc-new-elem-button').click();
cy.get('#ipc-upload-button').should('contain', 'Upload a file');
});

it('Good name for deploy button', () => {
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-deploy-button').should('contain', 'Deploy a program');
});

it('Good name for create folder button', () => {
cy.get('#ipc-create-folder-button').should('contain', 'Create a folder');
});
});

describe('Good Upload file modal front in Dashboard', () => {
Expand All @@ -39,15 +43,16 @@ describe('Good Upload file modal front in Dashboard', () => {
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click();
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-upload-button').click();
cy.get('.ipc-new-elem-button').click();
cy.get('#ipc-upload-button').click({ force: true });
});

it('Good header', () => {
cy.get('header').should('contain', 'Upload a file');
});

it('Good number of buttons', () => {
cy.get('button').should('have.length', 10);
cy.get('button').should('have.length', 13);
});

it('Good number of input', () => {
Expand All @@ -69,15 +74,16 @@ describe('Good Deploy program modal front in Dashboard', () => {
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click();
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-deploy-button').click();
cy.get('.ipc-new-elem-button').click();
cy.get('#ipc-deploy-button').click({ force: true });
});

it('Good header', () => {
cy.get('header').should('contain', 'Deploy a program');
});

it('Good number of buttons', () => {
cy.get('button').should('have.length', 10);
cy.get('button').should('have.length', 13);
});

it('Good number of input', () => {
Expand All @@ -92,3 +98,34 @@ describe('Good Deploy program modal front in Dashboard', () => {
cy.get('#ipc-modal-close-button').should('contain', 'Close');
});
});

describe('Good Create folder modal front in Dashboard', () => {
it('Go to create folder modal into dashboard', () => {
cy.visit('/login');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click();
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('.ipc-new-elem-button').click();
cy.get('#ipc-create-folder-button').click({ force: true });
});

it('Good header', () => {
cy.get('header').should('contain', 'Create a folder');
});

it('Good number of buttons', () => {
cy.get('button').should('have.length', 13);
});

it('Good number of input', () => {
cy.get('input[type=text]').should('have.length', 1);
});

it('Good name for create folder button', () => {
cy.get('#ipc-dashboard-create-folder-modal-button').should('contain', 'Create Folder');
});

it('Good name for close button', () => {
cy.get('#ipc-modal-close-button').should('contain', 'Close');
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/front/home.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('Signup Button front in Home', () => {
});

it('Good URL redirect for create account button', () => {
cy.get('#ipc-home-create-account-button').click().url().should('eq', 'http://localhost:8080/signup');
cy.get('#ipc-home-create-account-button').click().url().should('eq', `${Cypress.config().baseUrl}/signup`);
});
});

Expand All @@ -40,6 +40,6 @@ describe('Login Button front in Home', () => {
});

it('Good URL redirect for login button', () => {
cy.get('#ipc-home-login-button').click().url().should('eq', 'http://localhost:8080/login');
cy.get('#ipc-home-login-button').click().url().should('eq', `${Cypress.config().baseUrl}/login`);
});
});
6 changes: 3 additions & 3 deletions cypress/e2e/login.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const mnemonic = 'repair nest celery light distance coil giant pyramid poet suit trim fluid';
const mnemonic = 'enlist deny plug hockey sign dirt rebel nothing tobacco dream error fever';

describe('Good front for Login', () => {
it('Go to login', () => {
Expand Down Expand Up @@ -41,7 +41,7 @@ describe('Login with credentials Button for Login', () => {
});

it('Good URL redirect for login button', () => {
cy.get('#ipc-login-credentials-button').click().url().should('eq', 'http://localhost:8080/dashboard');
cy.get('#ipc-login-credentials-button').click().url().should('eq', `${Cypress.config().baseUrl}/dashboard`);
});
});

Expand All @@ -51,6 +51,6 @@ describe('Signup Button for Login', () => {
});

it('Good URL redirect for signup button', () => {
cy.get('#ipc-login-signup-button').click().url().should('eq', 'http://localhost:8080/signup');
cy.get('#ipc-login-signup-button').click().url().should('eq', `${Cypress.config().baseUrl}/signup`);
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/signup.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('Signup with credentials Button for Signup', () => {
});

it('Good URL redirect for close button', () => {
cy.get('#ipc-modal-close-button').click().url().should('eq', 'http://localhost:8080/dashboard');
cy.get('#ipc-modal-close-button').click().url().should('eq', `${Cypress.config().baseUrl}/dashboard`);
});
});

Expand All @@ -78,6 +78,6 @@ describe('Login Button for Signup', () => {
});

it('Good URL redirect for login button', () => {
cy.get('#ipc-signup-login-button').click().url().should('eq', 'http://localhost:8080/login');
cy.get('#ipc-signup-login-button').click().url().should('eq', `${Cypress.config().baseUrl}/login`);
});
});
3 changes: 2 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
output: 'standalone',
}

module.exports = nextConfig
module.exports = nextConfig;
20 changes: 0 additions & 20 deletions nginx.conf

This file was deleted.

Loading