Skip to content

Commit

Permalink
feat(files): add create folder feature for onboarding
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichel committed Jun 15, 2021
1 parent 8e03fd8 commit 93e7c7a
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<FilesManagerOnboarding
class="files-manager__onboarding"
:project="project"
:rootFolder="fileStructure"
/>
</template>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,22 @@
display: flex;
gap: $spacing-unit;
}

&__overlay {
position: absolute;
width: 100%;
height: 100%;
padding: $spacing-unit;
background-color: rgba(255, 255, 255, 0.5);

&__folder-form {
position: relative;
top: 33%;
left: 50%;
transform: translateX(-50%);
width: 440px;
padding: $spacing-unit;
@include box-shadow;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,56 @@
{{ $t("FilesManagerOnboarding.createFolderButtonText") }}
</BIMDataButton>
</div>
<transition name="fade">
<div
v-show="showFolderForm"
class="files-manager-onboarding__overlay"
>
<FolderCreationForm
v-if="showFolderForm"
class="files-manager-onboarding__overlay__folder-form"
:project="project" :folder="rootFolder"
@close="showFolderForm = false"
@success="showFolderForm = false"
/>
</div>
</transition>
</div>
</template>

<script>
import { ref } from "vue";
// Components
import BIMDataButton from "@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataButton.js";
import FolderCreationForm from "@/components/specific/files/folder-creation-form/FolderCreationForm";
export default {
components: {
BIMDataButton
BIMDataButton,
FolderCreationForm
},
props: {
project: {
type: Object,
required: true
},
rootFolder: {
type: Object,
required: true
}
},
setup() {
const showFolderForm = ref(false);
const uploadFile = () => {};
const createFolder = () => {};
const createFolder = () => {
showFolderForm.value = true;
};
return {
// References
showFolderForm,
// Methods
createFolder,
uploadFile
Expand Down
2 changes: 1 addition & 1 deletion src/state/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const loadProjectUsers = async project => {
const { mapUsers } = useUser();
let users = [];
if (project.isAdmin) {
await ProjectService.fetchProjectUsers(project);
users = await ProjectService.fetchProjectUsers(project);
users = mapUsers(users);
users.sort((a, b) =>
`${a.firstname}${a.lastname}` < `${b.firstname}${b.lastname}` ? -1 : 1
Expand Down

0 comments on commit 93e7c7a

Please sign in to comment.