You just created your project. Next, we recommend you create your first API Key for this project. API Keys allow developers to manage their projects and build applications on top of the Storj network through our
- Uplink CLI.
-
-
-
-
-
-
-
-
-
-
-
diff --git a/web/satellite/src/components/project/ProjectCreationSuccessPopup.scss b/web/satellite/src/components/project/ProjectCreationSuccessPopup.scss
deleted file mode 100644
index a0ffea2d9..000000000
--- a/web/satellite/src/components/project/ProjectCreationSuccessPopup.scss
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright (C) 2019 Storj Labs, Inc.
-// See LICENSE for copying information.
-
-p {
- margin: 0;
-}
-
-.project-creation-success-popup-container {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: rgba(134, 134, 148, 0.4);
- z-index: 1000;
- display: flex;
- justify-content: center;
- align-items: center;
-}
-
-.project-creation-success-popup {
- width: auto;
- background-color: #fff;
- border-radius: 6px;
- display: flex;
- flex-direction: row;
- align-items: flex-start;
- position: relative;
- justify-content: center;
- padding: 140px 120px;
-
- &__info-panel-container {
- display: flex;
- flex-direction: column;
- justify-content: flex-start;
- align-items: flex-start;
- margin-right: 80px;
-
- &__title {
- font-family: 'font_regular', sans-serif;
- color: #34bf89;
- font-size: 46px;
- line-height: 56px;
- width: auto;
- max-width: 290px;
- margin-top: 20px;
- font-weight: 600;
- }
- }
-
- &__form-container {
- width: 100%;
- max-width: 450px;
-
- &__main-label-text {
- font-family: 'font_bold', sans-serif;
- font-size: 32px;
- line-height: 42px;
- color: #384b65;
- margin: 0;
- max-width: 320px;
- }
-
- &__button-container {
- width: 100%;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- margin-top: 20px;
- }
-
- &__confirmation-text {
- font-family: 'font_regular', sans-serif;
- font-size: 16px;
- line-height: 28px;
- color: #373737;
- margin: 19px 0 0 0;
-
- &__link {
- font-family: 'font_bold', sans-serif;
- color: #2683ff;
- }
- }
- }
-
- &__close-cross-container {
- display: flex;
- justify-content: center;
- align-items: center;
- position: absolute;
- right: 30px;
- top: 40px;
- height: 24px;
- width: 24px;
- cursor: pointer;
-
- &:hover .close-cross-svg-path {
- fill: #2683ff;
- }
- }
-}
-
-@media screen and (max-width: 960px) {
-
- .project-creation-success-popup {
-
- &__info-panel-container {
- display: none;
- }
-
- &__form-container {
-
- &__button-container {
- width: 100%;
- }
- }
- }
-}
diff --git a/web/satellite/src/components/project/ProjectCreationSuccessPopup.vue b/web/satellite/src/components/project/ProjectCreationSuccessPopup.vue
deleted file mode 100644
index b5f65c3e9..000000000
--- a/web/satellite/src/components/project/ProjectCreationSuccessPopup.vue
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (C) 2019 Storj Labs, Inc.
-// See LICENSE for copying information.
-
-
-
-
-
-
diff --git a/web/satellite/src/router/index.ts b/web/satellite/src/router/index.ts
index 34c01a5bb..a5f1dfe1b 100644
--- a/web/satellite/src/router/index.ts
+++ b/web/satellite/src/router/index.ts
@@ -12,6 +12,7 @@ import SettingsArea from '@/components/account/SettingsArea.vue';
import ApiKeysArea from '@/components/apiKeys/ApiKeysArea.vue';
import Page404 from '@/components/errors/Page404.vue';
import OnboardingTourArea from '@/components/onboardingTour/OnboardingTourArea.vue';
+import CreateProject from '@/components/project/CreateProject.vue';
import ProjectDashboard from '@/components/project/ProjectDashboard.vue';
import ProjectMembersArea from '@/components/team/ProjectMembersArea.vue';
@@ -38,6 +39,7 @@ export abstract class RouteConfig {
public static Team = new NavigationLink('/project-members', 'Members');
public static ApiKeys = new NavigationLink('/api-keys', 'API Keys');
public static OnboardingTour = new NavigationLink('/onboarding-tour', 'Onboarding Tour');
+ public static CreateProject = new NavigationLink('/create-project', 'Create Project');
// child paths
public static Settings = new NavigationLink('settings', 'Settings');
@@ -151,6 +153,11 @@ export const router = new Router({
name: RouteConfig.OnboardingTour.name,
component: OnboardingTourArea,
},
+ {
+ path: RouteConfig.CreateProject.path,
+ name: RouteConfig.CreateProject.name,
+ component: CreateProject,
+ },
],
},
{
diff --git a/web/satellite/src/store/modules/appState.ts b/web/satellite/src/store/modules/appState.ts
index 89f222cd6..0c5ef1b40 100644
--- a/web/satellite/src/store/modules/appState.ts
+++ b/web/satellite/src/store/modules/appState.ts
@@ -12,13 +12,11 @@ export const appStateModule = {
appState: {
fetchState: AppState.LOADING,
isAddTeamMembersPopupShown: false,
- isNewProjectPopupShown: false,
isAccountDropdownShown: false,
isDeleteProjectPopupShown: false,
isDeleteAccountPopupShown: false,
isSortProjectMembersByPopupShown: false,
isSuccessfulRegistrationShown: false,
- isSuccessfulProjectCreationPopupShown: false,
isEditProfilePopupShown: false,
isChangePasswordPopupShown: false,
isPaymentSelectionShown: false,
@@ -33,11 +31,6 @@ export const appStateModule = {
state.appState.isAddTeamMembersPopupShown = !state.appState.isAddTeamMembersPopupShown;
},
- // Mutation changing new project popup visibility
- [APP_STATE_MUTATIONS.TOGGLE_NEW_PROJECT_POPUP](state: any): void {
- state.appState.isNewProjectPopupShown = !state.appState.isNewProjectPopupShown;
- },
-
// Mutation changing save api key modal visibility
[APP_STATE_MUTATIONS.TOGGLE_SAVE_API_KEY_MODAL](state: any): void {
state.appState.isSaveApiKeyModalShown = !state.appState.isSaveApiKeyModalShown;
@@ -64,10 +57,6 @@ export const appStateModule = {
[APP_STATE_MUTATIONS.TOGGLE_SUCCESSFUL_REGISTRATION](state: any): void {
state.appState.isSuccessfulRegistrationShown = !state.appState.isSuccessfulRegistrationShown;
},
- // Mutation changing 'successful project creation' popup visibility.
- [APP_STATE_MUTATIONS.TOGGLE_SUCCESSFUL_PROJECT_CREATION_POPUP](state: any): void {
- state.appState.isSuccessfulProjectCreationPopupShown = !state.appState.isSuccessfulProjectCreationPopupShown;
- },
[APP_STATE_MUTATIONS.TOGGLE_CHANGE_PASSWORD_POPUP](state: any): void {
state.appState.isChangePasswordPopupShown = !state.appState.isChangePasswordPopupShown;
},
@@ -112,13 +101,6 @@ export const appStateModule = {
commit(APP_STATE_MUTATIONS.TOGGLE_ADD_TEAMMEMBER_POPUP);
},
- [APP_STATE_ACTIONS.TOGGLE_NEW_PROJ]: function ({commit, state}: any): void {
- if (!state.appState.isNewProjectPopupShown) {
- commit(APP_STATE_MUTATIONS.CLOSE_ALL);
- }
-
- commit(APP_STATE_MUTATIONS.TOGGLE_NEW_PROJECT_POPUP);
- },
[APP_STATE_ACTIONS.TOGGLE_SAVE_API_KEY_MODAL]: function ({commit, state}: any): void {
if (!state.appState.isSaveApiKeyModalShown) {
commit(APP_STATE_MUTATIONS.CLOSE_ALL);
@@ -161,13 +143,6 @@ export const appStateModule = {
commit(APP_STATE_MUTATIONS.TOGGLE_SUCCESSFUL_REGISTRATION);
},
- [APP_STATE_ACTIONS.TOGGLE_SUCCESSFUL_PROJECT_CREATION_POPUP]: function ({commit, state}: any): void {
- if (!state.appState.isSuccessfulProjectCreationPopupShown) {
- commit(APP_STATE_MUTATIONS.CLOSE_ALL);
- }
-
- commit(APP_STATE_MUTATIONS.TOGGLE_SUCCESSFUL_PROJECT_CREATION_POPUP);
- },
[APP_STATE_ACTIONS.TOGGLE_CHANGE_PASSWORD_POPUP]: function ({commit}: any): void {
commit(APP_STATE_MUTATIONS.TOGGLE_CHANGE_PASSWORD_POPUP);
},
diff --git a/web/satellite/src/types/payments.ts b/web/satellite/src/types/payments.ts
index 10580b58e..b1314b626 100644
--- a/web/satellite/src/types/payments.ts
+++ b/web/satellite/src/types/payments.ts
@@ -163,6 +163,13 @@ export class PaymentsHistoryItem {
return `${downloadLabel}`;
}
+
+ /**
+ * isTransactionOrDeposit indicates if payments history item type is transaction or deposit bonus.
+ */
+ public isTransactionOrDeposit(): boolean {
+ return this.type === PaymentsHistoryItemType.Transaction || this.type === PaymentsHistoryItemType.DepositBonus;
+ }
}
/**
diff --git a/web/satellite/src/types/projects.ts b/web/satellite/src/types/projects.ts
index fc0386305..5a3922b48 100644
--- a/web/satellite/src/types/projects.ts
+++ b/web/satellite/src/types/projects.ts
@@ -76,16 +76,59 @@ export class UpdateProjectModel {
* CreateProjectModel is a type, used for creating project.
*/
export class CreateProjectModel {
- public name: string;
- public description: string;
- public ownerId: string;
+ private readonly MAX_NAME_LENGTH = 20;
+
+ public constructor(
+ public name: string = '',
+ public description: string = '',
+ public ownerId: string = '',
+ ) {}
+
+ /**
+ * checkName checks if project name is valid.
+ */
+ public checkName(): void {
+ try {
+ this.nameIsNotEmpty();
+ this.nameHasNoSlashes();
+ this.nameHasLessThenTwentySymbols();
+ } catch (error) {
+ throw new Error(error.message);
+ }
+ }
+
+ /**
+ * nameHasNoSlashes checks if project name has any characters but 'slash'.
+ */
+ private nameHasNoSlashes(): void {
+ const rgx = /^[^\/]+$/;
+
+ if (!rgx.test(this.name)) throw new Error('Project name can\'t have slashes!');
+ }
+
+ /**
+ * nameIsNotEmpty checks if project name is not empty.
+ */
+ private nameIsNotEmpty(): void {
+ if (this.name.length === 0) throw new Error('Project name can\'t be empty!');
+ }
+
+ /**
+ * nameHasLessThenTwentySymbols checks if project name has less then 20 symbols.
+ */
+ private nameHasLessThenTwentySymbols(): void {
+ if (this.name.length > this.MAX_NAME_LENGTH) throw new Error('Name should be less than 21 character!');
+ }
}
+/**
+ * ProjectLimits is a type, used for describing project limits.
+ */
export class ProjectLimits {
- constructor(
- public bandwidthLimit = 0,
- public bandwidthUsed = 0,
- public storageLimit = 0,
- public storageUsed = 0,
+ public constructor(
+ public bandwidthLimit: number = 0,
+ public bandwidthUsed: number = 0,
+ public storageLimit: number = 0,
+ public storageUsed: number = 0,
) {}
}
diff --git a/web/satellite/src/utils/validation.ts b/web/satellite/src/utils/validation.ts
index 8daffa4c4..7dddeec05 100644
--- a/web/satellite/src/utils/validation.ts
+++ b/web/satellite/src/utils/validation.ts
@@ -21,13 +21,4 @@ export class Validator {
public static password(password: string): boolean {
return typeof password !== 'undefined' && password.length >= 6;
}
-
- /**
- * Checks string to not include slash.
- */
- public static anyCharactersButSlash(string: string): boolean {
- const rgx = /^[^\/]+$/;
-
- return rgx.test(string);
- }
}
diff --git a/web/satellite/static/images/project/createProject.jpg b/web/satellite/static/images/project/createProject.jpg
deleted file mode 100644
index be32e094b..000000000
Binary files a/web/satellite/static/images/project/createProject.jpg and /dev/null differ
diff --git a/web/satellite/static/images/project/createProject.png b/web/satellite/static/images/project/createProject.png
new file mode 100644
index 000000000..d620bd898
Binary files /dev/null and b/web/satellite/static/images/project/createProject.png differ
diff --git a/web/satellite/static/images/project/projectCreationSuccess.svg b/web/satellite/static/images/project/projectCreationSuccess.svg
deleted file mode 100644
index 9148eb159..000000000
--- a/web/satellite/static/images/project/projectCreationSuccess.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
diff --git a/web/satellite/static/images/project/success.svg b/web/satellite/static/images/project/success.svg
deleted file mode 100644
index 49e6ac65b..000000000
--- a/web/satellite/static/images/project/success.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/web/satellite/tests/unit/components/header/__snapshots__/NewProjectArea.spec.ts.snap b/web/satellite/tests/unit/components/header/__snapshots__/NewProjectArea.spec.ts.snap
index 9f124a5c8..6ce95e040 100644
--- a/web/satellite/tests/unit/components/header/__snapshots__/NewProjectArea.spec.ts.snap
+++ b/web/satellite/tests/unit/components/header/__snapshots__/NewProjectArea.spec.ts.snap
@@ -5,7 +5,6 @@ exports[`NewProjectArea renders correctly without projects and with credit card
+ Create Project
-
`;
@@ -14,58 +13,11 @@ exports[`NewProjectArea renders correctly without projects and with credit card
+ Create Project
-
-
-
-
-
Payment Method Added
-
-
Next, let’s create a project.
-
-
-
-
-
Project Name
-
Up To 20 Characters
-
-
-
0/20
-
-
-
-
-
-
-
-
-
Description
-
Optional
-
-
-
0/100
-
-
-
-
-
-
Back to Billing
-
Next
-
-
-
-
-
`;
exports[`NewProjectArea renders correctly without projects and without payment methods 1`] = `
You just created your project. Next, we recommend you create your first API Key for this project. API Keys allow developers to manage their projects and build applications on top of the Storj network through our
- Uplink CLI.