Skip to content

Commit

Permalink
Merged main
Browse files Browse the repository at this point in the history
  • Loading branch information
CGoodwin90 committed Mar 1, 2024
2 parents bc16161 + f76bd9c commit dca5786
Show file tree
Hide file tree
Showing 272 changed files with 6,965 additions and 1,977 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module.exports = {
extends: ['next', 'plugin:storybook/recommended'],
rules: {
'import/no-anonymous-default-export': 'off',
'react/no-unescaped-entities': 'off',
'react/no-unescaped-entities': 0,
'react/display-name': 'off',
},
ignorePatterns: ['src/**/*.stories.js'],
ignorePatterns: ['src/**/*.stories.js', 'src/**/*.stories.tsx', 'src/tours'],

overrides: [
{
Expand Down
98 changes: 98 additions & 0 deletions .github/workflows/ui-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Lagoon UI CI

on:
pull_request:
branches:
- main
push:
branches:
- main
- cypress-test

jobs:
format-check:
runs-on: ubuntu-latest

steps:
- name: Install dependencies
run: yarn

- name: Checkout Repository
uses: actions/checkout@v4

- name: Formatting check
run: |
yarn add prettier@2.8.7 @trivago/prettier-plugin-sort-imports
yarn format-check
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Linting
run: |
yarn add typescript
yarn lint
cypress-tests:
runs-on: ubuntu-latest

needs: [format-check, lint]

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Build and start Lagoon-minimal
run: |
cd test
make up
- name: Start ui
env:
GRAPHQL_API: http://0.0.0.0:33000/graphql
KEYCLOAK_API: http://0.0.0.0:38088/auth
run: |
yarn install
yarn build
yarn start &
- name: Run RBAC Cypress Tests
uses: cypress-io/github-action@v6
with:
config-file: ./cypress/cypress.config.ts
auto-cancel-after-failures: 1
wait-on: 'http://localhost:3000'
command: yarn cypress:runRbac
continue-on-error: true

- name: Run General Cypress Tests
uses: cypress-io/github-action@v6
with:
config-file: ./cypress/cypress.config.ts
auto-cancel-after-failures: 1
wait-on: 'http://localhost:3000'
command: yarn cypress:runGeneral
continue-on-error: true

- name: Run Organization Cypress Tests
uses: cypress-io/github-action@v6
with:
config-file: ./cypress/cypress.config.ts
auto-cancel-after-failures: 1
wait-on: 'http://localhost:3000'
command: yarn cypress:runOrganizations
continue-on-error: true

- name: Stop Docker containers
run: |
cd test
make down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build
public
*.min.*
*.yaml
*.yml
3 changes: 2 additions & 1 deletion .storybook/decorators/withLoadingSkeletons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React from 'react';

import ThemedSkeletonWrapper from '../../src/styles/ThemedSkeletonWrapper';
import { darkTheme, lightTheme } from '../../src/styles/theme';

const withLoadingSkeletons = (Story, context) => {
const initialTheme = (context.globals.theme === '' || context.globals.theme ==="dark") ? 'dark' : "light";
const initialTheme = context.globals.theme === '' || context.globals.theme === 'dark' ? 'dark' : 'light';
const {
//@ts-ignore
skeleton: { base, highlight },
Expand Down
2 changes: 1 addition & 1 deletion .storybook/decorators/withMockedAppContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const withMockedAppContext = initialTheme => (Story, context) => {

useEffect(() => {
if (!isDocsPage) {
const initialTheme = (context.globals.theme === '' || context.globals.theme ==="dark") ? 'dark' : "light";
const initialTheme = context.globals.theme === '' || context.globals.theme === 'dark' ? 'dark' : 'light';
const newBg = initialTheme === 'dark' ? '#333333' : '#F8F8F8';

setGlobals({
Expand Down
3 changes: 1 addition & 2 deletions .storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<link rel="shortcut icon" href="/favicon.ico">
<link rel="icon" type="image/png" href="/logo.svg" sizes="192x192">
<link rel="shortcut icon" href="/favicon.ico" /> <link rel="icon" type="image/png" href="/logo.svg" sizes="192x192" />
4 changes: 2 additions & 2 deletions .storybook/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import LagoonTheme from './lagoonTheme';

addons.setConfig({
theme: LagoonTheme,
sidebar:{
sidebar: {
showRoots: false,
}
},
});
4 changes: 2 additions & 2 deletions .storybook/mocks/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import {
ProblemIdentifier,
generateEnvironments,
organizationEmails,
organizationEnvironments,
organizationGroups,
organizationNotifications,
organizationOwners,
organizationProjects,
organizationEnvironments
} from './mocks';

faker.setDefaultRefDate(new Date(`${new Date().getFullYear().toString()}-01-01`));
Expand Down Expand Up @@ -126,7 +126,7 @@ export const MockBulkDeployments = (seed: number) => {
name: faker.lorem.slug({ min: 1, max: 5 }),
created: faker.date.past().toDateString(),
started: faker.date.past().toDateString(),
buildStep:faker.word.words(),
buildStep: faker.word.words(),
completed: faker.date.past().toDateString(),
buildLog: faker.word.words(),
bulkId: faker.string.uuid(),
Expand Down
11 changes: 8 additions & 3 deletions .storybook/mocks/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface Tasks {
created: string;
service: string;
status: string;
id: string;
}[];
environmentSlug: string;
projectSlug: string;
Expand All @@ -27,8 +28,9 @@ interface Task {
status: string;
files: TaskFile[];
logs: string;
taskName?: string;
taskName: string;
name?: string;
id: string;
};
}
faker.setDefaultRefDate(new Date(`${new Date().getFullYear().toString()}-01-01`));
Expand All @@ -45,6 +47,7 @@ export function createTasks(): Tasks {
created: faker.date.anytime().toDateString(),
service: 'cli',
status: faker.helpers.arrayElement(['Pending', 'In progress', 'Completed']),
id: faker.string.uuid(),
};
});

Expand All @@ -66,7 +69,8 @@ export function createTask(): Task {
`::group::${eventName}\n` +
`::${status[Math.floor(faker.number.int({ min: 0, max: 1 }) * status.length)]}:: Job '${jobName}'\n` +
`::step-start::${stepName}\n` +
`::${status[Math.floor(faker.number.int({ min: 0, max: 1 }) * status.length)]
`::${
status[Math.floor(faker.number.int({ min: 0, max: 1 }) * status.length)]
}:: Job '${jobName}' step '${stepName}'\n` +
`::step-end::${stepName}::${duration}\n` +
`${generateLogMessage()}\n` +
Expand All @@ -88,6 +92,7 @@ export function createTask(): Task {
files,
logs: log,
taskName: faker.lorem.slug(2),
id: faker.string.uuid(),
},
};
}
Expand Down Expand Up @@ -311,7 +316,7 @@ export const getDeployment = (seed: number) => {
status: deployStatus(),
created,
started,
buildStep:faker.word.words(3),
buildStep: faker.word.words(3),
completed,
environment: generateEnvironments({ seed }),
remoteId: faker.number.int(),
Expand Down
Loading

0 comments on commit dca5786

Please sign in to comment.