Skip to content

Commit

Permalink
Start the build out of the new UI
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisrohr committed Jul 19, 2023
1 parent 51be5db commit 869a916
Show file tree
Hide file tree
Showing 132 changed files with 12,481 additions and 9,544 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.kiwiproject.champagne.dao;

import java.util.List;

import org.jdbi.v3.sqlobject.config.RegisterRowMapper;
import org.jdbi.v3.sqlobject.customizer.Bind;
import org.jdbi.v3.sqlobject.customizer.BindBean;
Expand All @@ -12,13 +10,15 @@
import org.kiwiproject.champagne.dao.mappers.ComponentMapper;
import org.kiwiproject.champagne.model.Component;

import java.util.List;

@RegisterRowMapper(ComponentMapper.class)
public interface ComponentDao {

@SqlQuery("select * from components where tag in (<tags>)")
List<Component> findComponentsByHostTags(@BindList("tags") List<String> tags);

@SqlUpdate("insert into components (component_name, tag) values (:componentName, :tag)")
@SqlUpdate("insert into components (component_name, tag, deployable_system_id) values (:componentName, :tag, :deployableSystemId)")
@GetGeneratedKeys
long insertComponent(@BindBean Component component);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
package org.kiwiproject.champagne.dao.mappers;

import static org.kiwiproject.jdbc.KiwiJdbc.instantFromTimestamp;
import org.jdbi.v3.core.mapper.RowMapper;
import org.jdbi.v3.core.statement.StatementContext;
import org.kiwiproject.champagne.model.Component;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.jdbi.v3.core.mapper.RowMapper;
import org.jdbi.v3.core.statement.StatementContext;
import org.kiwiproject.champagne.model.Component;
import static org.kiwiproject.jdbc.KiwiJdbc.instantFromTimestamp;

public class ComponentMapper implements RowMapper<Component> {

@Override
public Component map(ResultSet rs, StatementContext ctx) throws SQLException {
return Component.builder()
.id(rs.getLong("id"))
.createdAt(instantFromTimestamp(rs, "created_at"))
.updatedAt(instantFromTimestamp(rs, "updated_at"))
.componentName(rs.getString("component_name"))
.tag(rs.getString("tag"))
.build();
.id(rs.getLong("id"))
.createdAt(instantFromTimestamp(rs, "created_at"))
.updatedAt(instantFromTimestamp(rs, "updated_at"))
.componentName(rs.getString("component_name"))
.tag(rs.getString("tag"))
.deployableSystemId(rs.getLong("deployable_system_id"))
.build();
}

}
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
package org.kiwiproject.champagne.resource;

import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static org.kiwiproject.champagne.model.AuditRecord.Action.CREATED;
import static org.kiwiproject.champagne.model.AuditRecord.Action.DELETED;
import static org.kiwiproject.champagne.model.AuditRecord.Action.UPDATED;
import static org.kiwiproject.search.KiwiSearching.zeroBasedOffset;

import com.codahale.metrics.annotation.ExceptionMetered;
import com.codahale.metrics.annotation.Timed;
import io.dropwizard.auth.Auth;
Expand All @@ -20,21 +14,16 @@
import org.kiwiproject.jaxrs.exception.JaxrsNotAuthorizedException;
import org.kiwiproject.spring.data.KiwiPage;

import java.util.List;
import javax.annotation.security.PermitAll;
import javax.annotation.security.RolesAllowed;
import javax.validation.Valid;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import java.util.List;

import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static org.kiwiproject.champagne.model.AuditRecord.Action.*;
import static org.kiwiproject.search.KiwiSearching.zeroBasedOffset;

@Path("/systems")
@Produces(APPLICATION_JSON)
Expand Down Expand Up @@ -176,4 +165,7 @@ public Response removeUserFromSystem(@PathParam("systemId") long systemId, @Path
deployableSystemDao.deleteUserFromSystem(systemId, userId);
return Response.noContent().build();
}

// TODO: Add endpoint to set and unset existing system user as admin (only can be done by system admins)
// TODO: Add endpoint to retrieve a list of users for the current system (only by system admin)
}
9 changes: 0 additions & 9 deletions ui/.editorconfig

This file was deleted.

3 changes: 1 addition & 2 deletions ui/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export API_BASE_URL=http://localhost:8080/
export HMR_PORT=9000
VITE_API_BASE_URL=http://127.0.0.1:8080
2 changes: 0 additions & 2 deletions ui/.env.gitpod

This file was deleted.

1 change: 0 additions & 1 deletion ui/.env.prod

This file was deleted.

6 changes: 0 additions & 6 deletions ui/.eslintignore

This file was deleted.

24 changes: 24 additions & 0 deletions ui/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
root: true,
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-prettier/skip-formatting'
],
overrides: [
{
files: [
'cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}'
],
'extends': [
'plugin:cypress/recommended'
]
}
],
parserOptions: {
ecmaVersion: 'latest'
}
}
78 changes: 0 additions & 78 deletions ui/.eslintrc.js

This file was deleted.

37 changes: 18 additions & 19 deletions ui/.gitignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
.DS_Store
.thumbs.db
node_modules

# Quasar core related directories
.quasar
/dist

# Cordova related directories and files
/src-cordova/node_modules
/src-cordova/platforms
/src-cordova/plugins
/src-cordova/www

# Capacitor related directories and files
/src-capacitor/www
/src-capacitor/node_modules

# Log files
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
3 changes: 0 additions & 3 deletions ui/.npmrc

This file was deleted.

8 changes: 8 additions & 0 deletions ui/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "none"
}
75 changes: 0 additions & 75 deletions ui/.quasar/app.js

This file was deleted.

Loading

0 comments on commit 869a916

Please sign in to comment.